帝国cms移动端插件同步删除文章内容手机文件方法

帝国CMS移动端同步插件在后台删除信息后手机端其实并没有同步删除,通过修改系统默认文件来实现这个功能。

在没修改前需要手工去手机端目录去删除文件,现在有方法解决了这个问题,代码如下:

找到文件件e/class/functions.php,查找"function DelNewsFile",找到函数DelNewsFile,把开头和结尾中间部分替换成以下代码:
大概在1502 到1576左右
  1. function DelNewsFile($filename,$newspath,$classid,$newstext,$groupid=0){
  2.         global $class_r,$addgethtmlpath,$mob_r;
  3.         include_once ECMS_PATH."e/dongpo/mob/config.php";
  4.         //文件类型
  5.         if($groupid)
  6.         {
  7.                 $filetype=".php";
  8.         }
  9.         else
  10.         {
  11.                 $filetype=$class_r[$classid][filetype];
  12.         }
  13.         //是否有日期目录
  14.         if(empty($newspath))
  15.         {
  16.                 $mynewspath="";
  17.     }
  18.         else
  19.         {
  20.                 $mynewspath=$newspath."/";
  21.     }
  22.         $iclasspath=ReturnSaveInfoPath($classid,$id);
  23.         $r=explode("[!--empirenews.page--]",$newstext);
  24.         for($i=1;$i<=count($r);$i++)
  25.         {
  26.                 if(strstr($filename,'/'))
  27.                 {
  28.                         DelPath(eReturnTrueEcmsPath().$iclasspath.$mynewspath.ReturnInfoSPath($filename));
  29.                         DelPath($mob_r['msitepath'].$iclasspath.$mynewspath.ReturnInfoSPath($filename));
  30.                 }
  31.                 else
  32.                 {
  33.                         if($i==1)
  34.                         {
  35.                                 $file=eReturnTrueEcmsPath().$iclasspath.$mynewspath.$filename.$filetype;
  36.                                 $mfile=$mob_r['msitepath'].$iclasspath.$mynewspath.$filename.$filetype;
  37.                         }
  38.                         else
  39.                         {
  40.                                 $file=eReturnTrueEcmsPath().$iclasspath.$mynewspath.$filename."_".$i.$filetype;
  41.                                 $mfile=$mob_r['msitepath'].$iclasspath.$mynewspath.$filename."_".$i.$filetype;
  42.                         }
  43.                         DelFiletext($file);
  44.                         DelFiletext($mfile);
  45.                 }
  46.         }
  47. }
复制代码





上一篇:帝国cms动态连接模板不是识别标签的解决方法
下一篇:帝国在封面页显示当前栏目下的二级栏目、所有信息