fetch1("select classid,modid,listdt,haddlist,sametitle,addreinfo,wburl,repreinfo from {$dbtbpre}enewsclass where classid='$add[classid]' and islast=1"); /* if(!$ccr['classid']||$ccr[wburl]) { printerror("ErrorUrl","history.go(-1)"); } if($ccr['sametitle'])//验证标题重复 { $num=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_".$class_r[$add[classid]][tbname]." where title='$add[title]' limit 1"); if($num) { //printerror("ReInfoTitle","history.go(-1)"); exit("[err]标题重复,增加不成功[/err]"); } } */ $add=DoPostInfoVar($add);//返回变量 $ret_r=ReturnAddF($add,$class_r[$add[classid]][modid],$userid,$username,0,0,1);//返回自定义字段 $newspath=FormatPath($add[classid],'',0);//查看目录是否存在,不存在则建立 //签发 $isqf=0; if($add[checkuser]) { $checkuser=",".$add[checkuser].","; $isqf=1; } $add[checked]=1; $truetime=time(); $lastdotime=$truetime; //返回关键字组合 $keyid=GetKeyid($add[keyboard],$add[classid],0,$class_r[$add[classid]][link_num]); //主表 $sql=$empire->query("insert into {$dbtbpre}ecms_".$class_r[$add[classid]][tbname]."(classid,onclick,newspath,keyboard,keyid,userid,username,ztid,checked,istop,truetime,ismember,dokey,isgood,titlefont,titleurl,filename,groupid,newstempid,plnum,firsttitle,isqf,userfen,totaldown,closepl,havehtml,lastdotime,haveaddfen,infopfen,infopfennum,votenum,stb,ttid".$ret_r[fields].") values($add[classid],0,'$newspath','".addslashes($add[keyboard])."','$keyid',$userid,'".addslashes($username)."','$add[my_ztid]',$add[checked],$add[istop],$truetime,0,$add[dokey],$add[isgood],'".addslashes($add[my_titlefont])."','".addslashes($add[titleurl])."','$filename',$add[groupid],$add[newstempid],0,$add[firsttitle],'$isqf',$add[userfen],0,$add[closepl],0,$lastdotime,0,0,0,0,'".$ret_r[tb]."','$add[ttid]'".$ret_r[values].");"); $id=$empire->lastid(); //副表 $fsql=$empire->query("insert into {$dbtbpre}ecms_".$class_r[$add[classid]][tbname]."_data_".$ret_r['tb']."(id,classid".$ret_r[datafields].") values('$id','$add[classid]'".$ret_r[datavalues].");"); //签发 if($isqf==1) { $iqfsql=$empire->query("insert into {$dbtbpre}enewsqf(id,classid,checkuser,docheckuser,viewcheckuser,returncheck,notdocheckuser,checked) values('$id','$add[classid]','".addslashes($checkuser)."',',',',',0,',',0);"); } //更新附件表 UpdateTheFile($id,$add['filepass']); //取第一张图作为标题图片 if($add['getfirsttitlepic']&&empty($add['titlepic'])) { $firsttitlepic=GetFpicToTpic($add['classid'],$id,$add['getfirsttitlepic'],$add['getfirsttitlespic'],$add['getfirsttitlespicw'],$add['getfirsttitlespich']); if($firsttitlepic) { $addtitlepic=",titlepic='".addslashes($firsttitlepic)."'"; } } //文件命名 if($add['filename']) { $filename=$add['filename']; } else { $filename=ReturnInfoFilename($add[classid],$id,''); } $usql=$empire->query("update {$dbtbpre}ecms_".$class_r[$add[classid]][tbname]." set filename='$filename'".$addtitlepic." where id='$id'"); //投票 AddInfoVote($add['classid'],$id,$add); //增加信息是否生成文件 if($ccr['addreinfo']) { $ar=$empire->fetch1("select * from {$dbtbpre}ecms_".$class_r[$add[classid]][tbname]." where id='$id'"); GetHtml($ar,''); } //生成上一篇 if($ccr['repreinfo']&&$add[checked]) { $prer=$empire->fetch1("select * from {$dbtbpre}ecms_".$class_r[$add[classid]][tbname]." where id<$id and classid='$add[classid]' and checked=1 order by id desc limit 1"); GetHtml($prer,''); } //生成栏目 if($ccr[haddlist]&&$add[checked]) { hAddListHtml($add[classid],$ccr['modid'],$ccr['haddlist'],$ccr['listdt']);//生成信息列表 for($z=0;$zquery("update {$dbtbpre}ecms_".$class_r[$add[classid]][tbname]." set copyids='$copyids' where id='$id'"); } } if($sql) { $GLOBALS['ecmsadderrorurl']="ListNews.php?bclassid=$add[bclassid]&classid=$add[classid]"; insert_dolog("classid=$add[classid]
id=".$id."
title=".$add[title]);//操作日志 //printerror("AddNewsSuccess","AddNews.php?enews=AddNews&bclassid=$add[bclassid]&classid=$add[classid]"); echo("[ok]"); } else { //printerror("DbError",""); echo("[err]数据库出错,发布失败[/err]"); } } //登陆 function login($username,$password,$key,$post) function chklogin($username,$password){ global $empire,$public_r,$dbtbpre,$do_loginauth,$logininid,$loginin,$loginrnd,$loginlevel; //eCheckAccessIp(1);//禁止IP $username=RepPostVar($username); $password=RepPostVar($password); if(!$username||!$password) { //printerror("EmptyKey","index.php"); exit("[err]username or password is empty[/err]"); } /* //验证码 $keyvname='checkkey'; if(!$public_r['adminloginkey']) { ecmsCheckShowKey($keyvname,$key,0,1); } */ if(strlen($username)>30||strlen($password)>30) { //printerror("EmptyKey","index.php"); exit("[err]username or password is too long[/err]"); } $loginip=egetip(); $logintime=time(); //CheckLoginNum($loginip,$logintime); /* //认证码 if($do_loginauth&&$do_loginauth!=$post['loginauth']) { InsertErrorLoginNum($username,$password,1,$loginip,$logintime); printerror("ErrorLoginAuth","index.php"); }*/ $user_r=$empire->fetch1("select userid,password,salt from {$dbtbpre}enewsuser where username='".$username."' and checked=0 limit 1"); if(!$user_r['userid']) { InsertErrorLoginNum($username,$password,0,$loginip,$logintime); //printerror("LoginFail","index.php"); exit("[err]username is error[/err]"); } $ch_password=md5(md5($password).$user_r['salt']); if($user_r['password']!=$ch_password) { InsertErrorLoginNum($username,$password,0,$loginip,$logintime); //printerror("LoginFail","index.php"); exit("[err]password is error[/err]"); } $logininid=$user_r['userid']; $loginin=$username; $loginrnd=$user_r['rnd']; $loginlevel=$user_r['groupid']; /* //取得随机密码 $rnd=make_password(20); $sql=$empire->query("update {$dbtbpre}enewsuser set rnd='$rnd',loginnum=loginnum+1,lastip='$loginip',lasttime='$logintime' where username='$username' limit 1"); $r=$empire->fetch1("select groupid,userid,styleid from {$dbtbpre}enewsuser where username='$username' limit 1"); //样式 if(empty($r[styleid])) { $stylepath=$public_r['defadminstyle']?$public_r['defadminstyle']:1; } else { $styler=$empire->fetch1("select path,styleid from {$dbtbpre}enewsadminstyle where styleid='$r[styleid]'"); if(empty($styler[styleid])) { $stylepath=$public_r['defadminstyle']?$public_r['defadminstyle']:1; } else { $stylepath=$styler['path']; } } //设置备份 $cdbdata=0; $bnum=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsgroup where groupid='$r[groupid]' and dodbdata=1"); if($bnum) { $cdbdata=1; $set5=esetcookie("ecmsdodbdata","empirecms",0,1); } else { $set5=esetcookie("ecmsdodbdata","",0,1); } ecmsEmptyShowKey($keyvname,1);//清空验证码 $set4=esetcookie("loginuserid",$r[userid],0,1); $set1=esetcookie("loginusername",$username,0,1); $set2=esetcookie("loginrnd",$rnd,0,1); $set3=esetcookie("loginlevel",$r[groupid],0,1); $set5=esetcookie("eloginlic","empirecmslic",0,1); $set6=esetcookie("loginadminstyleid",$stylepath,0,1); //COOKIE加密验证 DoECookieRnd($r[userid],$username,$rnd,$cdbdata,$r[groupid],intval($stylepath)); //最后登陆时间 $set4=esetcookie("logintime",$logintime,0,1); //写入日志 insert_log($username,'',1,$loginip,0); if($set1&&$set2&&$set3) { //操作日志 insert_dolog(""); if($post['adminwindow']) { ?>