以下为SupeSite程序common.func.php文件 这个文件判别url
自动判断html文件存在,如果已经存在,链接自动变为静态html模式我想把它修改成直接显示成静态html模式 然后用.htaccess或者把它默认的rewrite链接模式改为静态html链接模式默认连接几种模式
默认html模式为
/自定义文件夹/id最后1-2的数字/n-id.html
如:/musxr/20/n-9620.html    /musxr/2/n-962.html默认rewrite模式为
/viewnews-id 自定义后缀
如:/viewnews-1597默认动态链接模式/?viewnews-id 自定义后缀如:/?viewnews-1597
我想把以上动态或者rewrite模式的链接方式任意一种改成html模式 改怎么修改这个文件<?php/*
[SupeSite] (C) 2007-2009 Comsenz Inc.
$Id: common.func.php 11877 2009-03-30 03:11:29Z zhaofei $
*/
if(!defined('IN_SUPESITE')) {
exit('Access Denied');
}function saddslashes($string) {
if(is_array($string)) {
foreach($string as $key => $val) {
$string[$key] = saddslashes($val);
}
} else {
$string = addslashes($string);
}
return $string;
}function parseparameter($param, $nofix=1) {
global $_SCONFIG; $paramarr = array(); if($nofix && !empty($_SCONFIG['pagepostfix'])) {
if(strrpos($param, $_SCONFIG['pagepostfix'])) {
$param = substr($param, 0, strrpos($param, $_SCONFIG['pagepostfix']));
}
} $sarr = explode('/', $param);
if(empty($sarr)) return $paramarr;
if(is_numeric($sarr[0])) $sarr = array_merge(array('uid'), $sarr);
if(count($sarr)%2 != 0) $sarr = array_slice($sarr, 0, -1);
for($i=0; $i<count($sarr); $i=$i+2) {
if(!empty($sarr[$i+1])) $paramarr[$sarr[$i]] = addslashes(str_replace(array('/', '\\'), '', rawurldecode(stripslashes($sarr[$i+1]))));
}
return $paramarr;
}function arraytostring($array, $dot='/') {
$result = $comma = '';
foreach ($array as $key => $value) {
$value = trim($value);
if($value != '') {
$result .= $comma.$key.$dot.rawurlencode($value);
$comma = $dot;
}
}
return $result;
}//将数组加上单引号,并整理成串
function simplode($sarr, $comma=',') {
return '\''.implode('\''.$comma.'\'', $sarr).'\'';
}function gethtmlfile($parray) { $htmlarr = array();
$dirarr = array();
$id = 0; if(empty($parray['page'])) {
unset($parray['page']);
} elseif($parray['page'] < 2) {
unset($parray['page']);
}
if(!empty($parray['uid'])) {
$id = $parray['uid'];
if(!empty($parray['action'])) {
if($parray['action'] == 'space' || $parray['action'] == 'spacelist') {
unset($parray['action']);
} elseif ($parray['action'] == 'viewspace') {
unset($parray['action']);
}
}
} elseif(!empty($parray['itemid'])) {
$id = $parray['itemid'];
} elseif(!empty($parray['tid'])) {
$id = $parray['tid'];
} elseif(!empty($parray['tagid'])) {
$id = $parray['tagid'];
} elseif(!empty($parray['catid'])) {
$id = $parray['catid'];
} elseif(!empty($parray['fid'])) {
$id = $parray['fid'];
} $htmlfilename = str_replace(array('action-', 'uid-', 'itemid-'), array('', '', ''), arraytostring($parray, '-'));
if(!empty($id)) {
$idvalue = ($id>9)?substr($id, -2, 2):$id;
$thedir = $idvalue;
if(!empty($parray['action'])) {
if($parray['action'] == 'viewnews') {
$htmlfilename = "n-{$id}";
if(!empty($parray['page'])) $htmlfilename .= '-'.$parray['page'];
} elseif($parray['action'] == 'viewthread') {
$htmlfilename = "t-{$id}";
}
}
} if(is_dir(H_DIR) || (!is_dir(H_DIR) && @mkdir(H_DIR))) {
if(empty($id)) {
$htmlarr['path'] = H_DIR.'/'.$htmlfilename.'.html';
$htmlarr['url'] = H_URL.'/'.$htmlfilename.'.html';
} else {
$htmldir = H_DIR.'/'.$thedir;
if(is_dir($htmldir) || (!is_dir($htmldir) && @mkdir($htmldir))) {
$htmlarr['path'] = H_DIR.'/'.$thedir.'/'.$htmlfilename.'.html';
$htmlarr['url'] = H_URL.'/'.$thedir.'/'.$htmlfilename.'.html';
} else {
$htmlarr['path'] = H_DIR.'/'.$htmlfilename.'.html';
$htmlarr['url'] = H_URL.'/'.$htmlfilename.'.html';
}
}
} else {
$htmlarr['path'] = S_ROOT.'./'.$htmlfilename.'.html';
$htmlarr['url'] = S_URL.'/'.$htmlfilename.'.html';
} return $htmlarr;
}function geturl($pstring, $urlmode=0) { global $_SGLOBAL, $_SCONFIG, $spaceself; //URL缓存
$cachekey = $pstring.$urlmode;
if(empty($_SGLOBAL['url_cache'])) $_SGLOBAL['url_cache'] = array();
if(!empty($_SGLOBAL['url_cache'][$cachekey])) {
return $_SGLOBAL['url_cache'][$cachekey];
} //url结果
$theurl = ''; //强制php模式
$isphp = !empty($spaceself)?1:strexists($pstring, 'php/1'); //首页链接
if($pstring == 'action/index') $pstring = '';
内容过长 以下省略

?>
如果非需要源文件的话 说声我提供源文件 谢谢各位大哥了