以下是解決方法,已測試!
在e/class/functions.php中,查找代碼:
“ function ReplaceKey($newstext,$classid=0)” 或 “//替換關鍵字”
(有時打開為utf-8時中文顯示為亂碼)
把這一大段大部分(即:“//替換關鍵字”部分)替換為以下代碼:
//替換關鍵字
function?ReplaceKey($newstext,$classid=0){
????global?$empire,$dbtbpre,$public_r,$class_r;
????if(empty($newstext)||$class_r[$classid]['keycid']==-1)
????{return?$newstext;}
????$where='';
????if(!empty($class_r[$classid]['keycid']))
????{
????????$where="?where?cid='".$class_r[$classid]['keycid']."'";
????}
????$newstext=stripslashes($newstext);
????preg_match_all('/<a[^>](.*)a>|<img[^>](.*)>/isU',stripslashes($newstext),$rs);
???
????if($rs[0]){
????????foreach($rs[0]?as?$k=>$v){
????????????$newstext=str_replace($v,"[!--{$k}--]",$newstext);?
????????}
????}
????$sql=$empire->query("select?keyname,keyurl?from?{$dbtbpre}enewskey".$where);
????while($r=$empire->fetch($sql))
????{
????????if(STR_IREPLACE)
????????{
????????????$newstext=empty($public_r[repkeynum])?str_ireplace($r[keyname],'<a?href='.$r[keyurl].'?target=_blank?class=infotextkey>'.$r[keyname].'</a>',$newstext):preg_replace('/'.$r[keyname].'/i','<a?href='.$r[keyurl].'?target=_blank?class=infotextkey>'.$r[keyname].'</a>',$newstext,$public_r[repkeynum]);
????????}
????????else
????????{
????????????$newstext=empty($public_r[repkeynum])?str_replace($r[keyname],'<a?href='.$r[keyurl].'?target=_blank?class=infotextkey>'.$r[keyname].'</a>',$newstext):preg_replace('/'.$r[keyname].'/i','<a?href='.$r[keyurl].'?target=_blank?class=infotextkey>'.$r[keyname].'</a>',$newstext,$public_r[repkeynum]);
????????}
????}
????if($rs[0]){
????????foreach($rs[0]?as?$k=>$v){
????????????$newstext=str_replace("[!--{$k}--]",$v,$newstext);?
????????}
????}
????return?$newstext;
}