📄 special_makelist.asp
字号:
<%@ LANGUAGE = VBScript.Encode %>
<%Admin="InfoMake"%>
<!--#include file="check.asp"-->
<!--#include file="mdb_path_info.asp"-->
<%
set rs=server.createobject("adodb.recordset")
set rList_info=server.CreateObject("ADODB.RecordSet")
set rList_yl=server.CreateObject("ADODB.RecordSet")
set rsm=server.createobject("adodb.recordset")
sid=request("sid")
currentPage=cint(request("page"))
MaxPerPage=cint(request("MaxPerPage"))
rs.open "select * from specialx where id="&sid,conn,1,1
MbName=rs("MbName")
imageshu=rs("imageshu")
imagelen=rs("imagelen")
imagewid=rs("imagewid")
Imagevshu=rs("Imagevshu")
imagevlen=rs("imagevlen")
imagevwid=rs("imagevwid")
newshuset=rs("newshuset")
topshu=rs("topshu")
toplen=rs("toplen")
chalen=rs("chalen")
TypePic="<img border=""0"" src="""&rs("TypePic")&""">"
TypePicmore="<img border=""0"" src="""&rs("TypePicmore")&""">"
rs.close
rsm.open "select * from mb where id="&mbname,conn,1,1
pencat=rsm("MbContent")
rsm.close
newshu=10 '每个分类显示最新文章数
search=search&"<form method=""post"" action=""../search.asp"">"
search=search&"<input name=""k"" size=""15"" style=""border: 1px dotted #42A5F7; "">"
search=search&"<select name=""kt"">"
search=search&"<option value=""../search.asp?type=title&k="""">按照标题搜索</option>"
search=search&"<option value=""../search.asp?type=info&k="""">按照内容搜索</option>"
search=search&"</select>"
search=search&"<input name=""Submit"" src=""../images/d_search.gif"" type=""image"" value=""Submit"" width=""37"" height=""21"" align=""absmiddle"" border=""0""></form>"
'################ 读取标题 等.. 开始 ################
rs.open "select * from specialx where id="&sid,conn,1,1
if not rs.eof then
ts=rs("ts")
TN=split(rs("sname"),"|")
TI=split(rs("ts"), ",")
for i = 0 to ubound(TN)-1
if i=ubound(TN)-2 and ubound(TN)>1 then
TTY_id=TI(i)
TTY_name=TN(i)
end if
all_type_top_id=TI(i)
all_type_name=TN(i)
thistype=thistype & "-> <a href=""../special/List_"&TI(i)&"_1.Html"">"&TN(i)&"</a>"
thistitle=thistitle & " - "&TN(i)&""
next
end if
rs.close
sql="select * from specialx where ts like '"&ts&"%'"
rs.open sql,conn,1,1
if not rs.eof then
do while not rs.eof
sqqq=sqqq& ""&rs("id")&", "
rs.MoveNext
loop
end if
rs.close
''########读取下级分类
rs.open "select * from specialx where tn="&sid&" order by id",conn,1,1
if NOT rs.EOF then
TTY="NO"
sname=all_type_name
do while NOT rs.EOF
TTNN=split(rs("sname"),"|")(rs("tj")-1)
TXlist=TXlist&"<a href=""../special/List_"&rs("id")&"_1.Html""><font color=""#000000"">"&TTNN&"</font></a> | "
i = i + 1
if i mod 6 =0 then
TXlist=TXlist&"<br>"
end if
rs.MoveNext
loop
end if
rs.close
if TTY_id<>"" and TTY<>"NO" then
rs.open "select * from specialx where tn="&TTY_id&" order by id",conn,1,1
if NOT rs.EOF then
sname=TTY_name
do while NOT rs.EOF
TTNN=split(rs("sname"),"|")(rs("tj")-1)
TXlist=TXlist&"<a href=""../special/List_"&rs("id")&"_1.Html""><font color=""#000000"">"&TTNN&"</font></a> | "
i = i + 1
if i mod 6 =0 then
TXlist=TXlist&"<br>"
end if
rs.MoveNext
loop
end if
rs.close
end if
'读取文章分类列表
sql="select * from specialx where tn="&sid&" order by id"
rs.open sql,conn,1,1
if NOT rs.EOF then
allshu=rs.recordcount
Dim list_1(20)
Dim list_2(20)
Dim list_3(20)
do while NOT rs.EOF
ii=ii+1
list_1(ii)="<b><a href=""List_"&rs("id")&"_1.Html""><font color=""#000000"">"&split(rs("sname"),"|")(rs("tj")-1)&"</font></a></b>"
list_2(ii)="<a href=""List_"&rs("id")&"_1.Html"">"&TypePicmore&"</a>"
i=0
sqqq_yl=""
sql_yl="select * from specialx where ts like '"&rs("ts")&"%'"
rList_yl.open sql_yl,conn,1,1
if not rList_yl.eof then
do while not rList_yl.eof
sqqq_yl=sqqq_yl& " or sid="&rList_yl("id")&""
rList_yl.MoveNext
loop
end if
rList_yl.close
rList_info.open "select id,title,date,dj from info where sid="&rs("id")&""&sqqq_yl&" order by id desc",conn,1,1
if NOT rList_info.EOF then
do while not rList_info.eof
fileming=year(rList_info("date"))&month(rList_info("date"))&day(rList_info("date"))&hour(rList_info("date"))&minute(rList_info("date"))&second(rList_info("date"))
if instr(rList_info("Title"),"<font")>0 then
chalen1=chalen+20
if len(rList_info("Title"))>chalen1 then
titlex=left(rList_info("Title"),chalen1)&"</font>"&"..."
else
titlex=rList_info("Title")&"</font>"
end if
else
if len(rList_info("Title"))>chalen then
titlex=left(rList_info("Title"),chalen)&"..."
else
titlex=rList_info("Title")
end if
end if
if rList_info("dj")=6 then
list_3(ii)=list_3(ii)&"·<a title="""&rList_info("Title")&""" target=""_blank"" href=""../Html/"&fileming&"-1.Html"">"&titlex&"</a><br>"
else
list_3(ii)=list_3(ii)&"·<a title="""&rList_info("Title")&""" target=""_blank"" href=""../Html/shownews.asp?id="&rList_info("id")&""">"&titlex&"</a><br>"
end if
i=i+1
if i>=newshu then exit do
rList_info.movenext
loop
end if
rList_info.close
rs.MoveNext
loop
end if
if allshu="" then
lxty="暂无内容!"
else
lxty=lxty&"<table border=""0"" cellspacing=""0"" style=""border-collapse: collapse"" width=""100%"" >"
if allshu<=2 then
shu=1
else
if allshu>2 then
if allshu/2-int(allshu/2)>0 then
shu=allshu/2+1
else
shu=allshu/2
end if
end if
end if
for a=1 to shu
lxty=lxty&"<tr>"
for i=1 to 2
aa=aa+1
lxty=lxty&"<td width=""286"">"&list_1(""&aa&"")&"</td>"
if i=1 then
lxty=lxty&"<td width=""5""></td>"
end if
next
lxty=lxty&"</tr><tr><td width=""286"" height=""1"" bgcolor=""#93bb00""></td><td width=""5"" height=""1""></td>"
lxty=lxty&"<td width=""286"" height=""1"" bgcolor=""#93bb00""></td></tr><tr>"
for i=1 to 2
aaa=aaa+1
lxty=lxty&"<td width=""286"" valign=""top"">"&list_3(""&aaa&"")&"<p align=""right"">"&list_2(""&aaa&"")&"</p></td>"
if i=1 then
lxty=lxty&"<td width=""5""></td>"
end if
next
lxty=lxty&"</tr>"
next
lxty=lxty&"</table>"
end if
if allshu="" then
lxtyv="暂无内容!"
else
lxtyv=lxtyv&"<table border=""0"" cellspacing=""0"" style=""border-collapse: collapse"" width=""100%"">"
for s=1 to allshu
lxtyv=lxtyv&"<tr>"
ss=ss+1
lxtyv=lxtyv&"<td width=""98%"" >"&list_1(""&ss&"")&"</td></tr><tr><td width=""98%"" height=""1"" bgcolor=""#93bb00""></td></tr><tr>"
sss=sss+1
lxtyv=lxtyv&"<td width=""98%"" valign=""top"">"&list_3(""&sss&"")&"<p align=""right"">"&list_2(""&sss&"")&"</td></tr>"
next
lxtyv=lxtyv&"</table>"
end if
rs.close
'########读取本类排行榜
sql="select * from info where sid in("&sqqq&") order by hits desc"
rs.open sql,conn,1,1
if rs.eof then
Txtop="·还没有文章"
else
do while not rs.eof
filetop=year(rs("date"))&month(rs("date"))&day(rs("date"))&hour(rs("date"))&minute(rs("date"))&second(rs("date"))
if len(rs("Title"))>toplen then
titley=left(rs("Title"),toplen)&"..."
else
titley=rs("Title")
end if
h=h+1
if rs("dj")=6 then
Txtop=Txtop&"·<a title="""&rs("Title")&""" target=""_blank"" href=""../Html/"&filetop&"-1.Html"">"&titley&"</a><br>"
else
Txtop=Txtop&"·<a title="""&rs("Title")&""" target=""_blank"" href=""../Html/shownews.asp?id="&rs("id")&""">"&titley&"</a><br>"
end if
if h>=topshu then exit do
rs.movenext
loop
h=0
end if
rs.close
'读取文章图片
i=0
sql="select * from info where sid in("&sqqq&") and pic<>'' order by date desc"
rs.open sql,conn,1,1
if rs.eof then
image="还没有图片文章"
else
do while not rs.eof
fileimg=year(rs("date"))&month(rs("date"))&day(rs("date"))&hour(rs("date"))&minute(rs("date"))&second(rs("date"))
noid=noid&" and id<>"&rs("id")&""
i=i+1
image=image&"<td valign=""top"" align=""center"" nowrap width=""129"">"
if rs("dj")=6 then
image=image&"<a target=""_blank"" href=""../Html/"&fileimg&"-1.Html"">"
else
image=image&"<a target=""_blank"" href=""../Html/shownews.asp?id="&rs("id")&""">"
end if
image=image&"<img src="""&rs("pic")&""" border=""0"" width="""&imagelen&""" height="""&imagewid&"""><br><img src=""about:blank"" border=""0"" width=""0"" height=""3""><br>"&rs("title")&"</a>"
image=image&"</td>"
if i>=imageshu then exit do
rs.movenext
loop
image="<table><tr>"&image&"</tr></table>"
end if
rs.close
p=0
sql="select * from info where sid in("&sqqq&") and pic<>'' order by date desc"
rs.open sql,conn,1,1
if rs.eof then
imagev="还没有图片文章"
else
do while not rs.eof
fileimgv=year(rs("date"))&month(rs("date"))&day(rs("date"))&hour(rs("date"))&minute(rs("date"))&second(rs("date"))
noid=noid&" and id<>"&rs("id")&""
p=p+1
if rs("dj")=6 then
imagev=imagev&"<a target=""_blank"" href=""../Html/"&fileimgv&"-1.Html"">"
else
imagev=imagev&"<a target=""_blank"" href=""../Html/shownews.asp?id="&rs("id")&""">"
end if
imagev=imagev&"<img src="""&rs("pic")&""" border=""0"" width="""&imagevlen&""" height="""&imagevwid&"""><br>"&rs("title")&"</a><br><img alt=""about:blank"" width=""0"" height=""1""><br>"
if p>=imagevshu then exit do
rs.movenext
loop
end if
rs.close
'读取文章列表
sql="select * from info where sid in("&sqqq&") order by date desc"
rs.open sql,conn,1,1
if rs.eof then
lb=lb&"对不起! 没有相关文章"
mpage=1
allshu=0
else
rs.pagesize=MaxPerPage '得到每页数
mpage=rs.pagecount '得到总页数
rs.move (currentPage-1)*MaxPerPage
allshu=rs.recordcount
h=0
do while not rs.eof
h=h+1
titlez=rs("Title")
fileming1=year(rs("date"))&month(rs("date"))&day(rs("date"))&hour(rs("date"))&minute(rs("date"))&second(rs("date"))
lb=lb&"["&year(rs("date"))&"/"&month(rs("date"))&"/"&day(rs("date"))&"]"
if rs("dj")=6 then
lb=lb&"<a href=""../Html/"&fileming1&"-1.Html"">"&titlez&"</a>"
else
lb=lb&"<a href=""../Html/shownews.asp?id="&rs("id")&""">"&titlez&"</a>"
end if
lb=lb&" <font color=""#C0C0C0"">"&rs("hits")&"</font><br>"
if h>=MaxPerPage then exit do
rs.movenext
loop
end if
rs.close
set rs=nothing
set rsm=nothing
set rList_yl=nothing
set rList_info=nothing
conn.close
set conn=nothing
'#########读取页次
lb=lb&"<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0""><tr><td width=""15%"" nowrap>页次:<b>"¤tPage&"</b>/<b>"&mpage&"</b> 每页<b>"&MaxPerPage&"</b> 文章数<b>"&allshu&"</b></td><td width=""65%"" nowrap><p align=""center"">"
pageno=currentPage
if cint(pageno)>1 then
lb=lb&"<a href=../special/List_"&sid&"_1.Html title=""首页"">"
end if
lb=lb&"<font>首页</font></a> "
if cint(pageno)>1 then
lb=lb&"<a href=../special/List_"&sid&"_"&pageno-1&".Html title=""上一页"">"
end if
lb=lb&"<font>上页</font></a>"
pp=cint(pageno)-2
if pp<1 then
pp=1
end if
lb=lb&" "
if cint(pageno)< mpage then
lb=lb&"<a href=../special/List_"&sid&"_"&pageno+1&".Html title=""下一页"">"
end if
lb=lb&"<font>下页</font></a> "
if cint(pageno)< mpage then
lb=lb&"<a href=../special/List_"&sid&"_"&mpage&".Html title=""最后一页"">"
end if
lb=lb&"<font>尾页</font></a></p></td><td width=""18%"" nowrap><table cellpadding=""0"" cellspacing=""0"">"
lb=lb&"<form onsubmit=""window.location=this.KKK2.options[this.KKK2.selectedIndex].value; return false;"">"
lb=lb&"<tr><td nowrap>到<select name=""select"" onchange=""javascript:window.location.href=this.options[this.selectedIndex].value"">"
for i=1 to mpage
selected=""
if currentpage=i then
selected=" selected"
end if
lb=lb&"<option value=../special/List_"&sid&"_"&i&".Html"&selected&">"&i&"</option>"
next
lb=lb&"</select>页</td></td></tr></form></table></td></tr></table>"
'################ 读取完成 ################
pencat=replace(pencat,"[TITLE]",thistitle)
pencat=replace(pencat,"[xoYu_NAME]",tname)
pencat=replace(pencat,"[xoYu_BJlist]",txlist)
pencat=replace(pencat,"[xoYu_BJTOP]",Txtop)
pencat=replace(pencat,"[xoYu_IMAGE]",image)
pencat=replace(pencat,"[xoYu_PIC]",imagev)
pencat=replace(pencat,"[xoYu_LIST]",lxty)
pencat=replace(pencat,"[xoYu_DANHANG]",lxtyv)
pencat=replace(pencat,"[xoYu_TYPEPIC]",TypePic)
pencat=replace(pencat,"[xoYu_SEARCH]",search)
pencat=replace(pencat,"[xoYu_LB]",lb)
pencat=replace(pencat,"[xoYu_TXT]",typetxt)
pencat=replace(pencat,"[xoYu_TYPE]",thistype)
pencat="<!--此网页由 晓宇听幽网站内容管理系统 自动生成 注册购买 http://www.xoyu.com/bbs/ -->"&pencat
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(server.mappath("../special/List_"&sid&"_"¤tPage&".Html"))
fout.Write pencat
fout.Writeline("<!--Published Date:"&Now&" Power by www.xoyu.com-->")
fout.Writeline("<!--2002~2003 Copyright by www.xoyu.com All Rights Reserved-->")
fout.close
'************** 生成HTML页 结束 ***************
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -