zoukankan      html  css  js  c++  java
  • 关键字替换排除HTML标签属性字符

    解决办法:

    1、打开文件e/class/functions.php

    2、找到函数

    ReplaceKey($newstext,$classid=0)

    3、找到替换代码

    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]);
    }
    4、用下面代码替换
    if(STR_IREPLACE)
    {
        $newstext=preg_replace('/(?!<[^>]*)'.$r[keyname].'(?![^<]*>)/i','<a href='.$r[keyurl].' target=_blank class=infotextkey>'.$r[keyname].'</a>',$newstext,$public_r[repkeynum]?$public_r[repkeynum]:-1);
    }
    else
    {
        $newstext=preg_replace('/(?!<[^>]*)'.$r[keyname].'(?![^<]*>)/i','<a href='.$r[keyurl].' target=_blank class=infotextkey>'.$r[keyname].'</a>',$newstext,$public_r[repkeynum]?$public_r[repkeynum]:-1);
    }
  • 相关阅读:
    Java8-Stream-No.10
    Java8-Stream-No.09
    Java8-Stream-No.08
    Java8-Stream-No.07
    Java8-Stream-No.06
    Java8-Stream-No.05
    Java8-Stream-No.04
    Java8-Stream-No.03
    Java8-Stream-No.02
    Java8-Stream-No.01
  • 原文地址:https://www.cnblogs.com/wordgao/p/3849214.html
Copyright © 2011-2022 走看看