📄 special.asp
字号:
<%
Sub special()
set MyFile=Server.CreateObject("Scripting.FileSystemObject")
Set CrmapS=MyFile.CreateTextFile(Server.MapPath("..")&"\Special\Special.js")
str1="document.write('"
'--------------------------
set rs = server.createobject("adodb.recordset")
rs.source = "select * from Speical order by id desc "
rs.open rs.source,conn,1,1
if rs.recordcount=0 then
str1 = str1 & "没有专题<br>"
str1= str1 & "')"
CrmapS.write str1
end if
'=================生成专题JS开始=============
while not rs.eof
SpeicalCn=rs("SpeicalCn")
Speicalen=rs("Speicalen")
str1 = str1& "<table width=98% height=22 border=0 cellpadding=0 cellspacing=0 background=pic/news_bg_2.gif> <tr> <td> <b><font color=0033CC>"&rs("SpeicalCn")&"</font></b></td> </tr></table><table width=98% height=4 border=0 cellpadding=0 cellspacing=0> <tr> <td height=6></td> </tr></table>"
set rssp = server.createobject("adodb.recordset")
rssp.source = "select * from news where SpeicalCn='"&SpeicalCn&"' order by NewsID desc"
rssp.open rssp.source,conn,1,3
'----专题调用数开始-----------------------------------
set rssc = server.createobject("adodb.recordset")
rssc.source = "select * from config"
rssc.open rssc.source,conn,1,3
for i=1 to rssc("spcount")
if rssp.eof then exit for
str1 = str1 & "·<a href=http://"&sowinpath&rssp("lpath")&rssp("FileName")&".html target=_blank>"&rssp("Title")&"</a><br>"
'----专题调用数结束-----------------------------------
rssp.movenext
next
str1 = str1 & "<table width=98% border=0 cellpadding=0 cellspacing=0> <tr> <td><div align=right><a href=http://"&sowinpath&"special/"&Speicalen&"_1.html target=_blank>更多...</a></div></td> </tr></table>"
rs.movenext
wend
str1=str1 & "')"
CrmapS.write str1
'====================生成专题JS结束=====================
rs.close
set rs=nothing
set rssp=nothing
set MyFile=nothing
CrmapS.close
End Sub
'---------------更多专题生成开始---------------------------------------------------------------------------------------
Sub specialmore()
spcn=request.Form("speicalcn")
set rs=Server.CreateObject("ADODB.RECORDSET")
sql="Select * from News Where SpeicalCn='"&request.form("SpeicalCn")&"' order by newsid Desc"
rs.open sql,conn,1,1
set rs3=Server.CreateObject("adodb.recordset")
sql3="Select TempletContent from Templet Where TempletType='special'"
rs3.open sql3,conn,1,1
set rsc=Server.CreateObject("adodb.recordset")
sqlc="Select spcount from config"
rsc.open sqlc,conn,1,1
'------------------------------
set rss=Server.CreateObject("ADODB.RECORDSET")
sqls="Select * from speical Where SpeicalCn='"&request.form("SpeicalCn")&"' order by id desc"
rss.open sqls,conn,1,1
'------------------------------
while not rss.eof
AllPage=rs.recordcount/rss("SpeicalNum")
AllPage1=int(rs.recordcount/rss("SpeicalNum"))
if AllPage1<Allpage then AllPage=AllPage1+1
Set MyFile=Server.CreateObject("Scripting.FileSystemObject")
for i=1 to AllPage
Set Crspm=MyFile.CreateTextFile(Server.MapPath("..")&"\special\"&rss("Speicalen")&"_"&i&".js")
str2="document.write('"
for x=1 to rss("SpeicalNum")
if rs.eof then exit for
str2 = str2 & "·<a href=http://"&sowinpath&rs("lpath")&rs("FileName")&".html target=_blank>"&CovtTitle(rs("title"))&"</a><br>"
rs.movenext
next
str2 = str2 & "<div align=center>共<font color=red><b>"&rs.recordcount&"</b></font>条新闻 <a href=http://"&sowinpath&"special/"&rss("Speicalen")&"_1.html>首页</a> "
if i<>AllPage then
str2 = str2 & "<a href=http://"&sowinpath&"special/"&rss("Speicalen")&"_"&i+1&".html>下一页</a> "
else
str2 = str2 & "下一页 "
end if
if i<>1 then
str2 = str2 & "<a href=http://"&sowinpath&"special/"&rss("Speicalen")&"_"&i-1&".html>上一页</a> "
else
str2 = str2 & "上一页 "
end if
str2 = str2 & "<a href=http://"&sowinpath&"special/"&rss("Speicalen")&"_"&AllPage&".html>尾页</a> 页次:<font color=red><b>"&i&"</b></font>/<b>"&AllPage&"</b> <font color=red><b>"&rss("SpeicalNum")&"</b></font>条新闻/页 转到:"
for x=1 to AllPage
if x=i then
str2 = str2 & "<option value=http://"&sowinpath&"special/"&rss("Speicalen")&"_"&x&".html selected>第"&x&"页</option>"
else
str2 = str2 & "<option value=http://"&sowinpath&"special/"&rss("Speicalen")&"_"&x&".html>第"&x&"页</option>"
end if
next
str2 = str2 & "</select></div>"
str2=str2 & "')"
Crspm.write str2
Set CrHtm1=MyFile.CreateTextFile(Server.MapPath("..")&"\special\"&rss("speicalen")&"_"&i&".html")
if rs3.eof and rs3.bof then
Content="<script src=http://"&sowinpath&"special/"&rss("speicalen")&"_"&i&".js></script>"
else
Content=CHC(rs3("TempletContent"),i)
end if
CrHtm1.WriteLine Content
CrHtm1.close
Crspm.close
next
rss.movenext
wend
rs.close
set rs=nothing
rs3.close
set rs3=nothing
rsc.close
set rsc=nothing
rss.close
set rss=nothing
set MyFile=nothing
End Sub
'-------------------更多专题生成结束---------------------------------------
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -