⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ad.php

📁 在传统CMS文章内容管理功能基础上
💻 PHP
字号:
<?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");}$action = $_GET['action'];if($action == "add"){	$basePath="http://{$host}{$installPath}/api/showad.php?url=";	$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."advertisements";	$sqlRes = $db->query($sql,true);	$style = $_POST['advnew']['style'];//AD类型	$title = $_POST['advnew']['title'];//AD标题	$adtag = $_POST['advnew']['adtag'];//AD标签	while ($sqlObj=$db->fetch_object($sqlRes)){		if($sqlObj->adtag==$adtag){			$db->__DB();			unset($db,$sql,$sqlRes,$sqlObj,$style,$title,$adtag);			MsgError($langAdminArray["ad_reapt"]);		}	}	unset($sql,$sqlRes,$sqlObj);	foreach ($_POST['advnew']['targets'] as $values){		if($values!=""){			$targets.=$values."|";		}	}	$targets = substr($targets,0,-1);	if($title==""||$adtag==""||$targets==""){		MsgError($langAdminArray["ad_input"]);	}	$starttime = $_POST['advnew']['starttime'];	$starttime = strtotime($starttime);	$endtime = $_POST['advnew']['endtime'];	$endtime = strtotime($endtime);	//代码	if($style=="code"){		$code = $_POST['advnew']['code']['html'];		$code = str_replace("\'","||queto||",$code);		$code = str_replace("'","\'",$code);		$code = str_replace("||queto||","\'",$code);		if($code==""){			MsgError($langAdminArray["ad_input"]);		}	}//文字链接	elseif ($style=="text"){		if($_POST['advnew']['text']['link']==""||$_POST['advnew']['text']['title']==""){			MsgError($langAdminArray["ad_input"]);		}		$code ="<a href=\"{$basePath}".urlencode($_POST['advnew']['text']['link'])."&adtag={$adtag}\" target=\"_blank\" style=\"font-size: ".$_POST['advnew']['text']['size']."\">".$_POST['advnew']['text']['title']."</a>";	}//图片链接	elseif ($style=="image"){		if($_POST['advnew']['image']['link']==""||$_POST['advnew']['image']['url']==""){			MsgError($langAdminArray["ad_input"]);		}		$code = "<a href=\"{$basePath}".urlencode($_POST['advnew']['image']['link'])."&adtag={$adtag}\" target=\"_blank\"><img src=\"".$_POST['advnew']['image']['url']."\" width=\"".$_POST['advnew']['image']['width']."\"  height=\"".$_POST['advnew']['image']['height']."\" alt=\"".$_POST['advnew']['image']['alt']."\" border=\"0\"></a>";	}//flash广告	else{		if($_POST['advnew']['flash']['width']==""||$_POST['advnew']['flash']['url']==""||$_POST['advnew']['flash']['url']==""||$_POST['advnew']['flash']['link']==""){			MsgError($langAdminArray["ad_input"]);		}		$code = "<a href=\"{$basePath}".urlencode($_POST['advnew']['flash']['link'])."&adtag={$adtag}\"><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"".$_POST['advnew']['flash']['width']."\" height=\"".$_POST['advnew']['flash']['height']."\"><param name=\"movie\" value=\"".$_POST['advnew']['flash']['url']."\" /><param name=\"quality\" value=\"high\" /><embed src=\"".$_POST['advnew']['flash']['url']."\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"".$_POST['advnew']['flash']['width']."\" height=\"".$_POST['advnew']['flash']['height']."\"></embed></object></a>";	}	$insertSql = "insert into ".$prefix."advertisements set type='".$style."', title='".$title."', adtag='".$adtag."', targets='".$targets."', code='".$code."', starttime='".$starttime."', endtime='".$endtime."'";	$db->insert($insertSql);	$db->__DB();	unset($insertSql,$db,$code,$prefix,$style,$title,$adtag,$targets,$starttime,$endtime);	ExeSuccess($langAdminArray["ad_succs"],"?mod=ad&f=conmanage");}else {	$p=new Template("./template/ad");	foreach ($moduleArray as $value){		$optionString.="<option value=\"".$value['id']."\">&nbsp;&nbsp;> ".$value['name']."</option><option value=\"\">&nbsp;</option>";	}	$nowTime = date("Y-m-d");	$p->set_file("ad","ad.html");	$p->set_var("option",$optionString);	$p->set_var("nowtime",$nowTime);	$p->parse("out","ad");	$p->p("out");	unset($p);}?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -