<?php
define('EmpireCMSAdmin','1');
require("../../class/connect.php");
require("../../class/db_sql.php");
require("../../class/functions.php");
require("fun.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'];
//ehash
$ecms_hashur=hReturnEcmsHashStrAll();
//验证权限
CheckLevel($logininid,$loginin,$classid,"class");
$enews=$_GET['enews'];
if($_GET['from'])
{
$listclasslink="ListPageClass.php";
}
else
{
$listclasslink="ListClass.php";
}
//批量加栏目
if($_POST)
{
require("../../class/classfun.php");
require("../../class/t_functions.php");
$classname=$_POST['classname'];
$classpath=$_POST['classpath'];
$classlast=$_POST['classlast'];
$intro=$_POST['intro'];
$zj=$_POST['zj'];
$cname_arr=explode("\r\n",$classname);
$cpath_arr=explode("\r\n",$classpath);
$clast_arr=explode("\r\n",$classlast);
$intro_arr=explode("\r\n",$intro);
foreach($cname_arr as $k=>$v){
$v=trim($v);
if($v)
{
if(!empty($cpath_arr[$k]))
{
$_POST['classpath']=$cpath_arr[$k];
}
else
{
$_POST['classpath']=ReturnPinyinFun($v);//取拼音目录
}
if(!empty($clast_arr[$k]))
{
$zj=$clast_arr[$k];
}
if($zj==1)//判断是否终极栏目
{
$_POST['islast']=1;
$_POST['listtempid']=1;
$_POST['dtlisttempid']=1;
$_POST['newstempid']=1;
}
if($zj==0)
{
$_POST['islast']=0;
}
$_POST['classname']=$v;
$_POST['intro']=$intro_arr[$k];//栏目简介 BY 2014-10-09 17:20
$_POST['pl']=1;
AddTree($_POST,$logininid,$loginin);
}
}
Delcache();
}
$url="<a href=".$listclasslink.">栏目管理</a> > 增加栏目";
$zt="";
$b_ok=1;
$hiddenclass="<script>document.getElementById('smallclass').style.display='none';document.getElementById('smallclasssetinfo').style.display='none';document.getElementById('smallclasssettemp').style.display='none';document.getElementById('smallcgtoinfo').style.display='none';</script>";
//初使化数据
$r[myorder]=0;
$r[listorder]="id DESC";
$r[reorder]="newstime DESC";
$islast="";
$filename0=" checked";
$filename1="";
$filename2="";
$openpl0=" checked";
$openpl1="";
$openadd0=" checked";
$openadd1="";
$r[classtype]=".html";
$r[filetype]=".html";
$r[newspath]="Y-m-d";
$r[link_num]="10";
$r[lencord]=25;
$read="";
$r[newline]=10;
$r[hotline]=10;
$r[goodline]=10;
$r[hotplline]=10;
$r[firstline]=10;
$r[maxnum]=0;
$r[addinfofen]=0;
$r[doctime]=0;
$r[down_num]=2;
$r[online_num]=2;
$checked=" checked";
$r['addreinfo']=1;
$defaultbclassid=" selected";
$islist="";
$islast="<input name=islast type=checkbox id=islast onclick='small_class(this.checked)' value='1'>是";
//复制栏目
$docopy=$_GET['docopy'];
if($docopy&&$enews=="AddClass")
{
$copyclass=1;
}
$ecmsfirstpost=1;
//修改栏目
if($enews=="EditClass"||$copyclass)
{
$ecmsfirstpost=0;
if($copyclass)
{
$thisdo="复制";
}
else
{
$thisdo="修改";
}
$read="";
$classid=(int)$_GET['classid'];
$r=$empire->fetch1("select * from {$dbtbpre}enewsclass where classid='$classid'");
$addr=$empire->fetch1("select * from {$dbtbpre}enewsclassadd where classid='$classid'");
if(!empty($r[bclassid]))
{$defaultbclassid="";}
$url="<a href=".$listclasslink.">管理栏目</a> > ".$thisdo."栏目:".$r[classname];
if($r[islist])
{$islist=" checked";}
//修改大栏目
if(!$r[islast])
{
//主栏目
if(empty($r[bclassid]))
{
$b_ok=1;
}
//中级栏目
else
{
$b_ok=1;
}
}
//终级栏目
else
{
$hiddenclass="<script>document.getElementById('bigclasssettemp').style.display='none';document.getElementById('bigclasssetclasstext').style.display='none';</script>";
$b_ok=0;
}
//终级类别
if($r[islast])
{
$islast="<b>是</b>";
$islastcheck=" checked";
}
else
{
$islast="<b>否</b>";
$islastcheck="";
}
$islast.="<input type=hidden name=islast value='".$r[islast]."'>";
if($r[filename]==1)
{
$filename0="";
$filename1=" checked";
$filename2="";
}
elseif($r[filename]==2)
{
$filename0="";
$filename1="";
$filename2=" checked";
}
else
{}
if($r[openpl])
{
$openpl0="";
$openpl1=" checked";
}
if($r[checkpl])
{
$checkpl=" checked";
}
if($r[openadd])
{
$openadd0="";
$openadd1=" checked";
}
//栏目目录
$mycr=GetPathname($r[classpath]);
$pripath=$mycr[1];
$classpath=$mycr[0];
$read="";
//复制栏目
if($copyclass)
{
$r[classname].="(1)";
$classpath.="1";
$read="";
$islast="<input name=islast type=checkbox id=islast onclick='small_class(this.checked)' value='1'".$islastcheck.">是";
}
if($r[checked])
{$checked=" checked";}
else
{$checked="";}
}
//系统模型
$m_sql=$empire->query("select mid,mname,usemod from {$dbtbpre}enewsmod order by myorder,mid");
while($m_r=$empire->fetch($m_sql))
{
if(empty($m_r[usemod]))
{
if($m_r[mid]==$r[modid])
{$m_d=" selected";}
else
{$m_d="";}
$mod_options.="<option value=".$m_r[mid].$m_d.">".$m_r[mname]."</option>";
}
//列表模板
$listtemp_options.="<option value=0 style='background:#99C4E3'>".$m_r[mname]."</option>";
$dtlisttemp_options.="<option value=0 style='background:#99C4E3'>".$m_r[mname]."</option>";
$lt_sql=$empire->query("select tempid,tempname from ".GetTemptb("enewslisttemp")." where modid='$m_r[mid]'");
while($lt_r=$empire->fetch($lt_sql))
{
//静态
if($lt_r[tempid]==$r[listtempid])
{$lt_d=" selected";}
else
{$lt_d="";}
$listtemp_options.="<option value=".$lt_r[tempid].$lt_d."> |-".$lt_r[tempname]."</option>";
//动态
if($lt_r[tempid]==$r[dtlisttempid])
{$lt_dt=" selected";}
else
{$lt_dt="";}
$dtlisttemp_options.="<option value=".$lt_r[tempid].$lt_dt."> |-".$lt_r[tempname]."</option>";
}
//搜索模板
$searchtemp.="<option value=0 style='background:#99C4E3'>".$m_r[mname]."</option>";
$st_sql=$empire->query("select tempid,tempname from ".GetTemptb("enewssearchtemp")." where modid='$m_r[mid]'");
while($st_r=$empire->fetch($st_sql))
{
if($st_r[tempid]==$r[searchtempid])
{$st_d=" selected";}
else
{$st_d="";}
$searchtemp.="<option value=".$st_r[tempid].$st_d."> |-".$st_r[tempname]."</option>";
}
//内容模板
$newstemp_options.="<option value=0 style='background:#99C4E3'>".$m_r[mname]."</option>";
$nt_sql=$empire->query("select tempid,tempname from ".GetTemptb("enewsnewstemp")." where modid='$m_r[mid]'");
while($nt_r=$empire->fetch($nt_sql))
{
if($nt_r[tempid]==$r[newstempid])
{$nt_d=" selected";}
else
{$nt_d="";}
$newstemp_options.="<option value=".$nt_r[tempid].$nt_d."> |-".$nt_r[tempname]."</option>";
}
}
//栏目
$fcfile="../../data/fc/ListEnews.php";
$fcjsfile="../../data/fc/cmsclass.js";
if(file_exists($fcjsfile)&&file_exists($fcfile))
{
$options=GetFcfiletext($fcjsfile);
$options=str_replace("<option value='$r[bclassid]'","<option value='$r[bclassid]' selected",$options);
}
else
{
$options=ShowClass_AddClass("",$r[bclassid],0,"|-",0,0);
}
//会员组
$qgroup='';
$qgbr='';
$qgi=0;
$cgroup='';
$sql1=$empire->query("select groupid,groupname from {$dbtbpre}enewsmembergroup order by level");
while($l_r=$empire->fetch($sql1))
{
if($r[groupid]==$l_r[groupid])
{$select=" selected";}
else
{$select="";}
$group.="<option value=".$l_r[groupid].$select.">".$l_r[groupname]."</option>";
//投稿
$qgi++;
if($qgi%6==0)
{
$qgbr='<br>';
}
else
{
$qgbr='';
}
$qgchecked='';
if(strstr($r[qaddgroupid],','.$l_r[groupid].','))
{
$qgchecked=' checked';
}
$qgroup.="<input type=checkbox name=qaddgroupidck[] value='".$l_r[groupid]."'".$qgchecked.">".$l_r[groupname]." ".$qgbr;
//栏目页权限
$cgchecked='';
if(strstr($r[cg
没有合适的资源?快使用搜索试试~ 我知道了~
帝国ECMS7.5 批量添加栏目插件
共3个文件
php:3个
1星 需积分: 9 26 下载量 156 浏览量
2018-12-23
16:26:57
上传
评论
收藏 14KB ZIP 举报
温馨提示
批量添加栏目,适合栏目众多的站点建站 安装方法: 上传到e/extend/ 登录后台,访问e/extend/addtree/install.php?ehash_xhKYY=IOZqFoy10bVfofMj7sgz 回到后台插件管理即可使用
资源推荐
资源详情
资源评论
收起资源包目录
帝国cms7.5批量添加栏目插件.zip (3个子文件)
addtree
add.php 46KB
install.php 1KB
fun.php 11KB
共 3 条
- 1
资源评论
- 周纪2019-05-31用不了,建议不要浪费积分!
清风古韵
- 粉丝: 98
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功