📄 admin_ads.asp
字号:
<td>
<input type="radio" name="IsFlash" value="True" />
是 <input name="IsFlash" type="radio" value="False" checked="checked" />
否</td>
</tr>
</table>
<table id="adtype_1" width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" style="DISPLAY: none">
<tr class="tdbg">
<td width="100" align="right"><strong>广告代码:</strong></td>
<td> <br />
<textarea name="ADCode" id="ADCode" style="width:95%" rows="10"></textarea>
<br />
<a href="javascript:admin_Size(-5,'ADCode')"><img src="images/minus.gIf" unselectable="on" border='0' /></a> <a href="javascript:admin_Size(5,'ADCode')"><img src="images/plus.gIf" unselectable="on" border='0' /></a> </td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" >
<tr>
<td height="40" colspan="2" align="center">
<input name="Action" type="hidden" id="Action" value="SaveAdd" />
<input type="submit" name="Submit" value=" 添 加 " />
</td>
</tr>
</table>
</form>
<%
End Sub
Sub ModIfy()
dim ID,AdSetting,AdAct
ID=Cl.GetClng(request("ID"))
If ID=0 then
Cl.ShowErr("<br /><li>请指定广告ID</li>")
End If
sql="select * from Cl_Ads where ID=" & ID
set rs=server.createobject("adodb.recordset")
OpenConn : rs.open sql,Conn,1,1
If rs.bof and rs.eof Then
rs.close:set rs=Nothing
Cl.ShowErr("<br /><li>找不到指定的广告!</li>")
End If
AdAct=Rs("AdAct")
AdSetting=split(rs("ADSetting"),"|")
%>
<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')" <%If rs("AdType")=0 then%>checked<%End If%> />
图片广告
<input type="radio" name="AdType" value="1" onclick="SetAdtype('1')" <%If rs("AdType")=1 then%>checked<%End If%> />
代码广告
</td>
</tr>
<tr class="tdbg">
<td width="150" align="right"><strong>是否使用:</strong></td>
<td>
使用 <input name="IsUse" type="checkbox" value="1" <%if rs("IsUse")=1 then%>checked<%end if%> />
</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"><%=rs("AdIntro")%></textarea>
<br />
注意:简短说明,限250字节,多余部分自动截止。
</td>
</tr>
</table>
<table id="adtype_0" width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" <%If rs("AdType")=1 then%>style="Display:none"<%End If%>>
<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" <%If AdAct=0 then%>selected<%End If%>>不 设 置</option>
<option value="1" <%If AdAct=1 then%>selected<%End If%>>弹出广告</option>
<option value="2" <%If AdAct=2 then%>selected<%End If%>>浮动广告</option>
<option value="3" <%If AdAct=3 then%>selected<%End If%>>页面固定广告</option>
</select>
</td>
<td width="*" id="Adsetting_h" <%If AdAct=0 then%>style="Display:none"<%End If%>>左:
<input name="ADSetting(1)" type="text" id="ADSetting(1)" value="<%=AdSetting(1)%>" size="6" maxlength="5" />
上:
<input name="ADSetting(2)" type="text" id="ADSetting(2)" value="<%=AdSetting(2)%>" 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="<%=rs("AdName")%>" 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="<%=rs("AdLinkUrl")%>" 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="<%If rs("AdType")=0 then Response.write rs("AdImgUrl") End If%>" />
<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" value="<%=rs("ImgWidth")%>" size="6" maxlength="5" />
像素 高:
<input name="ImgHeight" type="text" id="ImgHeight" value="<%=rs("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>
<td>
<input type="radio" name="IsFlash" value="True" <%If rs("IsFlash")=True then%>checked<%End If%> />
是 <input name="IsFlash" type="radio" value="False" <%If rs("IsFlash")=False then%>checked<%End If%> />
否</td>
</tr>
</table>
<table id="adtype_1" width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" <%If rs("AdType")=0 then%>style="Display:none"<%End If%>>
<tr class="tdbg">
<td width="100" align="right"><strong>广告代码:</strong></td>
<td> <br />
<textarea name="ADCode" id="ADCode" style="width:95%" rows="10"><%If rs("AdType")=1 then Response.write rs("AdImgUrl") End If%></textarea>
<br />
<a href="javascript:admin_Size(-5,'ADCode')"><img src="images/minus.gIf" unselectable="on" border='0' /></a> <a href="javascript:admin_Size(5,'ADCode')"><img src="images/plus.gIf" unselectable="on" border='0' /></a> </td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" >
<tr>
<td height="40" colspan="2" align="center">
<input name="Action" type="hidden" id="Action" value="SaveModIfy" />
<input name="ID" type="hidden" id="ID" value="<%=rs("ID")%>" />
<input type="submit" name="Submit" value=" 保 存 " />
</td>
</tr>
</table>
</form>
<%
rs.close : set rs=Nothing
End Sub
Sub SaveAd()
Dim ID,ADType,AdName,AdLinkUrl,AdIntro,AdImgUrl,ImgWidth,ImgHeight,IsFlash
Dim AdAct,ADSetting,sADSetting,sPopleft,sPoptop,IsUse
AdLinkUrl = Trim(request("AdLinkUrl"))
AdName = Trim(request("AdName"))
AdIntro = Trim(request("AdIntro"))
ImgWidth = Trim(request("ImgWidth"))
ImgHeight = Trim(request("ImgHeight"))
IsFlash = Trim(request("IsFlash"))
ADType = Cl.GetClng(request("ADType"))
AdAct = Trim(request("AdAct"))
sPopleft = Trim(request("ADSetting(1)"))
sPoptop = Trim(request("ADSetting(2)"))
IsUse = Trim(request("IsUse"))
If ADType<>0 then AdType=1
If ADType=0 then
AdImgUrl=Trim(request("AdImgUrl"))
If AdName="" then
FoundErr=True
ErrMsg=ErrMsg & "<br /><li>网站名称不能为空!</li>"
End If
If AdImgUrl="" then
FoundErr=True
ErrMsg=ErrMsg & "<br /><li>广告图片不能为空!</li>"
End If
If Not IsNumeric(ADSetting) then ADSetting=0
ADSetting=Cint(ADSetting)
If ADSetting<0 or ADSetting>3 then ADSetting=0
If Not Isnumeric(sPopleft) then sPopleft=10
If Not Isnumeric(sPoptop) then sPoptop=10
ADSetting="0|"&sPopleft&"|"&sPoptop
Else
AdImgUrl=Trim(request("ADCode"))
If AdImgUrl="" then
FoundErr=True
ErrMsg=ErrMsg & "<br /><li>广告代码不能为空!</li>"
End If
ADSetting="0|0|0"
End If
if Not IsNumeric(IsUse) then IsUse=0
IsUse=Cint(IsUse)
if IsUse<>0 and IsUse<>1 then IsUse=0
If FoundErr=True then Cl.ShowErr(ErrMsg)
If AdLinkUrl="" or AdLinkUrl="http://" then AdLinkUrl="http://www.aspoo.cn"
If Not Isnumeric(ImgWidth) then
ImgWidth=0
Else
ImgWidth=Cint(ImgWidth)
End If
If Not Isnumeric(ImgHeight) then
ImgHeight=0
Else
ImgHeight=Cint(ImgHeight)
End If
If IsFlash<>"True" then
IsFlash=false
Else
IsFlash=True
End If
If Action="SaveAdd" then
Dim MaxAID
MaxAID=Cl.Execute("select max(ID) from Cl_Ads")(0)
if isnull(MaxAID) or Not IsNumeric(MaxAID) then MaxAID=0
sql="select * from Cl_Ads"
set rs=server.createobject("adodb.recordset")
OpenConn : rs.open sql,Conn,1,3
rs.addnew
rs("ID")=MaxAID+1
ElseIf Action="SaveModIfy" then
ID=Trim(request("ID"))
If Not Isnumeric(ID) then
Cl.ShowErr("<br /><li>请指定广告ID</li>")
End If
sql="select * from Cl_Ads where ID=" & Clng(ID)
set rs=server.createobject("adodb.recordset")
OpenConn : rs.open sql,Conn,1,3
If rs.bof and rs.eof then
rs.close:set rs=Nothing
Cl.ShowErr("<br /><li>找不到指定的广告!</li>")
End If
Else
Cl.ShowErr("<br /><li>参数错误!</li>")
End If
rs("AdName") = AdName
rs("AdLinkUrl") = AdLinkUrl
rs("AdIntro") = AdIntro
rs("AdImgUrl") = AdImgUrl
rs("ImgWidth") = ImgWidth
rs("ImgHeight") = ImgHeight
rs("IsFlash") = IsFlash
rs("ADType") = ADType
rs("AdAct") = AdAct
rs("ADSetting") = ADSetting
rs("IsUse") = IsUse
rs.update
if Instr(AdImgUrl,"{$uploaddir}")>0 then
Cl.Execute("Update Cl_UpFileLog Set InfoID=0,IsUse=1 Where SaveFileName='"&Cl.CheckStr(AdImgUrl)&"'")
end if
'if Cl.Web_Info(15) = "1" then
''Cl.LoadTemplates("")
'Cl.MakeHtml ShowAd(rs("ID"),0,0,0,0),Cl.WebDir&"Js/Ads/Ad_"&rs("ID")&".Js"
'end if
rs.close:set rs=Nothing
Cl.SaveAdminLog
response.redirect "Admin_Ads.asp"
End Sub
Sub DelAD()
dim ID
ID=Trim(Request("ID"))
If ID=0 then
FoundErr=True
ErrMsg=ErrMsg & "<br /><li>请指定广告ID</li>"
exit Sub
End If
If Instr(ID,",")>0 then
dim arrID,i
arrID=split(ID,",")
for i=0 to Ubound(arrID)
arrID(i)=Clng(arrID(i))
if arrID(i)<>1 then Cl.Execute "delete from Cl_Ads where ID=" & arrID(i)
next
Else
Cl.Execute "delete from Cl_Ads where ID=" & CLng(ID)
End If
Cl.SaveAdminLog
response.redirect FileName
End Sub
Sub RefreshAdJs()
Dim strAdJs
'Cl.LoadTemplates("")
Set Rs=Cl.Execute("select ID from Cl_Ads order by ID")
if rs.bof and rs.Eof then Cl.OutMsg 0,"当前没有任何要刷新的广告!",FileName
Do while not rs.Eof
strAdJs=ShowAd(rs(0),0,0,0,0)
Cl.MakeHtml strAdJs,Cl.WebDir&"Js/Ads/Ad_"&Rs(0)&".Js"
Rs.MoveNext
Loop
Cl.SaveAdminLog
Cl.OutMsg 0,"恭喜您,刷新所有广告JS文件成功!",FileName
End Sub
%>
<%
'<!--
'┌───────────────────────────────────────────────────────┐
'│ │
'│ CreateLive CMS Version 4.0 │
'│ Powered by Aspoo.CN │
'│ │
'│ 邮箱: support@aspoo.cn Info@aspoo.cn │
'│ QQ: 3315263 596197794 │
'│ 网站: www.aspoo.cn www.aspoo.com │
'│ 论坛: bbs.aspoo.cn bbs.aspoo.com │
'│ │
'│ Copyright (C) 2005-2007 Aspoo.CN All Rights Reserved. │
'└───────────────────────────────────────────────────────┘
'-->
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -