📄 addcontest.php
字号:
<?/* [BBWPS!] (C)2006-2010 小蜜蜂版权所有. This is NOT a freeware, use is subject to license terms 功能:增加广告*//***************************功能:增加广告****************************/error_reporting(0);if(!function_exists("CheckRequire")){ exit("Forbidden");}if(file_exists("../data/module.php")){ include_once("../data/module.php");}$action = $_GET['action'];if($action == "add"){ $isMagic = @ini_get("magic_quotes_gpc"); if(!$isMagic){ if (is_array($_POST['advnew'])){ foreach($_POST['advnew'] AS $key => $value) { $value = str_replace('\"','||queto||',$value); $value = str_replace('"','\"',$value); $value = str_replace('||queto||','\"',$value); $_POST['advnew'][$key]=$value; } } } $db= new DB($hostname,$username,$password,$database); $sql = "select adtag from ".$prefix."adcontest"; $sqlRes = $db->query($sql); $style = $_POST['advnew']['style']; $adtag = $_POST['advnew']['adtag']; while ($sqlObj=$db->fetch_object($sqlRes)){ if($sqlObj->adtag==$adtag){ $db->__DB(); unset($db,$sql,$sqlRes,$sqlObj,$style,$title,$adtag); print("<script> alert('重复的广告标签');window.history.go(-1);</script>"); exit(); } } unset($sql,$sqlRes,$sqlObj); foreach ($_POST['advnew']['targets'] as $values){ if($values!=""){ $targets.=$values."|"; } } if($adtag==""||$targets==""){ print("<script> alert('内容不全');window.history.go(-1);</script>"); exit(); } $insertSql = "insert into ".$prefix."adcontest set type='".$style."', title='".$title."', adtag='".$adtag."', targets='".$targets."'"; $db->insert($insertSql); $db->__DB(); unset($insertSql,$db,$code,$prefix,$style,$title,$adtag,$targets,$starttime,$endtime); print("<script> alert('添加成功'); document.location.href='?mod=ad&f=conmanage';</script>"); exit;}else { $p=new Template("./template/ad"); foreach ($moduleArray as $value){ $optionString.="<option value=\"".$value['id']."\"> > ".$value['name']."</option><option value=\"\"> </option>"; } $nowTime = date("Y-m-d"); $p->set_file("ad","addcontest.html"); $p->set_var("nowtime",$nowTime); $p->set_var("option",$optionString); $p->parse("out","ad"); $p->p("out"); unset($p);}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -