ucash 发表于 2006-10-24 11:25:26

ASP广告代码的解决?

想改变如下的代码,实现网页中嵌入广告的功能

代码如下(部分):
sub content_down()
if rs("Grade")="0" then
hxGrade="游客身份"
elseif rs("Grade")="1" then
hxGrade="会员身份"
elseif rs("Grade")="2" then
hxGrade="VIP身份"
end if
Response.Write "<table width=""100%"" border=""1"" align=""center"" cellspacing=""0"" cellpadding=""3"" bgcolor=""#FFFFFF"" bordercolor=""#f0f0f0"" style=""border-collapse: collapse"">"
Response.Write "<tr>" & vbCrLf
Response.Write "<td colspan=3 align='center' HEIGHT=30><b><font color=ff6600><b>"&rs("soft_name")&"</b></font><b></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='25' align='center' width='15%'>加入时间</td>" & vbCrLf
Response.Write "<td width='35%'> "&rs("soft_joindate")&"</td>" & vbCrLf
Response.Write "<td rowspan='11' align='center' width='235'>" & vbCrLf
if rs("soft_showpic")<>"http://hx66.net" then
Response.Write "<a href='"&rs("soft_showpic")&"' title='"&rs("soft_showpic")&"' target=_blank><img src='"&rs("soft_showpic")&"' border='0' valign='center'></a>" & vbCrLf
else
Response.Write "<img src='img/nopic.gif' border='0' valign='center'>" & vbCrLf
end if
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf

想要实现的网页情况地址:http://www.vip138.com/showdown.asp?soft_id=28

想通过修改这段语句:
if rs("soft_showpic")<>"http://hx66.net" then
Response.Write "<a href='"&rs("soft_showpic")&"' title='"&rs("soft_showpic")&"' target=_blank><img src='"&rs("soft_showpic")&"' border='0' valign='center'></a>" & vbCrLf
else
Response.Write "<img src='img/nopic.gif' border='0' valign='center'>" & vbCrLf
end if
实现:有图片链接的时候,右侧显示图片,没有图片链接的时候显示以下代码生成的公告

广告代码如下:
<script>
var YahooCNADConfig=new Array();
YahooCNADConfig['adid']=363
YahooCNADConfig['wid']=XXXXX
YahooCNADConfig['w']=141
YahooCNADConfig['h']=60
</script>
<script type='text/javascript' src='http://view.aliunion.cn.yahoo.com/showad.php'></script>

请教如何将广告代码替换部分语句实现这个功能?谢谢

mudone 发表于 2006-10-24 14:29:36

替换:Response.Write "<img src='img/nopic.gif' border='0' valign='center'>" & vbCrLf
为:
Response.Write "<script>" & vbCrLf
Response.Write "var YahooCNADConfig=new Array();" & vbCrLf
Response.Write "YahooCNADConfig['adid']=363" & vbCrLf
Response.Write "YahooCNADConfig['wid']=XXXXX" & vbCrLf
Response.Write "YahooCNADConfig['w']=141" & vbCrLf
Response.Write "YahooCNADConfig['h']=60" & vbCrLf
Response.Write "</script>" & vbCrLf
Response.Write "<script type='text/javascript' src='http://view.aliunion.cn.yahoo.com/showad.php'></script>" & vbCrLf

ucash 发表于 2006-10-24 18:39:08

非常感谢,我现在就试下~~~:loveliness:

ucash 发表于 2006-10-24 18:49:20

非常感谢,PS个问题,如果要加个居中代码该怎么加呢?我模仿了下,好像不行

mudone 发表于 2006-10-24 19:23:27

<div align="center">xxxxxx</div>
页: [1]
查看完整版本: ASP广告代码的解决?