让海洋CMS的导演和演员数据支持斜杠/分隔符

admin 11月前 336

编辑 /include/common.func.php 文件第1386行,找到
function getKeywordsList($key,$span){
    if($key=='')return $key;
    $keyWordsStr="";
    $keystr=str_replace(",",",",$key);
    if (strpos($keystr,",")>0){$keyWordsArray=explode(",",$keystr);}else{$keyWordsArray=explode(" ",$keystr);}
    for($kli=0;$kli<count($keyWordsArray);$kli++){
        $keyWordsStr.="<a href='/".$GLOBALS['cfg_cmspath']."search.php?searchword=".urlencode($keyWordsArray[$kli])."'>".$keyWordsArray[$kli]."</a>".$span;
    }
    return $keyWordsStr;
}

function getJqList($key,$span){
    if($key=='')return $key;
    $keyWordsStr="";
    $keystr=str_replace(",",",",$key);
    if (strpos($keystr,",")>0){$keyWordsArray=explode(",",$keystr);}else{$keyWordsArray=explode(" ",$keystr);}
    for($kli=0;$kli<count($keyWordsArray);$kli++){
        $keyWordsStr.="<a href='/".$GLOBALS['cfg_cmspath']."search.php?searchtype=5&jq=".urlencode($keyWordsArray[$kli])."'>".$keyWordsArray[$kli]."</a>".$span;
    }
    return $keyWordsStr;
}
修改为
function getKeywordsList($key,$span){
    if($key=='')return $key;
    $keyWordsStr="";
    $keystr=str_replace(",",",",$key);
    $keystr=str_replace(" / ",",",$key);
    if (strpos($keystr,",")>0){$keyWordsArray=explode(",",$keystr);}else{$keyWordsArray=explode(" ",$keystr);}
    for($kli=0;$kli<count($keyWordsArray);$kli++){
        $keyWordsStr.="<a href='/".$GLOBALS['cfg_cmspath']."search.php?searchword=".urlencode($keyWordsArray[$kli])."'>".$keyWordsArray[$kli]."</a>".$span;
    }
    return $keyWordsStr;
}

function getJqList($key,$span){
    if($key=='')return $key;
    $keyWordsStr="";
    $keystr=str_replace(",",",",$key);
    if (strpos($keystr,",")>0){$keyWordsArray=explode(",",$keystr);}else{$keyWordsArray=explode(" ",$keystr);}
    for($kli=0;$kli<count($keyWordsArray);$kli++){
        $keyWordsStr.=" / <a href='/".$GLOBALS['cfg_cmspath']."search.php?searchtype=5&jq=".urlencode($keyWordsArray[$kli])."'>".$keyWordsArray[$kli]."</a>".$span;
    }
    return $keyWordsStr;
}
此时已经实际将斜杠转换成SeaCMS默认的空格分隔符效果。

如果要像豆瓣那样中间有不带超链接的斜杠分隔,继续修改:
编辑 /include/mkhtml.func.php 文件第507行,找到
$content=str_replace("{playpage:actor}",getKeywordsList($v_actor," "),$content);
$content=str_replace("{playpage:director}",getKeywordsList($row['v_director']," "),$content);
修改为:
$content=str_replace("{playpage:actor}",getKeywordsList($v_actor," / "),$content);
$content=str_replace("{playpage:director}",getKeywordsList($row['v_director']," / "),$content);




原文:https://www.2dan.cc/seacms/xiegang-fengefu.html
最新回复 (0)
返回
发新帖