当前位置:编程学习 > 网站相关 >>

Discuz! X3 SEO设置横线前后不支持空格修改方法

不支持空格,挤得很久,感觉不好看,所以空格还是有需要的,如果你也不知道如何修改discuz论坛的标题横线后面的空格,下面试试吧


第一步:找到文件:/source/class/helper/helper_seo.php


第二步:找到文件的第四十九行:
public static function strreplace_strip_split($searchs, $replaces, $str) {
    $searchspace = array('((\s*\-\s*)+)', '((\s*\,\s*)+)', '((\s*\|\s*)+)', '((\s*\t\s*)+)', '((\s*_\s*)+)');
    $replacespace = array('-', ',', '|', ' ', '_');
    return trim(preg_replace($searchspace, $replacespace, str_replace($searchs, $replaces, $str)), ' ,-|_');
}
替换为:
public static function strreplace_strip_split($searchs, $replaces, $str) {
            $searchspace = array('(((\s)*\-(\s)*)+)', '(((\s)*\,(\s)*)+)', '(((\s)*\|(\s)*)+)', '(((\s)*\t(\s)*)+)', '(((\s)*_(\s)*)+)');
            $replacespace = array('$3-$3', '$3,$3', '$3|$3', '$3 $3', '$3_$3');
            return trim(preg_replace($searchspace, $replacespace, str_replace($searchs, $replaces, $str)), ' ,-|_');
        }
复制代码
第三步:更新缓存,OK!
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,