帝国cms⾸页增加php,⾃⼰写的帝国cms后台⽂章添加增加⼆
级或多级联动功能
define('EmpireCMSAdmin','1');
require("../class/connect.php");
require("../class/db_sql.php");
require("../class/functions.php");
require("../data/dbcache/class.php");
$link=db_connect();
$empire=new mysqlquery();
//验证⽤户
$lur=is_login();
$logininid=$lur['userid'];
$loginin=$lur['username'];
$loginrnd=$lur['rnd'];
$loginlevel=$lur['groupid'];
$loginadminstyleid=$lur['adminstyleid'];
$enews=$_GET['enews'];
$classid=(int)$_GET['classid'];
if(empty($class_r[$classid][classid]))
{
printerror("ErrorUrl","(-1)");
}
/
/验证权限
$doselfinfo=CheckLevel($logininid,$loginin,$classid,"news");
if(!$class_r[$classid][tbname]||!$class_r[$classid][classid])
{
printerror("ErrorUrl","(-1)");
}
//⾮终极栏⽬
if(!$class_r[$classid]['islast'])
{
printerror("AddInfoErrorClassid","(-1)");
$fun_r['AdminInfo']='管理信息';
$bclassid=$class_r[$classid][bclassid];
$id=(int)$_GET['id'];
//附件验证码
if($enews=="AddNews")
{
if(!$doselfinfo['doaddinfo'])//增加权限
{
printerror("NotAddInfoLevel","(-1)"); }
$filepass=time();
$word='增加信息';
$ecmsfirstpost=1;
}
else
{
if(!$doselfinfo['doeditinfo'])//编辑权限
{
printerror("NotEditInfoLevel","(-1)"); }
$filepass=$id;
$word='修改信息';
$ecmsfirstpost=0;
}
//审核
$ecmscheck=(int)$_GET['ecmscheck']; $addecmscheck='';
$indexchecked=1;
if($ecmscheck)
{
$addecmscheck='&ecmscheck='.$ecmscheck; $indexchecked=0;
}
$modid=$class_r[$classid][modid];
$enter=$emod_r[$modid]['enter'];
//导航
$url=AdminReturnClassLink($classid).' > '.$word;
//会员组
$sql1=$empire->query("select groupid,groupname from {$dbtbpre}enewsmembergroup order by level");
帝国cms文库模板while($l_r=$empire->fetch($sql1))
{
$ygroup.="".$l_r[groupname]."";
}
if($enews=="AddNews")
{
$group=str_replace(" value=".$class_r[$classid][groupid].">"," value=".$class_r[$classid][groupid]." selected>",$ygroup); }
//初始化数据
$r=array();
$newstime=time();
$r[newstime]=date("Y-m-d H:i:s");
$todaytime=$r[newstime];
$r[checked]=$class_r[$classid][checked];
$r[newspath]=date($class_r[$classid][newspath]);
$r[onclick]=0;
$r[userfen]=0;
$titlefontb="";
$titlefonti="";
$titlefonts="";
$voteeditnum=8;
$voter[width]=500;
$voter[height]=300;
$voter[dotime]='0000-00-00';
$r[dokey]=1;
$titleurl='';
if($public_r['onclickrnd'])
$onclick_rndr=explode(',',$public_r['onclickrnd']);
$r[onclick]=rand(intval($onclick_rndr[0]),intval($onclick_rndr[1]));
$r[totaldown]=$r[onclick];
}
else
{
$r[totaldown]=0;
$r[onclick]=0;
}
//----------- 特殊模型初始化 -----------
//下载地址前缀
if(strstr($enter,',downpath,')||strstr($enter,',onlinepath,'))
{
$downurlqz="";
$newdownqz="";
$downsql=$empire->query("select urlname,url,urlid from {$dbtbpre}enewsdownurlqz order by urlid"); while($downr=$empire->fetch($downsql))
{
$downurlqz.="".$downr[urlname]."";
$newdownqz.="".$downr[urlname]."";
}
}
//html编辑器
if($emod_r[$modid]['editorf']&&$emod_r[$modid]['editorf']!=',')
{
include('ecmseditor/infoeditor/fckeditor.php');
}
//预设投票
if($enews=="AddNews")
{
$infoclassr=$empire->fetch1("select definfovoteid from {$dbtbpre}enewsclass where classid='$classid'"); $definfovoteid=0;
if($infoclassr['definfovoteid'])
$definfovoteid=$infoclassr['definfovoteid'];
}
elseif($emod_r[$modid]['definfovoteid'])
{
$definfovoteid=$emod_r[$modid]['definfovoteid'];
}
if($definfovoteid)
{
//投票
$voter=$empire->fetch1("select * from {$dbtbpre}enewsvotemod where voteid='$definfovoteid'");
if($voter['voteid']&&$voter[votetext])
{
$d_record=explode("\r\n",$voter[votetext]);
for($i=0;$i
{
$j=$i+1;
$d_field=explode("::::::",$d_record[$i]);
$allvote.="
".$j."
";
}
$voteeditnum=$j;
$allvote="
";
}
}
}
//-----------------------------------------修改信息
if($enews=="EditNews")
{
//索引表
$index_r=$empire->fetch1("select id,classid,checked from {$dbtbpre}ecms_".$class_r[$classid][tbname]."_index where id='$id' limit 1");
if(!$index_r['id']||$index_r['classid']!=$classid)
{

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。