东坡网的 移动端同步生成插件 (http://dp1037.com/dpinfo-1-12-0.html),可自动同步生成的页面有:首页、栏目页、内容页、专题页、专题子类、标题分类页、自定义列表页。
安装此插件后,众多同学们都表示“工作负担大大减轻,压力上感觉不到移动端的存在。”
但,如果要删除某文章,移动端已经生成的文件却不能同步删除,是个大麻烦。。
为此,我们进行了插件更新,只需修改一个系统函数即可。
打开文件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($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);
for($i=1;$i<=count($r);$i++)
{
if(strstr($filename,'/'))
{
DelPath(eReturnTrueEcmsPath().$iclasspath.$mynewspath.ReturnInfoSPath($filename));
DelPath($mob_r['msitepath'].$iclasspath.$mynewspath.ReturnInfoSPath($filename));
}
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);
}
}
}
(1)以上蓝色部分代码是新增的,你也可以仅增加蓝色部分代码。
(2)对于没有使用过东坡网移动端同步生成插件的帝国程序也可以使用,需要将上述代码中的 $mob_r['msitepath'] 修改成自己的移动端绝对地址。
©2013-2019 DP1037.COM东坡网,致力于帝国cms插件和二次开发,为帝国cms加油! 备案号:粤ICP备14036885号-2