query("insert into {$dbtbpre}enewswapstyle(stylename,path) values('$add[stylename]',$path);"); if($sql) { $styleid=$empire->lastid(); //操作日志 insert_dolog("styleid=$styleid&stylename=$add[stylename]"); printerror("AddWapStyleSuccess","WapStyle.php".hReturnEcmsHashStrHref2(1)); } else { printerror("DbError","history.go(-1)"); } } //修改wap模板 function EditWapStyle($add,$userid,$username){ global $empire,$dbtbpre; $styleid=(int)$add['styleid']; $path=RepPathStr($add['path']); $path=(int)$path; if(!$styleid||empty($path)||empty($add['stylename'])) { printerror("EmptyWapStyle","history.go(-1)"); } //目录是否存在 if(!file_exists("../../wap/template/".$path)) { printerror("EmptyWapStylePath","history.go(-1)"); } $add['stylename']=hRepPostStr($add['stylename'],1); $sql=$empire->query("update {$dbtbpre}enewswapstyle set stylename='$add[stylename]',path=$path where styleid=$styleid"); if($sql) { //操作日志 insert_dolog("styleid=$styleid&stylename=$add[stylename]"); printerror("EditWapStyleSuccess","WapStyle.php".hReturnEcmsHashStrHref2(1)); } else { printerror("DbError","history.go(-1)"); } } //删除wap模板 function DelWapStyle($styleid,$userid,$username){ global $empire,$dbtbpre,$public_r; $styleid=(int)$styleid; if(!$styleid) { printerror("EmptyWapStyleid","history.go(-1)"); } $r=$empire->fetch1("select stylename,path from {$dbtbpre}enewswapstyle where styleid=$styleid"); if($styleid==$public_r['wapdefstyle']) { printerror("NotDelDefWapStyle","history.go(-1)"); } $sql=$empire->query("delete from {$dbtbpre}enewswapstyle where styleid=$styleid"); if($sql) { //操作日志 insert_dolog("styleid=$styleid&stylename=$r[stylename]"); printerror("DelWapStyleSuccess","WapStyle.php".hReturnEcmsHashStrHref2(1)); } else { printerror("DbError","history.go(-1)"); } } $enews=$_POST['enews']; if(empty($enews)) {$enews=$_GET['enews'];} if($enews) { hCheckEcmsRHash(); } //增加wap模板 if($enews=="AddWapStyle") { AddWapStyle($_POST,$logininid,$loginin); } //修改wap模板 elseif($enews=="EditWapStyle") { EditWapStyle($_POST,$logininid,$loginin); } //删除wap模板 elseif($enews=="DelWapStyle") { DelWapStyle($_GET['styleid'],$logininid,$loginin); } else {} $pr=$empire->fetch1("select wapdefstyle from {$dbtbpre}enewspublic limit 1"); $sql=$empire->query("select styleid,stylename,path from {$dbtbpre}enewswapstyle order by styleid"); ?>

位置:管理WAP模板

增加WAP模板:
模板名称: 模板目录:e/wap/template/ (请填写数字)
fetch($sql)) { $bgcolor="#FFFFFF"; $movejs=' onmouseout="this.style.backgroundColor=\'#ffffff\'" onmouseover="this.style.backgroundColor=\'#C3EFFF\'"'; if($r[styleid]==$pr['wapdefstyle']) { $bgcolor="#DBEAF5"; $movejs=''; } ?> > >
ID
模板名称
模板目录
操作
e/wap/template/