query("insert into {$dbtbpre}enewsspacestyle(stylename,stylepic,stylesay,stylepath,isdefault,membergroup) values('$add[stylename]','$add[stylepic]','$add[stylesay]','$add[stylepath]',0,'$mg');"); if($sql) { $styleid=$empire->lastid(); insert_dolog("styleid=$styleid&stylename=$add[stylename]");//操作日志 printerror("AddSpaceStyleSuccess","AddSpaceStyle.php?enews=AddSpaceStyle".hReturnEcmsHashStrHref2(0)); } else { printerror("DbError","history.go(-1)"); } } //修改会员空间模板 function EditSpaceStyle($add,$userid,$username){ global $empire,$dbtbpre; $styleid=intval($add[styleid]); if(empty($add[stylename])||empty($add[stylepath])||!$styleid) { printerror('EmptySpaceStyle','history.go(-1)'); } $add[stylepath]=RepPathStr($add[stylepath]); $add['stylepath']=RepPostStr($add['stylepath'],1); //目录是否存在 if(!file_exists("../../space/template/".$add[stylepath])) { printerror("EmptySpaceStylePath","history.go(-1)"); } $add['stylename']=hRepPostStr($add['stylename'],1); $add['stylepic']=hRepPostStr($add['stylepic'],1); $add['stylesay']=hRepPostStr2($add['stylesay']); $add['stylepath']=hRepPostStr2($add['stylepath']); $mg=ReturnSpaceStyleMemberGroup($add['membergroup']); $sql=$empire->query("update {$dbtbpre}enewsspacestyle set stylename='$add[stylename]',stylepic='$add[stylepic]',stylesay='$add[stylesay]',stylepath='$add[stylepath]',membergroup='$mg' where styleid='$styleid'"); if($sql) { insert_dolog("styleid=$styleid&stylename=$add[stylename]");//操作日志 printerror("EditSpaceStyleSuccess","ListSpaceStyle.php".hReturnEcmsHashStrHref2(1)); } else { printerror("DbError","history.go(-1)"); } } //删除会员空间模板 function DelSpaceStyle($add,$userid,$username){ global $empire,$dbtbpre; $styleid=intval($add[styleid]); if(!$styleid) { printerror('EmptySpaceStyleid','history.go(-1)'); } $r=$empire->fetch1("select stylename,isdefault from {$dbtbpre}enewsspacestyle where styleid='$styleid'"); if($r[isdefault]) { printerror('NotDelDefSpaceStyle','history.go(-1)'); } $sql=$empire->query("delete from {$dbtbpre}enewsspacestyle where styleid='$styleid'"); if($sql) { insert_dolog("styleid=$styleid&stylename=$r[stylename]");//操作日志 printerror("DelSpaceStyleSuccess","ListSpaceStyle.php".hReturnEcmsHashStrHref2(1)); } else { printerror("DbError","history.go(-1)"); } } //默认会员空间模板 function DefSpaceStyle($add,$userid,$username){ global $empire,$dbtbpre; $styleid=intval($add[styleid]); if(!$styleid) { printerror('EmptyDefSpaceStyleid','history.go(-1)'); } $r=$empire->fetch1("select stylename from {$dbtbpre}enewsspacestyle where styleid='$styleid'"); $usql=$empire->query("update {$dbtbpre}enewsspacestyle set isdefault=0"); $sql=$empire->query("update {$dbtbpre}enewsspacestyle set isdefault=1 where styleid='$styleid'"); $upsql=$empire->query("update {$dbtbpre}enewspublic set defspacestyleid='$styleid'"); if($sql) { GetConfig(); insert_dolog("styleid=$styleid&stylename=$r[stylename]");//操作日志 printerror("DefSpaceStyleSuccess","ListSpaceStyle.php".hReturnEcmsHashStrHref2(1)); } else { printerror("DbError","history.go(-1)"); } } $enews=$_POST['enews']; if(empty($enews)) {$enews=$_GET['enews'];} if($enews) { hCheckEcmsRHash(); } if($enews=="AddSpaceStyle") { AddSpaceStyle($_POST,$logininid,$loginin); } elseif($enews=="EditSpaceStyle") { EditSpaceStyle($_POST,$logininid,$loginin); } elseif($enews=="DelSpaceStyle") { DelSpaceStyle($_GET,$logininid,$loginin); } elseif($enews=="DefSpaceStyle") { DefSpaceStyle($_GET,$logininid,$loginin); } $search=$ecms_hashur['ehref']; $page=(int)$_GET['page']; $page=RepPIntvar($page); $start=0; $line=16;//每页显示条数 $page_line=25;//每页显示链接数 $offset=$page*$line;//总偏移量 $query="select * from {$dbtbpre}enewsspacestyle"; $totalquery="select count(*) as total from {$dbtbpre}enewsspacestyle"; $num=$empire->gettotal($totalquery);//取得总条数 $query=$query." order by styleid desc limit $offset,$line"; $sql=$empire->query($query); $returnpage=page2($num,$line,$page_line,$start,$page,$search); ?> 会员空间模板
位置:管理会员空间模板

fetch($sql)) { $color="#ffffff"; $movejs=' onmouseout="this.style.backgroundColor=\'#ffffff\'" onmouseover="this.style.backgroundColor=\'#C3EFFF\'"'; if($r[isdefault]) { $color="#DBEAF5"; $movejs=''; } ?> >
ID
模板名称
操作
[设为默认] [修改] [删除]