本篇文章给大家谈谈帝国cms签到代码,以及帝国cms自动发布对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。
本文目录一览:
- 1、帝国cms 批量定时审核 代码 或者插件 我知道帝国cms 可以设置任务自动刷新首页和栏目
- 2、帝国CMS灵动标签中的这段代码有知道的朋友吗
- 3、如何在帝国CMS系统添加代码?
- 4、帝国CMS 求这个代码产生一个随机数字1-10之间
- 5、帝国cms怎么批量添加信息的tags
1、帝国cms 批量定时审核 代码 或者插件 我知道帝国cms 可以设置任务自动刷新首页和栏目
在首页模板中加入下面代码,尽量放在底部。
script language="javascript" type="text/javascript" src="/e/htmlindex/index_html.php"/script
在 /e/ 建立文件夹 htmlindex 并设置 777权限
将下面代码保存在 /e/htmlindex/index_html.php
修改刷新时间,将文件中1200改为你想要的时间,单位为秒。
?php
require("../class/connect.php");
include("../class/db_sql.php");
include("../class/config.php");
include("../class/functions.php");
include("../class/t_functions.php");
require LoadLang("pub/fun.php");
require("../data/dbcache/class.php");
require("../data/dbcache/MemberLevel.php");
include("../class/chtmlfun.php");
$link=db_connect();
$empire=new mysqlquery();
$filepath_s="indexhtmlhc.txt";
$time=time();
@$filemtime=(int)filemtime($filepath_s)+1200;
/*
函数解释
file_exists() 函数检查文件或目录是否存在。
mkdir() 函数创建目录。
time() 函数返回当前时间的 Unix 时间戳。
filemtime() 函数返回文件内容上次的修改时间。
*/
if (!file_exists($filepath_s)){
fopen($filepath_s, 'w');
@chmod($filepath_s, 0777);
ReIndex();
}elseif(!file_exists($filepath_s) || (filemtime($filepath_s)+1200)time()){
fopen($filepath_s, 'w');
@chmod($filepath_s, 0777);
ReIndex();
}else{
// do nothing
}
db_close();
$empire=null;
?
2、帝国CMS灵动标签中的这段代码有知道的朋友吗
完整代码,自己唔唔
?php
$bclassid=$class_r[$GLOBALS[navclassid]][bclassid];
?
[e:loop={"select classid,classname from {$dbtbpre}enewsclass where bclassid=378 order by myorder,classid desc",0,24,0}]
?php
$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
$bgcolor="";
if($bqr[classid]==$GLOBALS[navclassid])//当前栏目ID
{
$bgcolor="cur";
}
?
li class="item ?=$bgcolor?"a href="?=$classurl?"?=$bqr[classname]?/as class="s"/s/li
[/e:loop]
bclassid=1 是栏目ID 注意 bclassid 是 父栏目 classid 终极栏目
3、如何在帝国CMS系统添加代码?
几种方式:
1、直接在帝国定义的userfun.php中扩充你自己定义的函数,然后在相应的程序页面中直接引用函数即可;
2、在列表模版可以勾选“使用程序代码”,然后写入PHP代码;
3、在相应的页面模版中直接嵌入PHP代码;
4、单独写PHP程序,放在某个目录下作为扩展,然后在帝国相应程序页面中引用。
4、帝国CMS 求这个代码产生一个随机数字1-10之间
你的意思是想产生一个随机数来随机调用一个新闻或什么的吧?
可以用随机函数来生成。再传给相应的变量。
11小游戏 祝你好运!
5、帝国cms怎么批量添加信息的tags
修改步骤:
1、以下代码加入到admin/ecmsinfo.php,在任意2个elseif中间插入就行
elseif($enews=="AddTags_all")//列表批量添加Tags
{
$classid=$_POST['classid'];
$id=$_POST['id'];
$tags=$_POST['add_listtags'];
$newstime=time();
eInsertTags2($tags,$classid,$id,$newstime);
}
2、将以下代码加入到class/uesrfun.php
//加入TAG表
function eInsertTags2($tags,$classid,$id,$newstime){
global $empire,$dbtbpre,$class_r;
if(!trim($tags))
{
printerror("TAGS信息不能为空", "", 1, 0, 1);
return '';
}
$count = count($id); //统计ID数量
$tags = RepPostVar($tags);
$tag = explode(",", $tags);
if (emptyempty($count))
{
printerror("未选择信息ID", "", 1, 0, 1);
}
if (count($tag)1)
{
printerror("只能添加一个TAGS词", "", 1, 0, 1);
}
$classid=(int)$classid;
$id[$i] = (int)$id[$i];
$mid=(int)$class_r[$classid][modid];
for($i=0;$i$count;$i++)
{
$tbname=$class_r[$classid][tbname];//获取表名
$r=$empire-fetch1("select tagid from {$dbtbpre}enewstags where tagname='$tags' limit 1");
$t = $empire-fetch1("select infotags from {$dbtbpre}ecms_".$tbname." where id='$id[$i]'");
$taga=$t['infotags'].",".$tags; //组合TAGS
$tagb[$i] = explode(",",$taga); //设置数组
$tagc=array_values(array_unique($tagb[$i])); //数组排重
for($t=0;$tcount($tagc);$t++)
{//二级子循环TAGS数组输出
$newtags[$i].= ",".$tagc[$t];
}
if($r[tagid])
{
$datar=$empire-fetch1("select tagid,classid,newstime from {$dbtbpre}enewstagsdata where tagid='$r[tagid]' and id='$id[$i]' and mid='$mid' limit 1");
if($datar[tagid])
{
if($datar[classid]!=$classid||$datar[newstime]!=$newstime)
{
$empire-query("update {$dbtbpre}enewstagsdata set classid='$classid',newstime='$newstime' where tagid='$r[tagid]' and id='$id[$i]' and mid='$mid' limit 1");
}
}
else
{
$empire-query("update {$dbtbpre}enewstags set num=num+1 where tagid='$r[tagid]'");
$empire-query("update {$dbtbpre}ecms_".$tbname." set infotags='".trim($newtags[$i],",")."' where id='$id[$i]'");
$empire-query("insert into {$dbtbpre}enewstagsdata(tagid,classid,id,newstime,mid) values('$r[tagid]','$classid','$id[$i]','$newstime','$mid');");
}
}
else
{
$empire-query("update {$dbtbpre}ecms_".$tbname." set infotags='".trim($newtags[$i],",")."' where id='$id[$i]'");
$empire-query("insert into {$dbtbpre}enewstags(tagname,num,isgood,cid) values('$tags',1,0,0);");
$tagid=$empire-lastid();
$empire-query("insert into {$dbtbpre}enewstagsdata(tagid,classid,id,newstime,mid) values('$tagid','$classid','$id[$i]','$newstime','$mid');");
}
}
printerror("批量添加TAGS成功", "", 1, 0, 1);
}
3、信息管理列表模板最后一列修改成以下代码,在e/data/html/list/文件夹内
td height="25" colspan="8"
table width="100%" border="0" cellpadding="0" cellspacing="0"
tr
td width="68%" height="25"
font color="#666666"备注:多选框蓝色为未审核信息;发布者红色为会员投稿;信息ID粗体为未生成,点击ID可刷新页面./font
/td
td width="32%" input type="text" name="add_listtags" id="add_listtags" size="50" value="" /
input type="submit" name="Submit100" value="添加TAGS" onClick="document.listform.enews.value='AddTags_all';document.listform.action='ecmsinfo.php';"
/td
/tr
/table
/td
帝国cms签到代码的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于帝国cms自动发布、帝国cms签到代码的信息别忘了在本站进行查找喔。