📄 list.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/bloginfo.asp"-->
<!--#include file="inc/syscode.asp"-->
<!--#include file="inc/function.asp"-->
<%
response.Write "<title>"&sitetitle&"</title>"
dim show
dim mainsql,classid,strurl
dim keyword,selecttype
classid=clng(request.QueryString("classid"))
keyword=ReplaceBadChar(request("keyword"))
selecttype=ReplaceBadChar(request("selecttype"))
call sysshow()
strurl="list.asp"
if classid<>0 then
mainsql=" and classid="&classid
strurl="list.asp?classid="&classid
end if
if keyword<>"" then
select case selecttype
case "topic"
mainsql=" and topic like '%"&keyword&"%'"
strurl="list.asp?keyword="&keyword&"&selecttype="&selecttype
case "logtext"
mainsql=" and logtext like '%"&keyword&"%'"
strurl="list.asp?keyword="&keyword&"&selecttype="&selecttype
case "id"
mainsql=" and username like '%"&keyword&"%'"
strurl="list.asp?keyword="&keyword&"&selecttype="&selecttype
end select
end if
call sub_showlist(mainsql,strurl)
show=replace(show,"$show_list$",show_list)
response.Write show
call bottom()
sub sub_showlist(sql,strurl)
dim topn
dim msql
MaxPerPage=show_log_num
strFileName=strurl
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
topn=Application(cachename&"info")(12)
msql="select top "&topn&" blog.topic,blog.username,blog.addtime,blog.commentnum,blog.id,classname.classname"
msql=msql&",classname.id from blog,classname "
msql=msql&"where blog.classid=classname.id"&sql
if issqldate then
msql=msql&" and ishide<>'true' and passcheck<>'false' and (isnull(blog_password,'true')='true' or blog_password='')"
else
msql=msql&" and ishide<>'true' and passcheck<>'false' and (isnull(blog_password)=true or blog_password='')"
end if
msql=msql&" order by blog.id desc"
Set rsmain=Server.CreateObject("Adodb.RecordSet")
rsmain.Open msql,Conn,1,1
if rsmain.eof and rsmain.bof then
show_list=show_list & "共调用0篇日志<br>"
else
totalPut=rsmain.recordcount
show_list=show_list & "共调用" & totalPut & " 篇日志<br>"
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
getlist()
show_list=show_list&fshowpage(strFileName,totalput,MaxPerPage,false,true,"篇日志")
else
if (currentPage-1)*MaxPerPage<totalPut then
rsmain.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rsmain.bookmark
getlist()
show_list=show_list&fshowpage(strFileName,totalput,MaxPerPage,false,true,"篇日志")
else
currentPage=1
getlist()
show_list=show_list&fshowpage(strFileName,totalput,MaxPerPage,false,true,"篇日志")
end if
end if
end if
rsmain.Close
set rsmain=Nothing
end sub
sub getlist()
dim i,strtopic,userurl
if keyword="" then
if classid<>0 then
show_list="当前位置:<a href='index.asp'>首页</a>→日志类别("&rsmain(5)&")<hr noshade>"
else
show_list="当前位置:<a href='index.asp'>首页</a>→日志列表(所有类别)<hr noshade>"
end if
else
select case selecttype
case "topic"
show_list="当前位置:<a href='index.asp'>首页</a>→搜索日志标题关键字“"&keyword&"”<hr noshade>"
case "logtext"
show_list="当前位置:<a href='index.asp'>首页</a>→搜索日志内容关键字“"&keyword&"”<hr noshade>"
case "id"
show_list="当前位置:<a href='index.asp'>首页</a>→搜索博客名称关键字“"&keyword&"”<hr noshade>"
case else
show_list="当前位置:<a href='index.asp'>首页</a>→搜索关键字“"&keyword&"”<hr noshade>"
end select
end if
show_list=show_list&"<table width='100%' border='0'>"
show_list=show_list&"<td><strong>blog标题</strong></td><td width='100' align='center'><strong>来自于</strong></td><td width='60' align='center'><strong>发表日期</strong></td><td width='40' align='center'><strong>评论</strong></td>"
do while not rsmain.eof
strtopic=htmlencode(rsmain(0))
if strLength(strtopic)>40 then
strtopic=InterceptString(strtopic,37)&"..."
end if
if Application(cachename&"info")(32)="true" then
userurl="http://"&trim(rsmain(1))&"."&trim(Application(cachename&"info")(6))
else
userurl="blog.asp?name="&trim(rsmain(1))
end if
show_list=show_list&"<tr><td><a href=more.asp?name="&rsmain(1)&"&id="&rsmain(4)&" title="&htmlencode(rsmain(0))&" target=_blank>"&strtopic&"</a></td>"
show_list=show_list&"<td align='center'><a href="&userurl&" target=_blank>"&rsmain(1)&"</a></td>"
show_list=show_list&"<td align='center'>"&mid(formatdatetime(rsmain(2),2),6)&"</td>"
show_list=show_list&"<td align='center'>"&rsmain(3)&"</td></tr>"
rsmain.movenext
i=i+1
if i>=MaxPerPage then exit do
loop
show_list=show_list&"</table>"
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -