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

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

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

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://www.blueboss.cn/p/756.shtml

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

帝国CMS下载不弹出窗口的修改方法

帝国CMS下载不弹出窗口的修改方法

帝国CMS在下载模板的时候,如果不采用弹出式下载的话,可以试试下面的方法: 步骤如下: 1.修改下载地址模板("公共模板" -> "修改下载地址模板"): 将: [ <a href=#edown onclick="window.open('[!---down.url--]','','w...

帝国cms内容页文章种添加广告环绕内容显示

帝国cms内容页文章种添加广告环绕内容显示

帝国CMS内容页模板加环饶广告代码方法!一起来看看吧: <div id="ad">[phomead]广告ID[/phomead]</div><style type="text/css"><!--#ad {float: right;}--></s...

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

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

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

帝国CMS几个函数RepPostVarRepPostVar2RepPostStrRepPostStr2的用法

帝国CMS几个函数RepPostVarRepPostVar2RepPostStrRepPostStr2的用法

帝国CMS常用或者经常遇到的几个函数RepPostVar,RepPostVar2,RepPostStr,RepPostStr2的用法! (1)、数字型变量可以用(int)或intval函数处理,例子: $page=(int)$_GET['page']; 或 $page=intval($_GET['p...

帝国cms后台出现Failtoconnectftphost!

帝国cms后台出现Failtoconnectftphost!

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

帝国CMS使用esub/substr截取前面(或后面)两个字符(或多个字符)

帝国CMS使用esub/substr截取前面(或后面)两个字符(或多个字符)

帝国CMS怎么用灵动标签使用esub/substr截取前面,或者截取后面两个字符或者多个字符呢? ①、帝国网站 显示是"帝国" (这是灵动标签默认的截取标签字段“esub”), [e:loop={'select * from phome_enewsclass where bclassid=0 or...