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

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

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

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






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