📄 ad_advertisement.asp
字号:
<textarea name="ADCode" id="ADCode" cols="50" rows="10"><%if rs("ADType")=6 then response.write rs("ImgUrl")%></textarea>
<br>
<br>
</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>
<script language=JavaScript>
showsetting(myform)
</script>
</form>
<%
rs.close
set rs=nothing
end sub
%>
<table width="100%" border="0" cellspacing="1" cellpadding="2" class="border">
<tr class="title">
<td height="22" colspan="2"><strong>广告类型说明</strong></td>
</tr>
<tr class="tdbg">
<td>弹出广告:</td>
<td>指采用弹出窗口形式的广告</td>
</tr>
<tr class="tdbg">
<td>Banner广告:</td>
<td>指页面顶部中间Banner处的广告,其大小一般为480*60</td>
</tr>
<tr class="tdbg">
<td>栏目广告:</td>
<td>指穿插在各栏目间的广告,其大小一般为480*60</td>
</tr>
<tr class="tdbg">
<td>文章内容页广告:</td>
<td>指显示在文章内容中间的广告,其大小一般为300*300</td>
</tr>
<tr class="tdbg">
<td>浮动广告:</td>
<td>指漂浮在页面上不断移动的广告,其大小一般为80*80 </td>
</tr>
<tr class="tdbg">
<td>页面固定广告:</td>
<td>指固定显示在页面某一位置的广告</td>
</tr>
<tr class="tdbg">
<td>代码广告:</td>
<td>指包含html内容的网站推广代码</td>
</tr>
</table>
</body>
</html>
<%
sub SaveAdd()
dim ChannelID,ADType,SiteName,SiteUrl,SiteIntro,ImgUrl,ImgWidth,ImgHeight,IsFlash,IsSelected,ADSetting
dim popleft,poptop,floatleft,floattop,fixedleft,fixedtop
ChannelID=Clng(request("ChannelID"))
ADType=Clng(request("ADType"))
SiteUrl=trim(request("SiteUrl"))
SiteName=trim(request("SiteName"))
SiteIntro=trim(request("SiteIntro"))
ImgWidth=trim(request("ImgWidth"))
ImgHeight=Trim(request("ImgHeight"))
IsFlash=trim(request("IsFlash"))
IsSelected=trim(request("IsSelected"))
if ADType<>6 then
ImgUrl=trim(request("ImgUrl"))
if SiteName="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>网站名称不能为空!</li>"
end if
if ImgUrl="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>广告图片不能为空!</li>"
end if
else
ImgUrl=trim(request("ADCode"))
if ImgUrl="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>广告代码不能为空!</li>"
end if
end if
if FoundErr=True then
exit sub
end if
if SiteUrl="http://" then SiteUrl="http://www.luye.net"
if ImgWidth="" then
ImgWidth=0
else
ImgWidth=Cint(ImgWidth)
end if
if ImgHeight="" then
ImgHeight=0
else
ImgHeight=Cint(ImgHeight)
end if
if IsFlash="" then IsFlash=false
if IsSelected="" then IsSelected=false
if ADType=0 then
if trim(request("popleft"))="" then popleft=0 else popleft=trim(request("popleft"))
if trim(request("poptop"))="" then poptop=0 else poptop=trim(request("poptop"))
ADSetting=popleft & "|" & poptop
elseif ADType=4 then
if trim(request("floatleft"))="" then floatleft=0 else floatleft=trim(request("floatleft"))
if trim(request("floattop"))="" then floattop=0 else floattop=trim(request("floattop"))
ADSetting=floatleft & "|" & floattop
elseif ADType=5 then
if trim(request("fixedleft"))="" then fixedleft=0 else fixedleft=trim(request("fixedleft"))
if trim(request("fixedtop"))="" then fixedtop=0 else fixedtop=trim(request("fixedtop"))
ADSetting=fixedleft & "|" & fixedtop
end if
sql="select * from Advertisement"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
rs("ChannelID")=ChannelID
rs("ADType")=ADType
rs("ADSetting")=ADSetting
rs("SiteName")=SiteName
rs("SiteUrl")=SiteUrl
rs("SiteIntro")=SiteIntro
rs("ImgUrl")=ImgUrl
rs("ImgWidth")=ImgWidth
rs("ImgHeight")=ImgHeight
rs("IsFlash")=IsFlash
rs("IsSelected")=IsSelected
rs.update
rs.close
set rs=nothing
call CloseConn()
response.redirect "ad_Advertisement.asp?Channel="&ChannelID
end sub
sub SaveModify()
dim sql,rs
dim ID,ChannelID,ADType,SiteName,SiteUrl,SiteIntro,ImgUrl,ImgWidth,ImgHeight,IsFlash,IsSelected,ADSetting
dim popleft,poptop,floatleft,floattop,fixedleft,fixedtop
ID=trim(request("ID"))
ChannelID=Clng(request("ChannelID"))
ADType=Clng(request("ADType"))
SiteName=trim(request("SiteName"))
SiteUrl=trim(request("SiteUrl"))
SiteIntro=trim(request("SiteIntro"))
ImgWidth=trim(request("ImgWidth"))
ImgHeight=Trim(request("ImgHeight"))
IsFlash=trim(request("IsFlash"))
IsSelected=trim(request("IsSelected"))
if ID="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请指定广告ID</li>"
else
ID=Clng(ID)
end if
if ADType<>6 then
ImgUrl=trim(request("ImgUrl"))
if SiteName="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>网站名称不能为空!</li>"
end if
if ImgUrl="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>广告图片不能为空!</li>"
end if
else
ImgUrl=trim(request("ADCode"))
if ImgUrl="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>广告代码不能为空!</li>"
end if
end if
if FoundErr=True then
exit sub
end if
if SiteUrl="http://" then SiteUrl="http://www.luye.net"
if ImgWidth="" then
ImgWidth=0
else
ImgWidth=Cint(ImgWidth)
end if
if ImgHeight="" then
ImgHeight=0
else
ImgHeight=Cint(ImgHeight)
end if
if IsFlash="" then IsFlash=false
if IsSelected="" then IsSelected=false
if ADType=0 then
if trim(request("popleft"))="" then popleft=0 else popleft=trim(request("popleft"))
if trim(request("poptop"))="" then poptop=0 else poptop=trim(request("poptop"))
ADSetting=popleft & "|" & poptop
elseif ADType=4 then
if trim(request("floatleft"))="" then floatleft=0 else floatleft=trim(request("floatleft"))
if trim(request("floattop"))="" then floattop=0 else floattop=trim(request("floattop"))
ADSetting=floatleft & "|" & floattop
elseif ADType=5 then
if trim(request("fixedleft"))="" then fixedleft=0 else fixedleft=trim(request("fixedleft"))
if trim(request("fixedtop"))="" then fixedtop=0 else fixedtop=trim(request("fixedtop"))
ADSetting=fixedleft & "|" & fixedtop
end if
sql="select * from Advertisement where ID=" & ID
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if rs.bof and rs.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>找不到指定的广告!</li>"
rs.close
set rs=nothing
exit sub
end if
rs("ChannelID")=ChannelID
rs("ADType")=ADType
rs("ADSetting")=ADSetting
rs("SiteName")=SiteName
rs("SiteUrl")=SiteUrl
rs("SiteIntro")=SiteIntro
rs("ImgUrl")=ImgUrl
rs("ImgWidth")=ImgWidth
rs("ImgHeight")=ImgHeight
rs("IsFlash")=IsFlash
rs("IsSelected")=IsSelected
rs.update
rs.close
set rs=nothing
call CloseConn()
response.redirect strFileName
end sub
sub SetNew()
dim ID
ID=Trim(Request("ID"))
if ID="" 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)
conn.execute "Update Advertisement set IsSelected=True Where ID=" & CLng(arrID(i))
next
else
conn.execute "Update Advertisement set IsSelected=True Where ID=" & CLng(ID)
end if
response.redirect strFileName
end sub
sub CancelNew()
dim ID
ID=Trim(Request("ID"))
if ID="" 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)
conn.execute "Update Advertisement set IsSelected=False Where ID=" & CLng(arrID(i))
next
else
conn.execute "Update Advertisement set IsSelected=False Where ID=" & CLng(ID)
end if
response.redirect strFileName
end sub
sub MoveAdvertisement()
dim ID,MoveChannelID
ID=Trim(Request("ID"))
if ID="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请指定广告ID</li>"
exit sub
end if
MoveChannelID=Trim(Request("ChannelID"))
if Instr(ID,",")>0 then
dim arrID,i
arrID=split(ID,",")
for i=0 to Ubound(arrID)
conn.execute "Update Advertisement set ChannelID = "& MoveChannelID & " where ID=" & CLng(arrID(i))
next
else
conn.execute "Update Advertisement set ChannelID = "& MoveChannelID & " where ID=" & CLng(ID)
end if
response.redirect strFileName
end sub
sub DelAD()
dim ID
ID=Trim(Request("ID"))
if ID="" 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)
conn.execute "delete from Advertisement where ID=" & CLng(arrID(i))
next
else
conn.execute "delete from Advertisement where ID=" & CLng(ID)
end if
response.redirect strFileName
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -