📄 blog.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/bloginfo.asp"-->
<!--#include file="inc/userinfo.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="inc/showcode.asp"-->
<!--#include file="inc/calendar.asp"-->
<%
dim show_subjectid,strurl
dim keyword,selecttype '搜索
keyword=ReplaceBadChar(request("keyword"))
selecttype=ReplaceBadChar(request("selecttype"))
show_subjectid=clng(request.QueryString("subjectid"))
response.Write "<meta name='description' content='"&user_blogname&"'>"& vbcrlf
response.Write "<title>"&user_blogname&"</title>" & vbcrlf
response.Write "</head>" & vbcrlf
response.Write "<body>" & vbcrlf
call usershow()
call sub_showlog(user_showlog_num)
show=replace(show,"$show_log$",show_log)
response.Write show
set rs=nothing
call bottom()
'**************************************************
'过程名:sub_showlog
'作 用:显示日志
'参 数:where 条件
'**************************************************
sub sub_showlog(num)
dim show_logcyc,show_topic,show_loginfo,show_logtext,show_more
dim show_emot,show_author,show_addtime,show_topictxt
dim rs,rssubject,sql
dim vipsee
dim cmd
dim count,pagesize,pagecount,page,temp
'=======以下为分页设置=====================
pagesize=num '每页显示多少篇日志
strurl="blog.asp?name="&show_username
sql=""
if show_subjectid>0 then
strurl="blog.asp?name="&show_username&"&subjectid="&show_subjectid
sql=" and subjectid="&show_subjectid
end if
if keyword<>"" then
select case selecttype
case "topic"
sql=" and topic like '%"&keyword&"%'"
strurl="blog.asp?name="&show_username&"&keyword="&keyword&"&selecttype="&selecttype
case "logtext"
sql=" and logtext like '%"&keyword&"%'"
strurl="blog.asp?name="&show_username&"&keyword="&keyword&"&selecttype="&selecttype
end select
end if
if selectdate<>"" then
if issqldate then
sql=" and datediff(d,'"&selectdate&"',addtime)=0"
else
sql=" and datediff('d','"&selectdate&"',addtime)=0"
end if
strurl="blog.asp?name="&show_username&"&date="&selectdate
end if
if Request.Cookies("oblog")("userlevel")=8 and vip_prosee="true" then
vipsee=true
else
vipsee=false
end if
if not (Request.Cookies("oblog")("UserName")=show_username or Request.Cookies("oblog")("userlevel")=9 or vipsee=true )then
sql=sql&" and ishide<>'true' "
end if
if issqldate then
set cmd = Server.CreateObject("ADODB.Command")
Set Cmd.ActiveConnection=conn
Cmd.CommandType=4
Cmd.CommandText="ob_user_pagecount"
Cmd("@show_username")=show_username
Cmd("@addstr")=sql
set rs=cmd.Execute
else
set rs=conn.execute("select count(id) from blog where passcheck<>'false' and username='"&show_username&"'"&sql )
end if
count=rs(0)
if (count mod pagesize)=0 then
pagecount= count \ pagesize
else
pagecount= (count \ pagesize)+1
end if
if request.querystring("page")<>"" then
page=cint(request.querystring("page"))
if page<=0 then page=1
else
page=1
end if
'===============以下为显示代码===============
if issqldate then
set cmd = Server.CreateObject("ADODB.Command")
Set Cmd.ActiveConnection=conn
Cmd.CommandType=4
Cmd.CommandText="ob_user_showlog"
Cmd("@show_username")=show_username
Cmd("@addstr")=sql
set rs=cmd.Execute
set cmd=nothing
else
set rs=conn.execute("select face,topic,subjectid,id,username,addtime,logtext,ishide,commentnum,showword,ispassword,iis,trackback,isbest,blog_password,author from blog where passcheck<>'false' and username='"&show_username&"'"&sql&" order by addtime desc")
end if
if not rs.eof then
if page <>1 then rs.move pagesize*(page-1)
for temp=1 to pagesize
if rs.eof then exit for
show_emot=""'@share "<img src=images/face/"&rs(0)&".gif >"
if isnull(rs(15)) then
if nickname<>"" then show_author=nickname else show_author=rs(4)
else
if rs(15)=rs(4) then
if nickname<>"" then show_author=nickname else show_author=rs(4)
else
dim rstmp
set rstmp=conn.execute("select nickname from [user] where username='"&rs(15)&"'")
if rstmp.eof then
show_author=rs(15)
else
if rstmp(0)<>"" then show_author=rstmp(0) else show_author=rs(15)
end if
set rstmp=nothing
end if
end if
show_addtime=rs(5)
show_topic=show_emot
if rs(2)>0 then
set rssubject=conn.execute("select id,subjectname from subject where id="&rs(2))
if not (rssubject.eof and rssubject.bof) then
show_topic=show_topic&"<a href=blog.asp?name="&rs(4)&"&subjectid="&rssubject(0)&">["&rssubject(1)&"]"
end if
end if
show_topictxt="<a href=more.asp?name="&rs(4)&"&id="&rs(3)&">"&rs(1)&"</a>"
if rs(13)="true" then
show_topictxt=show_topictxt&" <img src=images/jhinfo.gif >"
end if
show_topic=show_topic&show_topictxt
show_loginfo=show_author&" 发表于 "&show_addtime
show_more="<a href=more.asp?name="&rs(4)&"&id="&rs(3)&">阅读全文("&rs(11)&")</a>"
show_more=show_more&" | "&"<a href=more.asp?name="&rs(4)&"&id="&rs(3)&"#comment>回复("&rs(8)&")</a>"
show_more=show_more&" | "&"<a href=showtb.asp?id="&rs(3)&" target=_blank>引用("&rs(12)&")</a>"
if rs(10)<>"" and Request.Cookies("oblog")("UserName")<>rs(4) and Request.Cookies("oblog")("userlevel")<>9 and vipsee=false then
show_logtext="<div align=center><a href=more.asp?name="&rs(4)&"&id="&rs(3)&">此日志需要密码访问。</a></div>"
elseif rs(14)<>"" and Request.Cookies("oblog")("UserName")<>rs(4) and Request.Cookies("oblog")("userlevel")<>9 and vipsee=false and Request.Cookies("oblog")("blog_password")<>rs(14) then
show_logtext="<div align=center><a href=more.asp?name="&rs(4)&"&id="&rs(3)&">该blog需要密码访问。</a></div>"
else
show_logtext=filtscript(rs(6))
show_logtext=trimlog(show_logtext,rs(9))
show_logtext=filtimg(show_logtext)
if blog_profilt="true" then
show_logtext=profilthtm(show_logtext)
end if
end if
show_logcyc=replace(show_logtmp,"$show_topic$",show_topic)
show_logcyc=replace(show_logcyc,"$show_loginfo$",show_loginfo)
show_logcyc=replace(show_logcyc,"$show_logtext$",show_logtext)
show_logcyc=replace(show_logcyc,"$show_more$",show_more)
show_logcyc=replace(show_logcyc,"$show_emot$",show_emot)
show_logcyc=replace(show_logcyc,"$show_author$",show_author)
show_logcyc=replace(show_logcyc,"$show_addtime$",show_addtime)
show_logcyc=replace(show_logcyc,"$show_topictxt$",show_topictxt)
rs.movenext
show_log=show_log&show_logcyc
next
'===================分页尾部=======================
dim pagelist
dim pot,i
strurl=joinchar(strurl)
if page-1 mod 10=0 then
pot=(page-1) \ 10
else
pot=(page-1) \ 10
end if
if page=1 then
pagelist=" <font face=webdings color='red'>9</font> "
else
pagelist=" <a href='"&strurl&"page=1' title=首页><font face=webdings>9</font></a> "
end if
if pot*10>0 then pagelist=pagelist & " <a href='"&strurl&"page="&Cstr(pot*10)&"' title=上十页><font face=webdings>7</font></a> "
pagelist=pagelist & "<b>"
for i=pot*10+1 to Pot*10+10
if i=cint(Page) then
pagelist=pagelist & " <font color='red'>"+Cstr(i)+"</font> "
else
pagelist=pagelist & " <a href='"&strurl&"page="&Cstr(i)&"'>"+Cstr(i)+"</a> "
end if
if i=pagecount then exit for
next
pagelist=pagelist & "</b>"
if i<pagecount then pagelist=pagelist & " <a href='"&strurl&"page="&Cstr(i)&"' title=下十页><font face=webdings>8</font></a> "
if Page=pagecount then
pagelist=pagelist & "<font face=webdings color='red'>:</font>"
else
pagelist=pagelist & " <a href='"&strurl&"page="&Cstr(pagecount)&"' title=尾页><font face=webdings>:</font></a> "
end if
dim showpage
' showpage="页次:"&page&"/"&pagecount&" "
' showpage=showpage&"每页:"&pagesize
' showpage=showpage&" 日志数:<b>"&count&"</b>"
showpage=showpage&"<div align=center>"&pagelist&"</div>"
show_log=show_log&showpage
set rssubject=nothing
else
show_log="暂时未有任何日志!"
end if
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -