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

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

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

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级、2级)、推荐(1级、2级)方法1、同时调用头条(1级、2级)、推荐(1级、2级) [e:loop={0,10,3,0,'isgood=1 or firsttitle=1 orisgood=2 or firsttitle=2'}] <a href="<...

帝国cms模板内容页SQl调用当前TAG标签

帝国cms模板内容页SQl调用当前TAG标签

帝国cms内容页SQl方式调用当前TAG标签的方式 具体调用代码如下: <?php $fr=$empire->fetch1("select infotags from {$dbtbpre}ecms_news_data_{$navinfor[stb]} where id='$navinf...

帝国cms模板使用的灵动标签常用的变量

帝国cms模板使用的灵动标签常用的变量

[e:loop={栏目ID,显示条数,操作类型,只显示有标题图片,附加SQL条件,显示排序}] <?=$bqno?><a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?><...

帝国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灵动标签调用副表字段内容

在灵动标签循环内用SQL读取副表内容。下面以读取新闻副表中的newstext字段为例: [e:loop={0,1,3,0}] <?php $fr=$empire->fetch1("select newstext from {$dbtbpre}ecms_news_data_{$bqr[s...