📄 func_info.asp
字号:
end if
end if
end if
rsArticle.close
set rsArticle=nothing
end sub
'=================================================
'过程名:ShowSearchResult
'作 用:分页显示搜索结果
'参 数:无
'=================================================
sub ShowSearchResult()
dim arrClassID,trs
sqlSearch=sqlSearch & "select A.ArticleID,A.ClassID,L.LayoutID,L.LayoutFileName,A.Title,A.Key,A.Author,A.CopyFrom,A.UpdateTime,A.Editor,A.TitleFontColor,A.TitleFontType,A.Content,"
sqlSearch=sqlSearch & "A.Hits,A.OnTop,A.Hot,A.Elite,A.Passed,A.IncludePic,A.Stars,A.PaginationType,A.ReadLevel,A.ReadPoint,A.DefaultPicUrl from Article A"
sqlSearch=sqlSearch & " inner join Layout L on A.LayoutID=L.LayoutID where A.Deleted=False and A.Passed=True"
if ClassID>0 then
if Child>0 then
arrClassID=ClassID
if ParentID>0 then
set trs=conn.execute("select ClassID from ArticleClass where ParentID=" & ClassID & " or ParentPath like '%" & ParentPath & "," & ClassID & ",%' and Child=0 and LinkUrl='' and BrowsePurview>=" & UserLevel)
else
set trs=conn.execute("select ClassID from ArticleClass where RootID=" & RootID & " and Child=0 and LinkUrl='' and BrowsePurview>=" & UserLevel)
end if
do while not trs.eof
arrClassID=arrClassID & "," & trs(0)
trs.movenext
loop
set trs=nothing
sqlSearch=sqlSearch & " and A.ClassID in (" & arrClassID & ")"
else
sqlSearch=sqlSearch & " and A.ClassID=" & ClassID
end if
end if
if keyword<>"" then
select case strField
case "Title"
sqlSearch=sqlSearch & " and A.Title like '%" & keyword & "%' "
case "Content"
sqlSearch=sqlSearch & " and A.Content like '%" & keyword & "%' "
case "Author"
sqlSearch=sqlSearch & " and A.Author like '%" & keyword & "%' "
case "Editor"
sqlSearch=sqlSearch & " and A.Editor like '%" & keyword & "%' "
case else
sqlSearch=sqlSearch & " and A.Title like '%" & keyword & "%' "
end select
end if
sqlSearch=sqlSearch & " order by A.Articleid desc"
Set rsSearch= Server.CreateObject("ADODB.Recordset")
rsSearch.open sqlSearch,conn,1,1
if rsSearch.eof and rsSearch.bof then
totalput=0
response.write "<p align='center'><br><br>没有或没有找到任何文章</p>"
else
totalput=rsSearch.recordcount
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
call SearchResultContent()
else
if (currentPage-1)*MaxPerPage<totalPut then
rsSearch.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rsSearch.bookmark
call SearchResultContent()
else
currentPage=1
call SearchResultContent()
end if
end if
end if
rsSearch.close
set rsSearch=nothing
end sub
sub SearchResultContent()
dim i,strTemp,content
i=1
do while not rsSearch.eof
strTemp=""
strTemp=strTemp & cstr(MaxPerPage*(CurrentPage-1)+i) & ".<a href='" & rsSearch("LayoutFileName") & "?ArticleID=" & rsSearch("articleid") & "' target='_blank'>"
if strField="Title" then
strTemp=strTemp & "<b>" & replace(rsSearch("title"),""&keyword&"","<font color=red>"&keyword&"</font>") & "</b></font></a>"
else
strTemp=strTemp & "<b>" & rsSearch("title") & "</b>"
end if
if strField="Author" then
strTemp=strTemp & " [" & replace(rsSearch("Author"),""&keyword&"","<font color=red>"&keyword&"</font>") & "]"
else
strTemp=strTemp & " [" & rsSearch("Author") & "]"
end if
strTemp=strTemp & "[" & FormatDateTime(rsSearch("UpdateTime"),1) & "][" & rsSearch("Hits") & "]"
content=left(replace(replace(nohtml(rsSearch("content")), ">", ">"), "<", "<"),200)
if strField="Content" then
strTemp=strTemp & "<div style='padding:10px 20px'>" & replace(content,""&keyword&"","<font color=red>"&keyword&"</font>") & "...</div>"
else
strTemp=strTemp & "<div style='padding:10px 20px'>" & content & "...</div>"
end if
strTemp=strTemp & "</a>"
response.write strTemp
i=i+1
if i>MaxPerPage then exit do
rsSearch.movenext
loop
end sub
'=================================================
'过程名:ShowNewArticle
'作 用:显示最新文章
'参 数:ArticleNum ----最多显示多少篇文章
' TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowNewArticle(ArticleNum,TitleLen)
dim sqlNew,rsNew
if ArticleNum>0 and ArticleNum<=100 then
sqlNew="select top " & ArticleNum
else
sqlNew="select top 10 "
end if
sqlNew=sqlNew & " A.ArticleID,A.Title,A.Author,A.UpdateTime,A.Hits,L.LayoutFileName from article A inner join Layout L on L.LayoutID=A.LayoutID where A.Deleted=False and A.Passed=True order by A.articleid desc"
Set rsNew= Server.CreateObject("ADODB.Recordset")
rsNew.open sqlNew,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=50
if rsNew.bof and rsNew.eof then
response.write "<img src='skin/1/xiao.gif'>没有文章"
else
do while not rsNew.eof
'--------------------------------稿纸效果修改开始--------贫龙
response.write "<table border=0 width='100%' cellspacing=0 cellpadding=1 ><tr><td>"
response.write "<img src='images/article_common.gif'><a href='" & rsNew("LayoutFileName") & "?ArticleID=" & rsNew("articleid") &"' title='标题:" & rsNew("Title") & vbcrlf & "作者:" & rsNew("Author") & vbcrlf & "时间:" & rsNew("UpdateTime") & vbcrlf & "点击:" & rsNew("Hits") & "' target='_blank'>" & gotTopic(rsNew("title"),TitleLen) & "</a>"
if datediff("d",rsNew("UpdateTime"),date())<2 then
response.write("</td><td align='right' nowrap style='width:1%x'><font color=red>" & month(rsnew("updateTime")) & "-" & day(rsnew("updateTime")) & "</font>")
else
response.write("</td><td align='right' nowrap style='width:1%'><font color=#999999>" & month(rsnew("updateTime")) & "-" & day(rsnew("updateTime")) & "</font>")
end if
response.write "</td></tr><tr><td colspan='2'><table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td height=1 background='images/bg_dian.gif'></td></tr></table></td></tr></table>" 'CSS定义虚线,放在table下 style='height:1; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #cccccc'
'--------------------------------稿纸效果修改结束--------贫龙
rsNew.movenext
loop
end if
rsNew.close
set rsNew=nothing
end sub
'=================================================
'过程名:ShowHot
'作 用:显示热门文章
'参 数:ArticleNum ----最多显示多少篇文章
' TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowHot(ArticleNum,TitleLen)
dim sqlHot,rsHot
if ArticleNum>0 and ArticleNum<=100 then
sqlHot="select top " & ArticleNum
else
sqlHot="select top 10 "
end if
sqlHot=sqlHot & " A.ArticleID,A.Title,A.Author,A.UpdateTime,A.Hits,L.LayoutFileName from article A inner join Layout L on L.LayoutID=A.LayoutID where A.Deleted=False and A.Passed=True And A.Hits>=" & HitsOfHot & " order by A.ArticleID desc"
Set rsHot= Server.CreateObject("ADODB.Recordset")
rsHot.open sqlHot,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=50
if rsHot.bof and rsHot.eof then
response.write "<img src='skin/1/xiao.gif'>无热门文章"
else
do while not rsHot.eof
'--------------------------------稿纸效果修改开始--------贫龙
response.write "<table border=0 width='100%' cellspacing=0 cellpadding=1><tr><td>"
response.Write "<img src='skin/1/xiao.gif'><a href='" & rsHot("LayoutFileName") & "?ArticleID=" & rsHot("articleid") &"' title='文章标题:" & rsHot("Title") & vbcrlf & "作 者:" & rsHot("Author") & vbcrlf & "更新时间:" & rsHot("UpdateTime") & vbcrlf & "点击次数:" & rsHot("Hits") & "' target='_blank'>" & gotTopic(rsHot("title"),TitleLen) & "</a>"
' response.Write "[<font color=red>" & rsHot("hits") & "</font>]"
response.write "<br></td></tr><tr><td><table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td height=1 background='images/bg_dian.gif'></td></tr></table></td></tr></table>"
'--------------------------------稿纸效果修改结束--------贫龙
rsHot.movenext
loop
end if
rsHot.close
set rsHot=nothing
end sub
'=================================================
'过程名:ShowElite
'作 用:显示推荐文章
'参 数:ArticleNum ----最多显示多少篇文章
' TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowElite(ArticleNum,TitleLen)
dim sqlElite,rsElite
if ArticleNum>0 and ArticleNum<=100 then
sqlElite="select top " & ArticleNum
else
sqlElite="select top 10 "
end if
sqlElite=sqlElite & " A.ArticleID,A.Title,A.Author,A.UpdateTime,A.Hits,L.LayoutFileName from article A inner join Layout L on L.LayoutID=A.LayoutID where A.Deleted=False and A.Passed=True And A.Elite=True order by A.articleid desc"
Set rsElite= Server.CreateObject("ADODB.Recordset")
rsElite.open sqlElite,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=50
if rsElite.bof and rsElite.eof then
response.write "<img src='skin/1/xiao.gif'>无推荐文章"
else
do while not rsElite.eof
'--------------------------------稿纸效果修改开始--------贫龙
response.write "<table border=0 width='100%' cellspacing=0 cellpadding=1><tr><td>"
response.Write "<img src='skin/1/xiao.gif'><a href='" & rsElite("LayoutFileName") & "?ArticleID=" & rsElite("articleid") &"' title='文章标题:" & rsElite("Title") & vbcrlf & "作 者:" & rsElite("Author") & vbcrlf & "更新时间:" & rsElite("UpdateTime") & vbcrlf & "点击次数:" & rsElite("Hits") & "' target='_blank'>" & gotTopic(rsElite("title"),TitleLen) & "</a>"
' response.Write "<font color=#999999>[" & rsElite("hits") & "]</font>"
response.write "<br></td></tr><tr><td><table width='100%' align='center' border=0 cellspacing=0 cellpadding=0><tr><td height=1 background='images/bg_dian.gif'></td></tr></table></td></tr></table>"
'--------------------------------稿纸效果修改结束--------贫龙
rsElite.movenext
loop
end if
rsElite.close
set rsElite=nothing
end sub
'=================================================
'过程名:ShowCorrelative
'作 用:显示相关文章
'参 数:ArticleNum ----最多显示多少篇文章
' TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowCorrelative(ArticleNum,TitleLen)
dim rsCorrelative,sqlCorrelative
dim strKey,arrKey,i
if ArticleNum>0 and ArticleNum<=100 then
sqlCorrelative="select top " & ArticleNum
else
sqlCorrelative="Select Top 5 "
end if
strKey=mid(rs("Key"),2,len(rs("Key"))-2)
if instr(strkey,"|")>1 then
arrKey=split(strKey,"|")
strKey="((A.Key like '%|" & arrKey(0) & "|%')"
for i=1 to ubound(arrKey)
strKey=strKey & " or (A.Key like '%|" & arrKey(i) & "|%')"
next
strKey=strKey & ")"
else
strKey="(A.Key like '%|" & strKey & "|%')"
end if
sqlCorrelative=sqlCorrelative & " A.ArticleID,A.Title,A.Author,A.UpdateTime,A.Hits,L.LayoutFileName From Article A inner join Layout L on L.LayoutID=A.LayoutID Where A.Deleted=False and A.Passed=True and " & strKey & " and A.ArticleID<>" & ArticleID & " Order by A.ArticleID desc"
Set rsCorrelative= Server.CreateObject("ADODB.Recordset")
rsCorrelative.open sqlCorrelative,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=50
if rsCorrelative.bof and rsCorrelative.Eof then
response.write "<img src='skin/1/xiao.gif'>没有相关文章"
else
do while not rsCorrelative.eof
'--------------------------------稿纸效果修改开始--------贫龙
response.write "<table border=0 width='100%' cellspacing=0 cellpadding=1><tr><td>"
response.write "<img src='skin/1/xiao.gif'><a href='" & rsCorrelative("LayoutFileName") & "?ArticleID=" & rsCorrelative("ArticleID") & "' title='文章标题:" & rsCorrelative("Title") & vbcrlf & "作 者:" & rsCorrelative("Author") & vbcrlf & "更新时间:" & rsCorrelative("UpdateTime") & vbcrlf & "点击次数:" & rsCorrelative("Hits") & "'>" & gotTopic(rsCorrelative("Title"),TitleLen) & "</a><br>"
response.write "</td></tr><tr><td><table width='95%'align='center' border=0 cellspacing=0 cellpadding=0><tr><td height=1 background='images/bg_dian.gif'></td></tr></table></td></tr></table>"
'--------------------------------稿纸效果修改结束--------贫龙
rsCorrelative.movenext
loop
end if
rsCorrelative.close
set rsCorrelative=nothing
end sub
'=================================================
'过程名:ShowComment
'作 用:显示相关评论
'参 数:CommentNum ----最多显示多少个评论
'=================================================
sub ShowComment(CommentNum)
dim rsComment,sqlComment,rsCommentUser
if CommentNum>0 and CommentNum<=100 then
sqlComment="select top " & CommentNum
else
sqlComment="select top 10 "
end if
sqlComment=sqlComment & " * from ArticleComment where ArticleID=" & ArticleID & " order by CommentID desc"
Set rsComment= Server.CreateObject("ADODB.Recordset")
rsComment.open sqlComment,conn,1,1
if rsComment.bof and rsComment.eof then
response.write " 没有任何评论"
else
response.write "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
do while not rsComment.eof
response.write "<tr><td width='70%'>"
if rsComment("UserType")=1 then
response.write "<li>会员"
set rsCommentUser=Conn_User.execute("select " & db_User_ID & "," & db_User_Name & "," & db_User_Email & "," & db_User_QQ & "," & db_User_Homepage & " from " & db_User_Table & " where " & db_User_Name & "='" & rsComment("UserName") & "'")
if rsCommentUser.bof and rsCommentUser.eof then
response.write rsComment("UserName")
else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -