📄 nc_adcolumncls.asp
字号:
End If
Response.Write " 页次:<strong><font color=red>" & CurrentPage & "</font>/" & n & "</strong>页 "
Response.Write " 转到:"
Response.Write " <select name='page' size='1' style=""font-size: 9pt"" onChange='javascript:submit()'>" & vbCrLf
For ii = 1 To n
Response.Write "<option value='" & ii & "' "
If CurrentPage = Int(ii) Then
Response.Write "selected "
End If
Response.Write ">第" & ii & "页</option>"
Next
Response.Write " </select> " & vbCrLf
Response.Write "</td></tr></FORM></table>" & vbCrLf
End Sub
Private Function DelAdsImage(FileID)
Dim FSO
Dim FilePath
Dim Rs_Obj
If Not DownsysClass.IsObjectFSO(DownsysClass.Script_FSO) Then Exit Function
Set FSO = Server.CreateObject(DownsysClass.Script_FSO)
Set Rs_Obj = CreateObject("adodb.recordset")
SQL = "select id,ImageUrl from NC_Adcolumn where id in (" & FileID & ")"
Rs_Obj.Open SQL, Conn, 1, 1
Do While Not Rs_Obj.EOF
FilePath = Rs_Obj(1)
FilePath = Replace(FilePath, "http:/", "")
If FSO.FileExists(Server.MapPath(FilePath)) Then
FSO.DeleteFile Server.MapPath(FilePath), True
End If
Rs_Obj.movenext
Loop
Rs_Obj.Close
Set Rs_Obj = Nothing
Set FSO = Nothing
End Function
'*************************************************************
'函数作用:Banner广告
'*************************************************************
Public Function BannerAds(ColumnID)
Dim SQL, Rs_Ad, HtmlString
Set Rs_Ad = CreateObject("adodb.recordset")
SQL = "select Top 1 * from NC_Adcolumn where AdsType = 1 And isLock = 0 And ColumnID in (0, " & ColumnID & ") order by AdsTime desc, id desc"
Rs_Ad.Open SQL, Conn, 1, 1
If Rs_Ad.bof And Rs_Ad.EOF Then
HtmlString = "<A HREF='http://www.10000.org.cn/' target=_blank><img src='" & DownsysClass.SetupDir & "images/Banner.gif' border=0 width='468' height='60'></A>"
Else
If Rs_Ad("LinkType") = 0 Then
HtmlString = "<A HREF='" & Rs_Ad("LinkUrl") & "' target=_blank Title='" & Rs_Ad("Remark") & "'><img src='" & Rs_Ad("ImageUrl") & "' border=0 width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'></A>"
ElseIf Rs_Ad("LinkType") = 1 Then
HtmlString = " <object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'>" & vbCrLf
HtmlString = HtmlString & " <param name='movie' value='" & Rs_Ad("ImageUrl") & "'>" & vbCrLf
HtmlString = HtmlString & " <param name='quality' value='high'>" & vbCrLf
HtmlString = HtmlString & " <embed src='" & Rs_Ad("ImageUrl") & "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'></embed>" & vbCrLf
HtmlString = HtmlString & " </object>" & vbCrLf
Else
HtmlString = Rs_Ad("Remark")
End If
End If
Rs_Ad.Close
Set Rs_Ad = Nothing
BannerAds = HtmlString
End Function
'*************************************************************
'函数作用:栏目广告
'*************************************************************
Public Function AdsColumn(ColumnID, TypeID)
Dim SQL, Rs_Ad, HtmlString
Set Rs_Ad = CreateObject("adodb.recordset")
SQL = "select Top 12 * from NC_Adcolumn where AdsType = " & TypeID & " And isLock = 0 And ColumnID in (0, " & ColumnID & ") order by AdsTime desc, id desc"
Rs_Ad.Open SQL, Conn, 1, 1
If Rs_Ad.bof And Rs_Ad.EOF Then
HtmlString = ""
Else
Do While Not Rs_Ad.EOF
If Rs_Ad("LinkType") = 0 Then
HtmlString = HtmlString & "<A HREF='" & Rs_Ad("LinkUrl") & "' target=_blank Title='" & Rs_Ad("Remark") & "'><img src='" & Rs_Ad("ImageUrl") & "' border=0 width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'></A>" & vbCrLf & Chr(9)
ElseIf Rs_Ad("LinkType") = 1 Then
HtmlString = HtmlString & " <object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'>" & vbCrLf
HtmlString = HtmlString & " <param name='movie' value='" & Rs_Ad("ImageUrl") & "'>" & vbCrLf
HtmlString = HtmlString & " <param name='quality' value='high'>" & vbCrLf
HtmlString = HtmlString & " <embed src='" & Rs_Ad("ImageUrl") & "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'></embed>" & vbCrLf
HtmlString = HtmlString & " </object>" & vbCrLf & Chr(9)
Else
HtmlString = HtmlString & Rs_Ad("Remark") & vbCrLf & Chr(9)
End If
Rs_Ad.movenext
Loop
End If
Rs_Ad.Close
Set Rs_Ad = Nothing
AdsColumn = HtmlString
End Function
'*************************************************************
'函数作用:文章内容广告
'*************************************************************
Public Function AdsColumn1(ColumnID, TypeID)
Dim SQL, Rs_Ad, HtmlString
Set Rs_Ad = CreateObject("adodb.recordset")
SQL = "select Top 1 * from NC_Adcolumn where AdsType = " & TypeID & " And isLock = 0 And ColumnID in (0, " & ColumnID & ") order by AdsTime desc, id desc"
Rs_Ad.Open SQL, Conn, 1, 1
If Rs_Ad.bof And Rs_Ad.EOF Then
HtmlString = ""
Else
Do While Not Rs_Ad.EOF
If Rs_Ad("LinkType") = 0 Then
HtmlString = HtmlString & "<A HREF='" & Rs_Ad("LinkUrl") & "' target=_blank Title='" & Rs_Ad("Remark") & "'><img src='" & Rs_Ad("ImageUrl") & "' border=0 width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "' align='left'></A>" & vbCrLf & Chr(9)
ElseIf Rs_Ad("LinkType") = 1 Then
HtmlString = HtmlString & " <object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'>" & vbCrLf
HtmlString = HtmlString & " <param name='movie' value='" & Rs_Ad("ImageUrl") & "'>" & vbCrLf
HtmlString = HtmlString & " <param name='quality' value='high'>" & vbCrLf
HtmlString = HtmlString & " <embed src='" & Rs_Ad("ImageUrl") & "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'></embed>" & vbCrLf
HtmlString = HtmlString & " </object>" & vbCrLf & Chr(9)
Else
HtmlString = HtmlString & Rs_Ad("Remark") & vbCrLf & Chr(9)
End If
Rs_Ad.movenext
Loop
End If
Rs_Ad.Close
Set Rs_Ad = Nothing
AdsColumn1 = HtmlString
End Function
'*************************************************************
'函数作用:固定广告
'*************************************************************
Public Function ScriptFixedAds(ColumnID)
Dim SQL, Rs_Ad, HtmlString, ScriptString, strMargin
Set Rs_Ad = CreateObject("adodb.recordset")
SQL = "select Top 12 * from NC_Adcolumn where AdsType in (5,6) And isLock = 0 And ColumnID in (0, " & ColumnID & ") order by AdsTime desc, id desc"
Rs_Ad.Open SQL, Conn, 1, 1
If Rs_Ad.bof And Rs_Ad.EOF Then
ScriptFixedAds = ""
Else
Do While Not Rs_Ad.EOF
If Rs_Ad("AdsType") = 6 Then strMargin = "style='right:" & Rs_Ad("sidemargin2") & "px;POSITION:absolute;TOP:" & Rs_Ad("topmargin2") & "px;'"
If Rs_Ad("AdsType") = 5 Then strMargin = "style='left:" & Rs_Ad("sidemargin1") & "px;POSITION:absolute;TOP:" & Rs_Ad("topmargin1") & "px;'"
If Rs_Ad("LinkType") = 0 Then
HtmlString = HtmlString & "suspendcode" & Rs_Ad("id") & "=""<DIV id=lovexin" & Rs_Ad("id") & " " & strMargin & "><A HREF='" & Rs_Ad("LinkUrl") & "' target=_blank Title='" & Rs_Ad("Remark") & "'><img src='" & Rs_Ad("ImageUrl") & "' border=0 width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'></A></div>""" & vbCrLf
HtmlString = HtmlString & "document.write(suspendcode" & Rs_Ad("id") & "); " & vbCrLf
ScriptString = ScriptString & "document.all.lovexin" & Rs_Ad("id") & ".style.pixelTop+=percent;" & vbCrLf
ElseIf Rs_Ad("LinkType") = 1 Then
HtmlString = HtmlString & " suspendcode" & Rs_Ad("id") & "=""<DIV id=lovexin" & Rs_Ad("id") & " " & strMargin & "><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'>"
HtmlString = HtmlString & "<param name='movie' value='" & Rs_Ad("ImageUrl") & "'>"
HtmlString = HtmlString & "<param name='quality' value='high'>"
HtmlString = HtmlString & "<embed src='" & Rs_Ad("ImageUrl") & "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'></embed>"
HtmlString = HtmlString & "</object></div>""" & vbCrLf
HtmlString = HtmlString & "document.write(suspendcode" & Rs_Ad("id") & "); " & vbCrLf
ScriptString = ScriptString & "document.all.lovexin" & Rs_Ad("id") & ".style.pixelTop+=percent;" & vbCrLf
Else
HtmlString = HtmlString & "suspendcode" & Rs_Ad("id") & "=""<DIV id=lovexin" & Rs_Ad("id") & " " & strMargin & "><table border=0 width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'><tr><td class=AdsBorder>" & Rs_Ad("Remark") & "</td></tr></table></div>""" & vbCrLf
HtmlString = HtmlString & "document.write(suspendcode" & Rs_Ad("id") & "); " & vbCrLf
ScriptString = ScriptString & "document.all.lovexin" & Rs_Ad("id") & ".style.pixelTop+=percent;" & vbCrLf
End If
Rs_Ad.movenext
Loop
ScriptFixedAds = "<script language=""JavaScript"">" & vbCrLf
ScriptFixedAds = ScriptFixedAds & "lastScrollY=0;" & vbCrLf
ScriptFixedAds = ScriptFixedAds & "function heartBeat(){ " & vbCrLf
ScriptFixedAds = ScriptFixedAds & "diffY=document.body.scrollTop; " & vbCrLf
ScriptFixedAds = ScriptFixedAds & "percent=.1*(diffY-lastScrollY); " & vbCrLf
ScriptFixedAds = ScriptFixedAds & "if(percent>0)percent=Math.ceil(percent); " & vbCrLf
ScriptFixedAds = ScriptFixedAds & "else percent=Math.floor(percent); " & vbCrLf
ScriptFixedAds = ScriptFixedAds & ScriptString
ScriptFixedAds = ScriptFixedAds & "lastScrollY=lastScrollY+percent; " & vbCrLf
ScriptFixedAds = ScriptFixedAds & "} " & vbCrLf
ScriptFixedAds = ScriptFixedAds & HtmlString
ScriptFixedAds = ScriptFixedAds & "window.setInterval(""heartBeat()"",1); " & vbCrLf
ScriptFixedAds = ScriptFixedAds & "</script>" & vbCrLf
End If
Rs_Ad.Close
Set Rs_Ad = Nothing
End Function
'*************************************************************
'函数作用:漂浮广告
'*************************************************************
Public Function ScriptFloatAds(ColumnID)
Dim SQL, Rs_Ad, HtmlString
Set Rs_Ad = CreateObject("adodb.recordset")
SQL = "select Top 1 * from NC_Adcolumn where AdsType = 4 And isLock = 0 And ColumnID in (0, " & ColumnID & ") order by AdsTime desc, id desc"
Rs_Ad.Open SQL, Conn, 1, 1
If Rs_Ad.bof And Rs_Ad.EOF Then
HtmlString = ""
Else
HtmlString = HtmlString & "<SCRIPT LANGUAGE=JavaScript src=" & DownsysClass.SetupDir & "js/floatads.js></SCRIPT>" & vbCrLf
If Rs_Ad("LinkType") = 0 Then
HtmlString = HtmlString & "<div id='yuxingtome' style='position:absolute;'><A HREF='" & Rs_Ad("LinkUrl") & "' target=_blank Title='" & Rs_Ad("Remark") & "'><img src='" & Rs_Ad("ImageUrl") & "' border=0 width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'></A></div>" & vbCrLf
ElseIf Rs_Ad("LinkType") = 1 Then
HtmlString = HtmlString & "<div id='yuxingtome' style='position:absolute;'><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'>"
HtmlString = HtmlString & "<param name='movie' value='" & Rs_Ad("ImageUrl") & "'>"
HtmlString = HtmlString & "<param name='quality' value='high'>"
HtmlString = HtmlString & "<embed src='" & Rs_Ad("ImageUrl") & "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'></embed>"
HtmlString = HtmlString & "</object></div>" & vbCrLf
Else
HtmlString = HtmlString & "<div id='yuxingtome' style='position:absolute;'><table border=0 width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'><tr><td class=AdsBorder>" & Rs_Ad("Remark") & "</td></tr></table></div>" & vbCrLf
End If
HtmlString = HtmlString & "<SCRIPT LANGUAGE=JavaScript>yuxingtome()</SCRIPT>" & vbCrLf
End If
Rs_Ad.Close
Set Rs_Ad = Nothing
ScriptFloatAds = HtmlString
End Function
'*************************************************************
'函数作用:推荐广告
'*************************************************************
Public Function TuijianAds(ColumnID)
Dim SQL, Rs_Ad, HtmlString
Set Rs_Ad = CreateObject("adodb.recordset")
SQL = "select * from NC_Adcolumn where AdsType = 8 And isLock = 0 And ColumnID in (0, " & ColumnID & ") order by AdsTime desc, id desc"
Rs_Ad.Open SQL, Conn, 1, 1
If Rs_Ad.bof And Rs_Ad.EOF Then
HtmlString = "<A HREF='http://www.5585.net/' target=_blank><img src='" & DownsysClass.SetupDir & "images/tuijian.gif' border=0 width='158' height='60'></A>"
Else
Do While Not Rs_Ad.EOF
If Rs_Ad("LinkType") = 0 Then
HtmlString = HtmlString & "<A HREF='" & Rs_Ad("LinkUrl") & "' target=_blank Title='" & Rs_Ad("Remark") & "'><img src='" & Rs_Ad("ImageUrl") & "' border=0 width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'></A>" & vbCrLf & Chr(9)
ElseIf Rs_Ad("LinkType") = 1 Then
HtmlString = HtmlString & " <object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'>" & vbCrLf
HtmlString = HtmlString & " <param name='movie' value='" & Rs_Ad("ImageUrl") & "'>" & vbCrLf
HtmlString = HtmlString & " <param name='quality' value='high'>" & vbCrLf
HtmlString = HtmlString & " <embed src='" & Rs_Ad("ImageUrl") & "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" & Rs_Ad("Width") & "' height='" & Rs_Ad("Height") & "'></embed>" & vbCrLf
HtmlString = HtmlString & " </object>" & vbCrLf & Chr(9)
Else
HtmlString = HtmlString & Rs_Ad("Remark") & vbCrLf & Chr(9)
End If
Rs_Ad.movenext
Loop
End If
Rs_Ad.Close
Set Rs_Ad = Nothing
TuijianAds = HtmlString
End Function
'*************************************************************
'函数作用:弹出式窗口
'*************************************************************
Public Function RunScriptAds(ColumnID)
Dim SQL, Rs_Ad, HtmlString
Set Rs_Ad = CreateObject("adodb.recordset")
SQL = "select Top 1 * from NC_Adcolumn where AdsType = 0 And isLock = 0 And ColumnID in (0, " & ColumnID & ") order by AdsTime desc, id desc"
Rs_Ad.Open SQL, Conn, 1, 1
If Rs_Ad.bof And Rs_Ad.EOF Then
HtmlString = ""
Else
HtmlString = "<SCRIPT language=javascript>window.open(""" & DownsysClass.SetupDir & "runads.asp?id=" & Rs_Ad("id") & """,""runads" & Rs_Ad("id") & """,""toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,width=" & Rs_Ad("Width") & ",height=" & Rs_Ad("Height") & ",top=" & Rs_Ad("topmargin") & ",left=" & Rs_Ad("sidemargin") & """);</script>" & vbCrLf
End If
Rs_Ad.Close
Set Rs_Ad = Nothing
RunScriptAds = HtmlString
End Function
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -