query("insert into {$dbtbpre}enewsadclass(classname) values('$add[classname]');");
$classid=$empire->lastid();
if($sql)
{
//操作日志
insert_dolog("classid=".$classid."
classname=".$add[classname]);
printerror("AddAdClassSuccess","AdClass.php".hReturnEcmsHashStrHref2(1));
}
else
{printerror("DbError","history.go(-1)");}
}
//修改广告类别
function EditAdClass($add,$userid,$username){
global $empire,$dbtbpre;
$add[classid]=(int)$add[classid];
if(!$add[classname]||!$add[classid])
{printerror("EmptyAdClassname","history.go(-1)");}
//验证权限
CheckLevel($userid,$username,$classid,"ad");
$sql=$empire->query("update {$dbtbpre}enewsadclass set classname='$add[classname]' where classid='$add[classid]'");
if($sql)
{
//操作日志
insert_dolog("classid=".$add[classid]."
classname=".$add[classname]);
printerror("EditAdClassSuccess","AdClass.php".hReturnEcmsHashStrHref2(1));
}
else
{printerror("DbError","history.go(-1)");}
}
//删除广告类别
function DelAdClass($classid,$userid,$username){
global $empire,$public_r,$dbtbpre;
$classid=(int)$classid;
if(!$classid)
{printerror("NotChangeAdClassid","history.go(-1)");}
//验证权限
CheckLevel($userid,$username,$classid,"ad");
$c=$empire->fetch1("select classname from {$dbtbpre}enewsadclass where classid='$classid'");
$sql=$empire->query("delete from {$dbtbpre}enewsadclass where classid='$classid'");
/*
//删除广告内容
$a=$empire->query("select adid from {$dbtbpre}enewsad where classid='$classid'");
while($r=$empire->fetch($a))
{
$file="../../../d/js/acmsd/".$public_r[adfile].$r[adid].".js";
DelFiletext($file);
}
*/
if($sql)
{
//操作日志
insert_dolog("classid=".$classid."
classname=".$c[classname]);
printerror("DelAdClassSuccess","AdClass.php".hReturnEcmsHashStrHref2(1));
}
else
{
printerror("DbError","history.go(-1)");
}
}
$enews=$_POST['enews'];
if(empty($enews))
{$enews=$_GET['enews'];}
if($enews)
{
hCheckEcmsRHash();
}
//增加广告类别
if($enews=="AddAdClass")
{
$add=$_POST['add'];
AddAdClass($add,$logininid,$loginin);
}
//修改广告类别
elseif($enews=="EditAdClass")
{
$add=$_POST['add'];
EditAdClass($add,$logininid,$loginin);
}
//删除广告类型
elseif($enews=="DelAdClass")
{
$classid=$_GET['classid'];
DelAdClass($classid,$logininid,$loginin);
}
$sql=$empire->query("select classid,classname from {$dbtbpre}enewsadclass order by classid desc");
?>
位置:管理广告 > 管理广告类别 |
ID |
类别名称 |
操作 |