1) { printerror2('请在主端下使用本操作','history.go(-1)',9); } //增加访问端 function AddMoreport($add,$userid,$username){ global $empire,$dbtbpre; if(!$add[pname]||!$add[ppath]||!$add[purl]||!$add[postpass]||!$add[tempgid]) { printerror("EmptyMoreport","history.go(-1)"); } //验证权限 CheckLevel($userid,$username,$classid,"moreport"); $add['pname']=hRepPostStr($add['pname'],1); $add['purl']=RepPostStr($add['purl'],1); $add['ppath']=RepPostStr($add['ppath'],1); $add['postpass']=RepPostStr($add['postpass'],1); $add['postfile']=RepPostStr($add['postfile'],1); $add['tempgid']=(int)$add['tempgid']; $add['mustdt']=(int)$add['mustdt']; $add['isclose']=(int)$add['isclose']; $add['closeadd']=(int)$add['closeadd']; $add['headersign']=hRepPostStr($add['headersign'],1); $add['openadmin']=(int)$add['openadmin']; $add['rehtml']=(int)$add['rehtml']; if(!file_exists($add['ppath'].'e/config/config.php')) { printerror("ErrorMoreportPath","history.go(-1)"); } $sql=$empire->query("insert into {$dbtbpre}enewsmoreport(pname,purl,ppath,postpass,postfile,tempgid,mustdt,isclose,closeadd,headersign,openadmin,rehtml) values('$add[pname]','$add[purl]','$add[ppath]','$add[postpass]','$add[postfile]','$add[tempgid]','$add[mustdt]','$add[isclose]','$add[closeadd]','$add[headersign]','$add[openadmin]','$add[rehtml]');"); $pid=$empire->lastid(); //更新缓存 Moreport_UpdateIsclose(); GetConfig(); if($sql) { //操作日志 insert_dolog("pid=$pid&pname=$add[pname]"); printerror("AddMoreportSuccess","AddMoreport.php?enews=AddMoreport".hReturnEcmsHashStrHref2(0)); } else {printerror("DbError","history.go(-1)");} } //修改访问端 function EditMoreport($add,$userid,$username){ global $empire,$dbtbpre; $add[pid]=(int)$add[pid]; if(!$add[pid]||!$add[pname]||!$add[ppath]||!$add[purl]||!$add[postpass]||!$add[tempgid]) { printerror("EmptyMoreport","history.go(-1)"); } //验证权限 CheckLevel($userid,$username,$classid,"moreport"); $add['pname']=hRepPostStr($add['pname'],1); $add['purl']=RepPostStr($add['purl'],1); $add['ppath']=RepPostStr($add['ppath'],1); $add['postpass']=RepPostStr($add['postpass'],1); $add['postfile']=RepPostStr($add['postfile'],1); $add['tempgid']=(int)$add['tempgid']; $add['mustdt']=(int)$add['mustdt']; $add['isclose']=(int)$add['isclose']; $add['closeadd']=(int)$add['closeadd']; $add['headersign']=hRepPostStr($add['headersign'],1); $add['openadmin']=(int)$add['openadmin']; $add['rehtml']=(int)$add['rehtml']; if(!file_exists($add['ppath'].'e/config/config.php')) { printerror("ErrorMoreportPath","history.go(-1)"); } $sql=$empire->query("update {$dbtbpre}enewsmoreport set pname='$add[pname]',purl='$add[purl]',ppath='$add[ppath]',postpass='$add[postpass]',postfile='$add[postfile]',tempgid='$add[tempgid]',mustdt='$add[mustdt]',isclose='$add[isclose]',closeadd='$add[closeadd]',headersign='$add[headersign]',openadmin='$add[openadmin]',rehtml='$add[rehtml]' where pid='$add[pid]'"); //更新缓存 Moreport_UpdateIsclose(); GetConfig(); if($sql) { //操作日志 insert_dolog("pid=$add[pid]&pname=$add[pname]"); printerror("EditMoreportSuccess","ListMoreport.php".hReturnEcmsHashStrHref2(1)); } else {printerror("DbError","history.go(-1)");} } //删除访问端 function DelMoreport($add,$userid,$username){ global $empire,$dbtbpre; $pid=(int)$add['pid']; if(!$pid) { printerror("NotChangeMoreportId","history.go(-1)"); } //验证权限 CheckLevel($userid,$username,$classid,"moreport"); $r=$empire->fetch1("select pname from {$dbtbpre}enewsmoreport where pid='$pid'"); $sql=$empire->query("delete from {$dbtbpre}enewsmoreport where pid='$pid'"); //更新缓存 Moreport_UpdateIsclose(); GetConfig(); if($sql) { //操作日志 insert_dolog("pid=$pid&pname=$r[pname]"); printerror("DelMoreportSuccess","ListMoreport.php".hReturnEcmsHashStrHref2(1)); } else {printerror("DbError","history.go(-1)");} } $enews=$_POST['enews']; if(empty($enews)) {$enews=$_GET['enews'];} if($enews) { hCheckEcmsRHash(); @set_time_limit(0); include('../../class/copypath.php'); include('moreportfun.php'); } //增加访问端 if($enews=="AddMoreport") { AddMoreport($_POST,$logininid,$loginin); } elseif($enews=="EditMoreport")//修改访问端 { EditMoreport($_POST,$logininid,$loginin); } elseif($enews=="DelMoreport")//删除访问端 { DelMoreport($_GET,$logininid,$loginin); } elseif($enews=="MoreportChangeCacheAll")//更新访问端数据库缓存 { Moreport_ChangeCacheAll($_GET,$logininid,$loginin); } elseif($enews=="MoreportUpdateClassfileAll")//更新访问端栏目缓存文件 { Moreport_UpdateClassfileAll($_GET,$logininid,$loginin); } elseif($enews=="MoreportReDtPageAll")//更新访问端动态页面 { Moreport_ReDtPageAll($_GET,$logininid,$loginin); } elseif($enews=="MoreportClearTmpfileAll")//清理访问端临时文件 { Moreport_ClearTmpfileAll($_GET,$logininid,$loginin); } elseif($enews=="MoreportReIndexfileAll")//更新访问端动态首页文件 { Moreport_ReIndexfileAll($_GET,$logininid,$loginin); } $search=$ecms_hashur['ehref']; $page=(int)$_GET['page']; $page=RepPIntvar($page); $start=0; $line=30; $page_line=25; $add=""; $offset=$line*$page; $totalquery="select count(*) as total from {$dbtbpre}enewsmoreport"; $num=$empire->gettotal($totalquery); $query="select * from {$dbtbpre}enewsmoreport"; $query.=" order by pid limit $offset,$line"; $sql=$empire->query($query); $returnpage=page2($num,$line,$page_line,$start,$page,$search); ?>
位置:管理网站访问端 |