颠覆与创新

超态信息插件 Sinfo

不想变成栏目的信息不是好信息

更新时间:2016-05-02
首页 > 帝国cms插件帮助 > 同步删除移动端信息文件功能

帝国CMS 同步删除移动端信息文件功能

来源:有故事的人   作者:东坡网   发布日期:2016-04-06 16:27:54   阅读次数:6193


东坡网的 移动端同步生成插件 (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'] 修改成自己的移动端绝对地址。

相关文档
相关插件
联系我们

技术支持:点击这里给我发消息

其它咨询:点击这里给我发消息

微信号:imDP1037,注明东坡网

ECMS互助QQ群:308293433

©2013-2019 DP1037.COM东坡网,致力于帝国cms插件和二次开发,为帝国cms加油! 备案号:粤ICP备14036885号-2

本页采用东坡网【动态页缓存插件】,当前页面缓存时间 2024-03-29 08:36:31
本次重新生成缓存,总耗时 0.003939151763916 秒