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

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

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

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” 的相关文章

帝国CMS内容页模板判断字段为空不显示

帝国CMS内容页模板判断字段为空不显示

帝国CMS内容页模板怎么样才能让某一个字段,如果填写了就显示,没有填写就不显示呢?其实方法很简单,下面帝国cms模板网就来告诉大家怎么调用: <?phpif($navinfor[字段名]){?>字段有值时显示的内容,如[!---字段名--]<?}else{?>字段无值时显示...

帝国cms远程图片本地化不生效原因以及解决方法

帝国cms远程图片本地化不生效原因以及解决方法

帝国cms远程图片本地化不生效原因1、图片格式和大小设置问题帝国默认的图片格式不包括png,但是我们现在qq截图等都是png图片格式,加进去即可,假如源站的图片格式帝国后台没有,那肯定保存不了了。系统参数设置——文件设置——文件扩展名同时设置可以上传图片大小。2、服务器配置问题需要在php.in中把...

帝国cms栏目自定义字段调用标签

帝国cms栏目自定义字段调用标签

内容页和列表页调用当前栏目自定义字段的标签都是一样的,调用代码如下: <?=ReturnClassAddField(0,'自定义字段')?>没什么说的,这很简单。...

帝国CMS模板中内容关键字加粗显示加背景颜色等

帝国CMS模板中内容关键字加粗显示加背景颜色等

帝国cms模板内容里面,要关键词加粗,加背景颜色,调整下css即可。 关键字的class在 e/class/functions.php,搜索 function ReplaceKey 或 class=infotextkey 找到后在自己css文件中定义这个(class=infotextkey)css...

帝国CMS用PHP获取任意栏目ID

帝国CMS用PHP获取任意栏目ID

帝国cms模板中,如果栏目层级比较深,而且又要在栏目里面获取上级栏目或者下级栏目的一些数据时,获取到该栏目ID,上级栏目,上上级栏目,直到顶级栏目ID就很关键了  具体方法如下: 一,在模板页面,通过PHP先获取当前栏目的ID: <?php     $a=$GLOBALS[navclassi...

帝国CMS内容页字段为空判断的用法

帝国CMS内容页字段为空判断的用法

帝国CMS内容页中,如果某个字段没有填写内容就不显示,填写了就正常显示,这种效果怎么实现? PHP判断实现,代码如下: <?php if($navinfor[字段名]) { ?> 现在的内容 <? } else { ?> 不显示 <? } ?>...