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","history.go(-1)");
}
//验证权限
$doselfinfo=CheckLevel($logininid,$loginin,$classid,"news");
if(!$class_r[$classid][tbname]||!$class_r[$classid][classid])
{
printerror("ErrorUrl","history.go(-1)");
}
//非终极栏目
if(!$class_r[$classid]['islast'])
{
printerror("AddInfoErrorClassid","history.go(-1)");
}
$fun_r['AdminInfo']='管理信息';
$bclassid=$class_r[$classid][bclassid];
$id=(int)$_GET['id'];
//附件验证码
if($enews=="AddNews")
{
if(!$doselfinfo['doaddinfo'])//增加权限
{
printerror("NotAddInfoLevel","history.go(-1)");
}
$filepass=time();
$word='增加信息';
$ecmsfirstpost=1;
}
else
{
if(!$doselfinfo['doeditinfo'])//编辑权限
{
printerror("NotEditInfoLevel","history.go(-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");
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.="
}
$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)
{
printerror("ErrorUrl","history.go(-1)");
}
//返回表
$infotb=ReturnInfoMainTbname($class_r[$classid][tbname],$index_r['checked']);
//主表
$r=$empire->fetch1("select * from ".$infotb." where id='$id' limit 1");
//签发表
if($r[isqf])
{
$wfinfor=$empire->fetch1("select tstatus,checktno from {$dbtbpre}enewswfinfo where id='$id' and classid='$classid' limit 1");
}
//只能编辑自己的信息
if($doselfinfo['doselfinfo']&&($r[userid]<>$logininid||$r[ismember]))
{
printerror("NotDoSelfinfo","history.go(-1)");
}
//已审核信息不可修改
if($doselfinfo['docheckedit']&&$index_r['checked'])
{
printerror("NotEditCheckInfoLevel","history.go(-1)");
}
//返回表信息
$infodatatb=ReturnInfoDataTbname($class_r[$classid][tbname],$index_r['checked'],$r['stb']);
//副表
$finfor=$empire->fetch1("select ".ReturnSqlFtextF($modid)." from ".$infodatatb." where id='$id' limit 1");
$r=array_merge($r,$finfor);
//时间
$r['checked']=$index_r['checked'];
$newstime=$r['newstime'];
$r['newstime']=date("Y-m-d H:i:s",$r['newstime']);
//链接地址
$titleurl=$r['titleurl'];
if(!$r['isurl'])
{
$r['titleurl']='';
}
//会员组
$group=str_replace(" value=".$r[groupid].">"," value=".$r[groupid]." selected>",$ygroup);
//内容存文本
$savetxtf=$emod_r[$modid]['savetxtf'];
$newstext_url='';
if($savetxtf)
{
$newstext_url=$r[$savetxtf];
$r[$savetxtf]=GetTxtFieldText($r[$savetxtf]);
}
//标题属性
if(strstr($r[titlefont],','))
{
$tfontr=explode(',',$r[titlefont]);
$r[titlecolor]=$tfontr[0];
$r[titlefont]=$tfontr[1];
}
if(strstr($r[titlefont],"b|"))
{
$titlefontb=" checked";
}
if(strstr($r[titlefont],"i|"))
{
$titlefonti=" checked";
}
if(strstr($r[titlefont],"s|"))
{
$titlefonts=" checked";
}
//投票
$pubid=ReturnInfoPubid($classid,$id);
$voter=$empire->fetch1("select * from {$dbtbpre}enewsinfovote where pubid='$pubid' limit 1");
if($voter['id']&&$voter[votetext])
{
$d_record=explode("\r\n",$voter[votetext]);
for($i=0;$i
{
$j=$i+1;
$d_field=explode("::::::",$d_record[$i]);
$allvote.="
}
$voteeditnum=$j;
$allvote="
";}
}
//标题分类
$cttidswhere='';
$tts='';
$caddr=$empire->fetch1("select ttids from {$dbtbpre}enewsclassadd where classid='$classid'");
if($caddr['ttids']!='-')
{
if($caddr['ttids']&&$caddr['ttids']!=',')
{
$cttidswhere=' and typeid in ('.substr($caddr['ttids'],1,-1).')';
}
$ttsql=$empire->query("select typeid,tname from {$dbtbpre}enewsinfotype where mid='$modid'".$cttidswhere." order by myorder");
while($ttr=$empire->fetch($ttsql))
{
$select='';
if($ttr[typeid]==$r[ttid])
{
$select=' selected';
}
$tts.="$ttr[tname]";
}
}
//内容模板
$t_sql=$empire->query("select tempid,tempname from ".GetTemptb("enewsnewstemp")." order by modid,tempid");
while($nt=$empire->fetch($t_sql))
{
if($nt[tempid]==$r[newstempid])
{
$select=" selected";
}
else
{
$select="";
}
$newstemp.="".$nt[tempname]."";
}
//模板
$votetemp="";
$vtsql=$empire->query("select tempid,tempname from ".GetTemptb("enewsvotetemp")." order by tempid");
while($vtr=$empire->fetch($vtsql))
{
if($voter[tempid]==$vtr[tempid])
{
$select=" selected";
}
else
{
$select="";
}
$votetemp.="".$vtr[tempname]."";
}
//同时发布
if(empty($voter['copyids'])||$voter['copyids']=='1')
{
$copyclassidshowiframe='';
$copyclassids='
同时发布到以下栏目: 采用索引链接 |
}
else
{
$copyclassidshowiframe='';
$copyclassids='
同时发布到以下栏目: |
本信息已同步发布到其他栏目,信息ID: '.$voter[copyids].' |
}
//表单文件
$modfile="../data/html/".$modid.".php";
//栏目链接
$getcurlr['classid']=$classid;
$classurl=sys_ReturnBqClassname($getcurlr,9);
//当前使用的模板组
$thegid=GetDoTempGid();
$phpmyself=urlencode(eReturnSelfPage(1));
//返回头条和推荐级别名称
$ftnr=ReturnFirsttitleNameList($r['firsttitle'],$r['isgood']);
?>
=$word?>.dynamic-tab-pane-control .tab-page {
width: 100%;
}
.dynamic-tab-pane-control .tab-page .dynamic-tab-pane-control .tab-page {
height: 150px;
}
form {
margin: 0;
padding: 0;
}
/* over ride styles from webfxlayout */
.dynamic-tab-pane-control h2 {
font-size:12px;
font-weight:normal;
text-align: center;
width: auto;
height: 20;
}
.dynamic-tab-pane-control h2 a {
display: inline;
width: auto;
}
.dynamic-tab-pane-control a:hover {
background: transparent;
}
function setLinkSrc( sStyle ) {
document.getElementById( "luna-tab-style-sheet" ).disabled = sStyle != "luna";
//document.documentElement.style.background = "";
//document.body.style.background = sStyle == "webfx" ? "white" : "ThreeDFace";
}
function chgBg(obj,color){
if (document.all || document.getElementById)
obj.style.backgroundColor=color;
else if (document.layers)
obj.bgColor=color;
}
setLinkSrc( "luna" );
function dovoteadd(){
var i;
var str="";
var oldi=0;
var j=0;
oldi=parseInt(document.add.v_editnum.value);
for(i=1;i<=document.add.v_vote_num.value;i++)
{
j=i+oldi;
str=str+"
}
document.getElementById('addvote').innerHTML="
";}
function doSpChangeFile(name,url,filesize,filetype,idvar){
document.getElementById(idvar).value=url;
if(document.add.filetype!=null)
{
if(document.add.filetype.value=='')
{
document.add.filetype.value=filetype;
}
}
if(document.add.filesize!=null)
{
if(document.add.filesize.value=='')
{
document.add.filesize.value=filesize;
}
}
}
function SpOpenChFile(type,field){
window.open('ecmseditor/FileMain.php?classid==$classid?>&infoid==$id?>=$addecmscheck?>&filepass==$filepass?>&type='+type+'&sinfo=1&tranfrom=2&field='+field,'','width=700,height=550,scrollbars=yes');
}
function bs(){
var f=document.add;
if(f.title.value.length==0){alert("标题还没写");f.title.focus();return false;}
}
function foreColor(){
if(!Error())return;
var arr = showModalDialog("../data/html/selcolor.html", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0");
if (arr != null) document.add.titlecolor.value=arr;
else document.add.titlecolor.focus();
}
function FieldChangeColor(obj){
if(!Error())return;
var arr = showModalDialog("../data/html/selcolor.html", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0");
if (arr != null) obj.value=arr;
else obj.focus();
}
$(function(){
var enews = $("#enews").val();
if(enews){
var nf = $("#nf").val();
if(document.getElementById("nf")&&document.getElementById("ml")){
checkqici(nf)
}
}
})
//期次ajax
function checkqici(id){
var enews = $("#enews").val();
if(id&&enews){
var t_qici = $("#t_qici").val();
$.post("ajax.php",{act:"checkqici",enews:enews,nfid:id,t_qici:t_qici},function(data){
if(data){
$("#qici").html(data);
checkm();
}else{
$("#qici").html("无期次请添加");
checkm();
}
//
})
}else{
$("#nf").html("无年份");
alert("年份错误");
}
}
function checkm(id){
if(!id){
id = $("#qici").val();
}
if(id){
checkml(id);
checkml2(id);
}else{
alert("本年份无期次,请添加杂志期次");
}
}
//目录一级导航ajax
function checkml(id){
var enews = $("#enews").val();
if(id&&enews){
var t_ml = $("#t_ml").val();
$.post("ajax.php",{act:"checkml",enews:enews,mlid:id,t_ml:t_ml},function(data){
if(data){
$("#ml").html(data);
}else{
$("#ml").html("本期无一级导航请添加");
}
//
})
}
}
//目录二级ajax
function checkml2(id){
var enews = $("#enews").val();
if(id&&enews){
var t_ml2 = $("#t_ml2").val();
$.post("ajax.php",{act:"checkml2",enews:enews,ml2id:id,t_ml2:t_ml2},function(data){
if(data){
$("#ml2").html(data);
}else{
$("#ml2").html("本期无二级导航请添加");
}
//
})
}
}
位置: =$url?> |
if($enews=='EditNews')
{
?>
(不填原因表示不通知会员)
}
?>
tb1 = new WebFXTabPane( document.getElementById( "TabPane1" ) );
基本信息
=$word?>
| name=enews> name=classid> name=bclassid> > |
include($modfile);
?>
选项设置
选项设置 | ||||
if(strstr($public_r['usetags'],','.$modid.',')) { $infotag_readonly=''; $infotag_copykeyboard=' '; if(strstr($public_r['chtags'],','.$modid.',')) { $infotag_readonly=' readonly'; $infotag_copykeyboard=''; } ?> | ||||
TAGS : > =$infotag_copykeyboard?> (多个用","逗号格开) |
}
?>
if($class_r[$classid]['link_num'])
{
?>
相关链接:>
按关键字查询
>
}
?>
所属专题 |
点击选择信息所属专题 |
定时发布 | ||
|
if($wfinfor[checktno]==101)
{
?>
信息送审 |
重新送审(信息被返工后,修改后可选择重新送审) |
}
?>
=$copyclassids?>
投票设置
投票设置 | |||||||||||||||||||||||||||||||
主题标题 | |||||||||||||||||||||||||||||||
投票项目 |
| ||||||||||||||||||||||||||||||
投票类型 | > 单选 > 多选 | ||||||||||||||||||||||||||||||
限制IP | > 不限制 > 限制(限制后同一IP只能投一次票) | ||||||||||||||||||||||||||||||
过期时间 | (超过此期限,将不能投票,0000-00-00为不限制) | ||||||||||||||||||||||||||||||
查看投票窗口 | 宽度: 高度: | ||||||||||||||||||||||||||||||
选择模板 | =$votetemp?> |
=$copyclassidshowiframe?>
db_close();
$empire=null;
?>