当前位置:首页 > 文章 > 帝国CMS > 正文内容

帝国cms7.2/7.5插件之多端同步生成插件修改functions.php

3年前 (2022-10-22)帝国CMS6139

GetHtml 函数修改:


//生成内容文件
function GetHtml($classid,$id,$add,$ecms=0,$doall=0){
	global $public_r,$class_r,$class_zr,$fun_r,$empire,$dbtbpre,$emod_r,$class_tr,$level_r,$etable_r;
	$mid=$class_r[$classid]['modid'];
	$tbname=$class_r[$classid][tbname];
	if(InfoIsInTable($tbname))//内部表
	{
		return '';
	}
	if($ecms==0)//主表
	{
		$add=$empire->fetch1("select ".ReturnSqlTextF($mid,1)." from {$dbtbpre}ecms_".$tbname." where id='$id' limit 1");
	}
	$add['id']=$id;
	$add['classid']=$classid;
	if($add['isurl'])
	{
		return '';
	}
	if(empty($doall))
	{
		if(!$add['stb']||$class_r[$add[classid]][showdt]==2||strstr($public_r['nreinfo'],','.$add['classid'].','))//不生成
		{
			return '';
		}

}

//副表
$addr=$empire->fetch1(“select “.ReturnSqlFtextF($mid).” from {$dbtbpre}ecms_”.$tbname.”_data_”.$add[stb].” where id=’$add[id]’ limit 1″);
$add=array_merge($add,$addr);
//路径
$iclasspath=ReturnSaveInfoPath($add[classid],$add[id]);
$doclasspath=eReturnTrueEcmsPath().$iclasspath;//moreport
$createinfopath=$doclasspath;
//建立日期目录
$newspath=”;
if($add[newspath])
{
$createpath=$doclasspath.$add[newspath];
if(!file_exists($createpath))
{
$r[newspath]=FormatPath($add[classid],$add[newspath],1);
}
$createinfopath.=$add[newspath].’/’;
$newspath=$add[newspath].’/’;
}
//新建存放目录
if($class_r[$add[classid]][filename]==3)
{
$createinfopath.=ReturnInfoSPath($add[‘filename’]);
DoMkdir($createinfopath);
$fn3=1;
}
//存文本
if($emod_r[$mid][‘savetxtf’])
{
$stf=$emod_r[$mid][‘savetxtf’];
if($add[$stf])
{
$add[$stf]=GetTxtFieldText($add[$stf]);
}
}
eAutodo_AddDo(‘ReNewsHtml’,$classid,$id,0,0,0);//moreportdo
$GLOBALS[‘navclassid’]=$add[classid];
$GLOBALS[‘navinfor’]=$add;
//取得内容模板
$add[newstempid]=$add[newstempid]?$add[newstempid]:$class_r[$add[classid]][newstempid];
$newstemp_r=$empire->fetch1(“select temptext,showdate from “.GetTemptb(“enewsnewstemp”).” where tempid=’$add[newstempid]’ limit 1″);
$newstemp_r[‘tempid’]=$add[‘newstempid’];
if($public_r[‘opennotcj’])//启用反采集
{
$newstemp_r[‘temptext’]=ReturnNotcj($newstemp_r[‘temptext’]);
}
$newstemptext=$newstemp_r[temptext];
$formatdate=$newstemp_r[showdate];
//文件类型/权限
if($add[groupid]||$class_r[$add[classid]][‘cgtoinfo’])
{
if(empty($add[newspath]))
{
$include=”;
}
else
{
$pr=explode(‘/’,$add[newspath]);
for($i=0;$i<count($pr);$i++)
{
$include.=’../’;
}
}
if($fn3==1)
{
$include.=’../’;
}
$pr=explode(‘/’,$iclasspath);
$pcount=count($pr);
for($i=0;$i<$pcount-1;$i++)
{
$include.=’../’;
}
$include1=$include;
$include.=’e/class/CheckLevel.php’;
$filetype=’.php’;
$addlevel=”<?php
define(’empirecms’,’wm_chief’);
\$check_tbname='”.$class_r[$add[classid]][tbname].”‘;
\$check_infoid=”.$add[id].”;
\$check_classid=”.$add[classid].”;
\$check_path=\””.$include1.”\”;
require(\””.$include.”\”);
?>”;
}
else
{
$filetype=$class_r[$add[classid]][filetype];
$addlevel=”;
}
//取得本目录链接
if($class_r[$add[classid]][classurl]&&$class_r[$add[classid]][ipath]==”)//域名
{
$dolink=$class_r[$add[classid]][classurl].’/’.$newspath;
}
else
{
$dolink=$public_r[newsurl].$iclasspath.$newspath;
}
//返回替换验证字符
$docheckrep=ReturnCheckDoRepStr();
if($add[newstext])
{
if(empty($public_r[‘dorepword’])&&$docheckrep[3])
{
$add[newstext]=ReplaceWord($add[newstext]);//过滤字符
}
if(empty($public_r[‘dorepkey’])&&$docheckrep[4]&&!empty($add[dokey]))//替换关键字
{
$add[newstext]=ReplaceKey($add[‘newstext’],$add[‘classid’]);
}
if($public_r[‘opencopytext’])
{
$add[newstext]=AddNotCopyRndStr($add[newstext]);//随机复制字符
}
}
//返回编译
$newstemptext=GetInfoNewsBq($classid,$newstemp_r,$add,$docheckrep);
//分页字段
$expage=’

帝国cms7.2/7.5插件之多端同步生成插件修改functions.php

扫描二维码推送至手机访问。

版权声明:本文由蓝博发布,如需转载请注明出处。

本文链接:https://blueboss.cn/p/756.shtml

“帝国cms7.2/7.5插件之多端同步生成插件修改functions.php” 的相关文章

IIS环境下开启TAG伪静态帝国CMS的中文TAG提示此TAG不存在

IIS环境下开启TAG伪静态帝国CMS的中文TAG提示此TAG不存在

用帝国cms制作网站或者搬家后,IIS环境下开启TAG伪静态,帝国CMS的中文TAG提示此TAG不存在,是什么问题呢?解决方案: 打开/e/tags/index.php文件 查找: $tagname=RepPostVar($_GET['tagname']); 修改为 $tagname=RepPo...

帝国CMS记录信息发布者IP

帝国CMS记录信息发布者IP

帝国CMS记录信息发布者IP的实现,其实增加字段就可以实现. 增加“infoip”字段,infoip为记录IP的字段,只需将字段设置为录入项或投稿项,增加信息时自动存储发布者IP,字段类型用VARCHAR、长度15。是不是有点简单了呢。...

帝国cms电影模型内容页调用播放器类型

帝国cms电影模型内容页调用播放器类型

一、以图片形式显示 1、在/skin/xin/v/中增加几个播放器的图片 ①图片格式自己定,如:增加了ico的格式,在:系统-系统设置-系统参数设置-文件设置-后台上传文件扩展名-添加ico的图片格式 ②图片的命名:以播放器的ID命名(ID参考:后台-其他-下载模型相关-播放器管理-看播放器对应的I...

帝国cms后台出现Failtoconnectftphost!

帝国cms后台出现Failtoconnectftphost!

帝国cms后台创建新栏目、上传附件会出现错误:Fail to connect ftp host! 后台备份数据库也备份了出现500错误 解决方式 后台 系统设置-ftp设置-php运行安全模式 取消就可以了...

帝国cms信息反馈开启验证码

帝国cms信息反馈开启验证码

1、后台-系统设置-系统参数设置-信息设置-反馈验证码(后面点开启) 2、信息反馈本身并无放置验证码代码,所先复制评论的验证码代码,后台-模板-评论列表模板-管理评论模板-修改-复制其中的验证码代码 代码如下: 验证码:<input name="key" type="text" size=...

帝国CMS更新内容提示Table#039;www_**_com.***_ecms_news_data_#039;doesn#039;texist...

帝国CMS更新内容提示Table#039;www_**_com.***_ecms_news_data_#039;doesn#039;texist...

帝国CMS更新整站内容提示:Table 'www_123_com.***_ecms_news_data_' doesn't exist...的解决办法! 相信很多使用帝国cms模板建站的朋友,都有遇到过类似的问题,那么这个是什么问题呢?其实这个是我们后台:871 文章id为871的文章删除了,但是表...