手机端新建文件

/e/xxx/getHtml.php

<?php
require('../class/connect.php');        //引入数据库配置文件和公共函数文件
require('../class/db_sql.php');        //引入数据库操作文件
require("../class/functions.php");
require("../class/t_functions.php");
require("../data/dbcache/class.php");

require('../class/chtmlfun.php');
require LoadLang('pub/fun.php');

$link=db_connect();                //连接MYSQL
$empire=new mysqlquery();        //声明数据库操作类

$classid=(int)$_GET['classid'];
$id=(int)$_GET['id'];

$r=$empire->fetch1("select * from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where id=$id and classid='$classid'");
if($r){
    GetHtml($r['classid'],$r['id'],$r,1);

}

db_close();                        //关闭MYSQL链接
$empire=null;                        //注消操作类变量
?>

pc端修改文件

在自定义函数文件/e/class/userfun.php中添加

function user_ModFun($mid,$isadd,$isq,$classid,$id,$cs){
    ReadFiletext("http://手机端域名/e/xxx/getHtml.php?id=$id&classid=$classid");
}

pc端模型里添加

后台增加信息后处理函数

DELETE FROM tbname WHERE id IN (
    SELECT id from (
        SELECT id FROM tbname  WHERE oldurl in(
            SELECT oldurl FROM tbname  GROUP BY oldurl HAVING count(oldurl) > 1)
            AND id  not IN(SELECT min(id) FROM tbname  GROUP BY oldurl HAVING count(oldurl) > 1)
    ) as t
);

1、打开e/class/functions.php
2、查找'/'.$r[keyname].'/i'替换为'/'.$r[keyname].'(?!(1>)|(1< a="">))/i'

function ReplaceKey($newstext,$classid=0){
global $empire,$dbtbpre,$public_r,$class_r;
if(empty($newstext)||$class_r[$classid]['keycid']==-1)
{return $newstext;}
$where=' where keyurl!=""';
if(!empty($class_r[$classid]['keycid']))
{
    $where=" where keyurl!='' and cid='".$class_r[$classid]['keycid']."'";
}
$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].'(?!([^<]*>)|([^<]*<\ a="">))/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].'(?!([^<]*>)|([^<]*<\ a="">))/i','<a href='.$r[keyurl].' target=_blank class=infotextkey>'.$r[keyname].'</a>',$newstext,$public_r[repkeynum]);
    }
}
return $newstext;

}


  1. <