📄 admin_ads.asp
字号:
<!--#include file="Inc/Const.asp"-->
<%
if Not Cl.TrueOtherPurview("Ads") then
Cl.ShowErr("<br /><li>您无此操作权限!</li>")
end if
dim Action
Action=Trim(Request("Action"))
FileName="Admin_Ads.asp"
Header
%>
<script language="JavaScript" type="text/javascript">
function unselectall(thisform)
{
if(thisform.chkAll.checked)
{
thisform.chkAll.checked = thisform.chkAll.checked;
}
}
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 SetAdtype(stype)
{
if(stype==1){
document.getElementById('adtype_1').style.display = '';
document.getElementById('adtype_0').style.display = 'none';
}
else{
document.getElementById('adtype_0').style.display = '';
document.getElementById('adtype_1').style.display = 'none';
}
}
function SetAct()
{
if(document.getElementById('AdAct').selectedIndex!='0')
{
document.getElementById('Adsetting_h').style.display = '';
}
else
{
document.getElementById('Adsetting_h').style.display = 'none';
}
}
function check(thisform)
{
if(document.getElementById('ADType').checked==false){
if(thisform.ADCode.value=="")
{
alert("广告代码不能为空!")
thisform.ADCode.focus()
return false;
}
}
}
</script>
<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="70" height="30"><strong>管理导航:</strong></td>
<td height="30"> <a href="Admin_Ads.asp">广告管理首页</a> | <a href="Admin_Ads.asp?Action=Add">添加新广告</a></td>
</tr>
</table>
<br />
<%
Select Case Action
Case "Add"
call Add()
Case "SaveAdd"
call SaveAd()
Case "ModIfy"
call ModIfy()
Case "SaveModIfy"
call SaveAd()
Case "Del"
call DelAD()
Case "RefreshAdJs"
Call RefreshAdJs()
Case Else
call main()
end Select
%>
<br />
<table width="100%" border="0" align="center" cellspacing="1" cellpadding="2" class="border">
<tr class="title">
<td height="22" colspan="2"><strong>广告类型说明</strong></td>
</tr>
<tr class="tdbg">
<td>图片广告:</td>
<td>指图片格式+链接URL的广告</td>
</tr>
<tr class="tdbg">
<td></td>
<td>设置㈠,弹出:指采用弹出窗口形式的广告。</td>
</tr>
<tr class="tdbg">
<td></td>
<td>设置㈡,浮动:指漂浮在页面上不断移动的广告。</td>
</tr>
<tr class="tdbg">
<td></td>
<td>设置㈢,固定:指固定显示在页面某一位置的广告。</td>
</tr>
<tr class="tdbg">
<td>代码广告:</td>
<td>指包含html内容的网站推广代码</td>
</tr>
</table>
<%
footer
Sub main()
Dim AdSetting
sql="select * from Cl_Ads order by id desc"
set rs=server.createobject("adodb.recordset")
OpenConn : rs.open sql,Conn,1,1
If rs.bof and rs.eof then
Response.write "当前无任何广告!"
else
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<form action="<%=FileName%>" method="post" name="form1" id="form1">
<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="100" align="center"><strong>广告类型</strong></td>
<td width="100" height="22" align="center"><strong>广告名称</strong></td>
<td align="center"><strong>广告说明</strong></td>
<td width="80" align="center"><strong>是否使用</strong></td>
<td width="80" align="center"><strong>广告预览</strong></td>
<td width="80" height="22" align="center"><strong>操作</strong></td>
</tr>
<%
do while not rs.eof
%>
<tr class="tdbg" onMouseOut="this.className='tdbg'" onMouseOver="this.className='tdbg2'">
<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="100" align="center">
<%
If rs("ADType")=1 then
response.write "<font color=""blue"">代码广告</font>"
Else
response.write "图片广告"
Select Case rs("AdAct")
Case 1
response.write "(<font color='#ff0033'>弹出</font>)"
Case 2
response.write "(<font color='#ff0033'>浮动</font>)"
Case 3
response.write "(<font color='#ff0033'>固定</font>)"
end select
End If
%>
</td>
<td width="100" align="center">
<%If rs("ADType")=1 then%>
<font color="blue">代码广告</font>
<%Else%>
<a href="<%=rs("AdLinkUrl")%>" target="blank" title="网站地址:<%=rs("AdLinkUrl")%>"><%=rs("AdName")%></a>
<%End If%>
</td>
<td align="center">
<%=rs("AdIntro")%>
</td>
<td width="80" align="center">
<%
if rs("IsUse")=1 then
Response.write "<font color='#0000ff'>使用中</font>"
else
Response.write "<font color='#ff0033'>未使用</font>"
end if
%>
</td>
<td width="80" align="center">
<a href="Admin_AdView.asp?adid=<%=rs("ID")%>" target="blank"><font color=blue>点击预览广告</font></a>
</td>
<td width="80" align="center">
<a href='<%=FileName%>?Action=ModIfy&ID=<%=rs("ID")%>'>修改</a>
<a href='<%=FileName%>?Action=Del&ID=<%=rs("ID")%>' onclick="return confirm('确定要删除此广告吗?');">删除</a>
</td>
</tr>
<%
rs.movenext
loop
%>
<tr class="tdbg">
<td colspan="8" 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);" />
</td>
</tr>
</form>
</table>
<%
'if Cl.Web_Info(15) = "1" then
' <form name="formRefresh" method="Post" action="Admin_Ads.asp">
' <div align="center">
' <input name="Action" type="hidden" id="Action" value="RefreshAdJs">
' <input name="Submit" type="submit" value=" 刷新所有广告JS文件 "></td>
' </div>
'</form>
'end if
End If
rs.close : set rs=Nothing
End Sub
Sub Add()
%>
<form action="<%=FileName%>" method="post" name="myform" id="myform" 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="150" align="right"><strong>广告类型:</strong></td>
<td>
<input type="radio" name="AdType" value="0" onclick="SetAdtype('0')" checked="checked" />
图片广告
<input type="radio" name="AdType" value="1" onclick="SetAdtype('1')" />
代码广告
</td>
</tr>
<tr class="tdbg">
<td width="150" align="right"><strong>是否使用:</strong></td>
<td>
使用
<input name="IsUse" type="checkbox" value="1" checked="checked" />
</td>
</tr>
<tr class="tdbg">
<td width="150" align="right"><strong>广告说明:</strong></td>
<td> <br />
<textarea name="AdIntro" id="AdIntro" style="width:95%" rows="3"></textarea>
<br />
注意:简短说明,限250字节,多余部分自动截止。
</td>
</tr>
</table>
<table id="adtype_0" width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr class="tdbg">
<td width="100" align="right"><strong>广告设置:</strong></td>
<td height="26">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="settable0">
<tr>
<td width="120">
<select name="AdAct" id="AdAct" onchange="SetAct()">
<option value="0" selected="selected">不 设 置</option>
<option value="1">弹出广告</option>
<option value="2">浮动广告</option>
<option value="3">页面固定广告</option>
</select>
</td>
<td width="*" id="Adsetting_h" style="Display:none">左:
<input name="ADSetting(1)" type="text" id="ADSetting(1)" value="100" size="6" maxlength="5" />
上:
<input name="ADSetting(2)" type="text" id="ADSetting(2)" value="100" size="6" maxlength="5" />
</td>
</tr>
</table></td>
</tr>
<tr class="tdbg">
<td width="100" align="right"><strong>广告名称:</strong></td>
<td>
<input name="AdName" type="text" id="AdName" value="" size="80" maxlength="255" />
</td>
</tr>
<tr class="tdbg">
<td width="100" align="right"><strong>广告地址:</strong></td>
<td>
<input name="AdLinkUrl" type="text" id="AdLinkUrl" value="http://" size="80" maxlength="255" />
</td>
</tr>
<tr class="tdbg">
<td width="100" align="right"><strong>图片地址:</strong></td>
<td>
<input name="AdImgUrl" type="text" id="AdImgUrl" size="80" maxlength="255" value="" />
<br />
(格式为:jpg,gIf,bmp,png,swf )</td>
</tr>
<tr class="tdbg">
<td width="100" align="right"><strong>图片上传:</strong></td>
<td> <iframe style="top:2px" id="UploadFiles" src="../User/Upload.asp?ID=0&Type=0&obj=AdImgUrl" frameborder="0" scrolling="No" width="530" height="25"></iframe>
</td>
</tr>
<tr class="tdbg">
<td width="100" align="right"><strong>图片大小:</strong></td>
<td>宽:
<input name="ImgWidth" type="text" id="ImgWidth" size="6" maxlength="5" />
像素 高:
<input name="ImgHeight" type="text" id="ImgHeight" size="6" maxlength="5" />
像素<br />
(留空则取原始大小) <font color="#FF0000">* </font><font color="#0000FF">弹出广告图片大小不能留空</font></td>
</tr>
<tr class="tdbg">
<td width="100" align="right"><strong>是否FLASH:</strong></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -