📄 creatsc2.asp
字号:
<!--#include file="conn.asp"-->
<%
classid=request("classid")
set rs=server.createobject("adodb.recordset")
rs.open "select * from feilei where classid="&classid,conn,1,3
classname=rs("classname")
topclass=rs("topclass")
rs.close
dim fso
dim fr
dim wstr
dim fw
set fso=createobject("scripting.filesystemobject")
set fr=fso.opentextfile(server.mappath("sc.htm"))
wstr=fr.readall
fr.close
dim rstr
dim xunxu
xunxu="><a href='sc_" & classid & ".htm'>" & classname & "</a>"
while topclass<>0
rs.open "select * from feilei where classid="&topclass,conn,1,3
if not rs.eof then
xunxu="><a href='sc_" & rs("classid") & ".htm'>" & rs("classname") & "</a>" & xunxu
topclass=rs("topclass")
end if
rs.close
wend
wstr=replace(wstr,"<{{sc1}}>",xunxu)
rs.open "select * from feilei where topclass="&classid,conn,1,3
jishu=1
if rs.eof then
rstr=rstr & ""
end if
while not rs.eof
if jishu=1 or jishu mod 7 = 1 then
rstr=rstr & "<tr><td width='100' height='20' align=center><a href='sc_"&rs("classid")&".htm'><b>"&rs("classname")&"</b></a></td>"
else
rstr=rstr & "<td width='100' height='20' align=center><a href='sc_"&rs("classid")&".htm'><b>"&rs("classname")&"</b></a></td>"
end if
if jishu mod 7 =0 then rstr=rstr & "</tr>"
jishu=jishu+1
rs.movenext
wend
jishu=jishu-1
if jishu mod 7 <> 0 then
for i= 1 to 7-(jishu mod 7)
rstr=rstr & "<td width='100'> </td>"
if i = 7-(jishu mod 7) then rstr=rstr & "</tr>"
next
end if
rs.close
wstr=replace(wstr,"<{{sc2}}>",rstr)
rstr=empay
rs.open "select * from detail where classid=" & classid & " order by topid desc,id",conn,1,3
jishu=1
while not rs.eof
if jishu=1 or jishu mod 4 = 1 then
rstr=rstr & "<tr><td width='25%' height='20'><a href='"&rs("url")&"' target='_blank'>"&rs("title")&"</a></td>"
else
rstr=rstr & "<td width='25%' height='20'><a href='"&rs("url")&"' target='_blank'>"&rs("title")&"</a></td>"
end if
if jishu mod 4 =0 then rstr=rstr & "</tr>"
jishu=jishu+1
rs.movenext
wend
jishu=jishu-1
if jishu mod 4 <> 0 then
for i= 1 to 4-(jishu mod 4)
rstr=rstr & "<td width='25%'> </td>"
if i = 4-(jishu mod 4) then rstr=rstr & "</tr>"
next
end if
rs.close
wstr=replace(wstr,"<{{sc3}}>",rstr)
wstr=replace(wstr,"<{{classname}}>",classname)
wstr=replace(wstr,"<{{creattime}}>",now())
set fw=fso.createtextfile(server.mappath("wz/sc_" & classid & ".htm"),true)
fw.writeline wstr
fw.close
set fso=nothing
response.write "ok"
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -