新年优惠价:最高返 500 抵扣券 → 查看活动!>>>

帝国CMS使用移动端同步生成插件删除手机端不同步解决办法

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

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

找到文件件e/class/functions.php,查找"function DelNewsFile",找到函数DelNewsFile,把开头和结尾中间部分替换成以下代码:

function DelNewsFile($filename,$newspath,$classid,$newstext,$groupid=0){
global $class_r,$addgethtmlpath,$mob_r;
include_once ECMS_PATH."e/dongpo/mob/config.php";
if(!trim($filename)||!$classid||!$class_r[$classid][classpath])
{
return '';
}
if(strstr($filename,'/'))
{
$etfilename=ReturnInfoSPath($filename);
if(!trim($etfilename)||strstr($etfilename,'/'))
{
return '';
}
}
//文件类型
if($groupid)
{
$filetype=".php";
}
else
{
$filetype=$class_r[$classid][filetype];
}
//是否有日期目录
if(empty($newspath))
{
$mynewspath="";
}
else
{
$mynewspath=$newspath."/";
}
$iclasspath=ReturnSaveInfoPath($classid,$id);
$r=explode("[!--empirenews.page--]",$newstext);
$pagecount=count($r);
for($i=1;$i<=$pagecount;$i++)
{
if(strstr($filename,'/'))
{
DelPath(eReturnTrueEcmsPath().$iclasspath.$mynewspath.ReturnInfoSPath($filename));
DelPath($mob_r['msitepath'].$iclasspath.$mynewspath.ReturnInfoSPath($filename));
break;
}
else
{
if($i==1)
{
$file=eReturnTrueEcmsPath().$iclasspath.$mynewspath.$filename.$filetype;
$mfile=$mob_r['msitepath'].$iclasspath.$mynewspath.$filename.$filetype;
}
else
{
$file=eReturnTrueEcmsPath().$iclasspath.$mynewspath.$filename."_".$i.$filetype;
$mfile=$mob_r['msitepath'].$iclasspath.$mynewspath.$filename."_".$i.$filetype;
}
DelFiletext($file);
DelFiletext($mfile);
}
}
//moreportdo
if($filename)
{
if(strstr($filename,'/'))
{
$eautodofile=$iclasspath.$mynewspath.ReturnInfoSPath($filename);
$eautodofname='delpath|'.$eautodofile.'||';
eAutodo_AddDo('eDelFileInfo',0,0,0,0,0,$eautodofname);
}
else
{
$eautodofile=$iclasspath.$mynewspath.$filename;
$eautodofname='delfile|'.$eautodofile.'|'.$filetype.'|'.$pagecount;
eAutodo_AddDo('eDelFileInfo',0,0,0,0,0,$eautodofname);
}
}
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

给TA打赏
共{{data.count}}人
人已打赏
豆包可以帮你高效完成AI问答、AI对话、提供软件相关教程以及解决生活中遇到的各种疑难杂症,还能帮助你进行AI写作、AI绘画等等,提高你的工作学习效率。
!
你也想出现在这里?立即 联系我们吧!
信息
个人中心
购物车
优惠劵
今日签到
搜索