📄 ad_advertisement.asp
字号:
<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
Const PurviewLevel=2
Const CheckChannelID=0
Const PurviewLevel_Others="AD"
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="ad_ChkPurview.asp"-->
<!--#include file="inc/ubbcode.asp"-->
<!--#include file="inc/func.asp"-->
<%
dim sql,rs,strFileName
dim Action,Channel,FoundErr,ErrMsg
Action=Trim(Request("Action"))
Channel=Trim(Request("Channel"))
if Channel="" then
Channel=0
else
Channel=CLng(Channel)
end if
strFileName="ad_Advertisement.asp?Channel="&Channel
%>
<html>
<head>
<title>广告管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="ad_Style.css">
<SCRIPT language=javascript>
function unselectall(thisform)
{
if(thisform.chkAll.checked)
{
thisform.chkAll.checked = thisform.chkAll.checked&0;
}
}
function CheckAll(thisform)
{
for (var i=0;i<thisform.elements.length;i++)
{
var e = thisform.elements[i];
if (e.Name != "chkAll"&&e.disabled!=true)
e.checked = thisform.chkAll.checked;
}
}
function ConfirmDel(thisform)
{
if(thisform.Action.value=="Del")
{
if(confirm("确定要删除选中的广告吗?"))
return true;
else
return false;
}
}
function showsetting(thisform)
{
for (var j=0;j<6;j++)
{
var tab = eval("document.all.settable"+j);
if(thisform.ADType.selectedIndex==j)
tab.style.display = "";
else
tab.style.display = "none";
}
if(thisform.ADType.selectedIndex==6)
{
nocodead.style.display = "none";
iscodead.style.display = "";
}
else
{
nocodead.style.display = "";
iscodead.style.display = "none";
}
}
function check(thisform)
{
if(thisform.ADType.selectedIndex==6)
{
if(thisform.ADCode.value=="")
{
alert("广告代码不能为空!")
thisform.ADCode.focus()
return false;
}
if(thisform.ADCode.value.length>250)
{
alert("广告代码长度不能超过250字符!")
thisform.ADCode.focus()
return false;
}
}
else
{
if(thisform.SiteName.value=="")
{
alert("网站名称不能为空!");
thisform.SiteName.focus();
return false;
}
if(thisform.ImgUrl.value=="")
{
alert("图片地址不能为空!");
thisform.ImgUrl.focus();
return false;
}
if(thisform.ADType.selectedIndex==0)
{
if(thisform.ImgWidth.value=="")
{
alert("弹出广告的图片宽度不能留空!");
thisform.ImgWidth.focus();
return false;
}
if(thisform.ImgHeight.value=="")
{
alert("弹出广告的图片高度不能留空!");
thisform.ImgHeight.focus();
return false;
}
}
}
}
</script>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" Class="border">
<tr class="topbg">
<td height="22" colspan=2 align=center><strong>广 告 管 理</strong></td>
</tr>
<tr class="tdbg">
<td width="70" height="30"><strong>管理导航:</strong></td>
<td height="30"><a href="ad_Advertisement.asp?Action=Add">添加新广告</a> | <a href="ad_Advertisement.asp">所有频道广告</a> | <a href="ad_Advertisement.asp?Channel=1">网站首页广告</a> | <a href="ad_Advertisement.asp?Channel=2">文章频道广告</a> | <a href="ad_Advertisement.asp?Channel=3">软件频道广告</a> | <a href="ad_Advertisement.asp?Channel=4">图片频道广告</a> | <a href="ad_Advertisement.asp?Channel=5">留言频道广告</a> | </td>
</tr>
</table>
<%
if Action="Add" then
call Add()
elseif Action="SaveAdd" then
call SaveAdd()
elseif Action="Modify" then
call Modify()
elseif Action="SaveModify" then
call SaveModify()
elseif Action="SetNew" then
call SetNew()
elseif Action="CancelNew" then
call CancelNew()
elseif Action="Move" then
call MoveAdvertisement()
elseif Action="Del" then
call DelAD()
else
call main()
end if
if FoundErr=True then
call WriteErrMsg()
end if
call CloseConn()
sub main()
sql="select * from Advertisement"
sql=sql & " where ChannelID=" & Channel
sql=sql & " order by IsSelected,id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<form name="form1" method="POST" action=<%=strFileName%> >
<%
response.write "您现在的位置:网站广告管理 >> <font color=red>"
select case Channel
case 0
response.write "所有频道广告"
case 1
response.write "网站首页广告"
case 2
response.write "文章频道广告"
case 3
response.write "软件频道广告"
case 4
response.write "图片频道广告"
case 5
response.write "留言频道广告"
case else
response.write "错误的参数"
end select
response.write "</font><br>"
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" Class="border">
<tr class="title">
<td width="30" height="22" align="center"><strong>选择</strong></td>
<td width="30" height="22" align="center"><strong>ID</strong></td>
<td width="20" align="center"><strong>新</strong></td>
<td width="80" align="center"><strong>广告类型</strong></td>
<td width="100" height="22" align="center"><strong>网站名称</strong></td>
<td height="22" align="center"><strong>广告图片</strong></td>
<td width="80" height="22" align="center"><strong>操作</strong></td>
</tr>
<%
if not(rs.bof and rs.eof) then
do while not rs.eof
%>
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td width="30" align="center">
<input type="checkbox" value=<%=rs("ID")%> name="ID" onclick="unselectall(this.form)">
</td>
<td width="30" align="center"><%=rs("ID")%></td>
<td width="20" align="center">
<%if rs("IsSelected")=true then response.write "<font color=#009900>新</font>" end if%>
</td>
<td width="80" align="center">
<%
if rs("ADType")=0 then
response.write "弹出广告"
elseif rs("ADType")=1 then
response.write "Banner广告"
elseif rs("ADType")=2 then
response.write "栏目广告"
elseif rs("ADType")=3 then
response.write "文章内容页广告"
elseif rs("ADType")=4 then
response.write "浮动广告"
elseif rs("ADType")=5 then
response.write "页面固定广告"
elseif rs("ADType")=6 then
response.write "代码广告"
else
response.write "其它广告"
end if
%>
</td>
<td width="100"><a href="<%=rs("SiteUrl")%>" target='blank' title="网站地址:<%=rs("SiteUrl") & vbcrlf %>网站简介:<%=vbcrlf & rs("SiteIntro")%>"><%=rs("SiteName")%></a></td>
<td align="center">
<%
if rs("ADType")=6 then
Response.Write rs("ImgUrl")
else
if lcase(right(rs("ImgUrl"),4))=".swf" then
Response.Write "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'"
if rs("ImgWidth")>0 then
response.write " width='" & rs("ImgWidth") & "'"
if rs("ImgHeight")>0 then response.write " height='" & rs("ImgHeight") & "'"
end if
response.write "><param name='movie' value='" & rs("ImgUrl") & "'><param name='quality' value='high'><embed src='" & rs("ImgUrl") & "' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'"
if rs("ImgWidth")>0 then
response.write " width='" & rs("ImgWidth") & "'"
if rs("ImgHeight")>0 then response.write " height='" & rs("ImgHeight") & "'"
end if
response.write "></embed></object>"
else
response.write "<a href='" & rs("SiteUrl") & "' target='_blank' title='图片地址:" & rs("ImgUrl") & vbcrlf & "图片宽度:" & rs("ImgWidth") & "像素" & vbcrlf & "图片高度:" & rs("ImgHeight") & "像素'><img src='" & rs("ImgUrl") & "'"
if rs("ImgWidth")>0 then
response.write " width='" & rs("ImgWidth") & "'"
if rs("ImgHeight")>0 then response.write " height='" & rs("ImgHeight") & "'"
end if
response.write " border='0'></a>"
end if
end if
%>
</td>
<td width="80" align="center">
<%
response.write "<a href='" & strFileName & "&Action=Modify&ID=" & rs("ID") & "'>修改</a> "
response.write "<a href='" & strFileName & "&Action=Del&ID=" & rs("ID") & "' onclick=""return confirm('确定要删除此广告吗?');"">删除</a>"
%>
</td>
</tr>
<%
rs.movenext
loop
%>
<tr class="tdbg">
<td colspan=7 height="30">
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
选中所有广告
<input name="Action" type="hidden" id="Action" value="Del">
将选定的广告:
<input type="submit" value=" 删除 " name="submit" onClick="this.form.Action.value='Del';return ConfirmDel(this.form);"">
<input type="submit" value="设为最新广告" name="submit" onClick="this.form.Action.value='SetNew'">
<input type="submit" value="取消最新广告" name="submit" onClick="this.form.Action.value='CancelNew'">
<input type="submit" value="移动至" name="submit" onClick="this.form.Action.value='Move'">
<select name='ChannelID'>
<option value='0'>全部</option>
<option value='1'>首页</option>
<option value='2'>文章</option>
<option value='3'>软件</option>
<option value='4'>图片</option>
<option value='5'>留言</option>
</select>
</td>
</tr>
<% end if%>
</table>
</form>
<%
rs.close
set rs=nothing
end sub
sub Add()
%>
<form name="myform" method="post" action="<%=strFileName%>" onSubmit="return check(myform)">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr class="title">
<td height="22" colspan="2" align="center"><strong>添 加 广 告</strong></td>
</tr>
<tr class="tdbg">
<td width="250"><strong>所属频道:</strong></td>
<td width="550">
<input type='radio' name='ChannelID' value='0' checked>
全部
<input type='radio' name='ChannelID' value='1'>
首页
<input type='radio' name='ChannelID' value='2'>
文章
<input type='radio' name='ChannelID' value='3'>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -