📄 syscode.asp
字号:
response.Write("<br><li>没有任何文章</li>")
else
totalput=rsArticle.recordcount
if totalput=1 then
response.Redirect "InforMation_Article.asp?ArticleID="&rsArticle("ArticleID")
response.end()
end if
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 ArticleContent(TitleLen,True,True,True,2,True,True,0)
else
if (currentPage-1)*MaxPerPage<totalPut then
rsArticle.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rsArticle.bookmark
call ArticleContent(TitleLen,True,True,True,2,True,True,0)
else
currentPage=1
call ArticleContent(TitleLen,True,True,True,2,True,True,0)
end if
end if
end if
rsArticle.close
set rsArticle=nothing
end sub
'=================================================
'过程名:ArticleContent
'作 用:显示文章属性、标题、作者、更新日期、点击数等信息
'参 数:intTitleLen ----标题最多字符数,一个汉字=两个英文字符
' ShowProperty ----是否显示文章属性(固顶/推荐/普通),True为显示,False为不显示
' ShowIncludePic ---是否显示“[图文]”字样,True为显示,False为不显示
' ShowAuthor -------是否显示文章作者,True为显示,False为不显示
' ShowDateType -----显示更新日期的样式,0为不显示,1为显示年月日,2为只显示月日。
' ShowHits ---------是否显示文章点击数,True为显示,False为不显示
' ShowHot ----------是否显示热门文章标志,True为显示,False为不显示
'=================================================
sub ArticleContent(intTitleLen,ShowProperty,ShowIncludePic,ShowAuthor,ShowDateType,ShowHits,ShowHot,style1)
dim i,strTemp,TitleStr,Author,AuthorName,AuthorEmail
i=0
response.write "<table border=0 align=center width='100%' cellpadding=0 cellspacing=0>"
do while not rsArticle.eof
response.write "<tr width=5><td height=20>"
strTemp=""
strTemp = strTemp & "<img src='images/article_common.gif' alt='普通文章'> "
if ShowIncludePic=True and rsArticle("IncludePic")=true then
strTemp = strTemp & "<font color=blue>[图文]</font>"
end if
Author=rsArticle("Author")
if instr(Author,"|")>0 then
AuthorName=left(Author,instr(Author,"|")-1)
AuthorEmail=right(Author,len(Author)-instr(Author,"|")-1)
else
AuthorName=Author
AuthorEmail=""
end if
if style1=1 then
strTemp = strTemp & "<a class='Html_Informa_Class' target='_blank' href='ShowArticle1.asp?ArticleID="& rsArticle("articleid") &"'>"
else
strTemp = strTemp & "<a class='Html_Informa_Class' href='ShowArticle.asp?ArticleID=" & rsArticle("articleid") & "' title='文章标题:" & rsArticle("Title") & vbcrlf & "作 者:" & AuthorName & vbcrlf & "更新时间:" & rsArticle("UpdateTime") & vbcrlf & "点击次数:" & rsArticle("Hits") & "' target='_blank'>"
end if
TitleStr=gotTopic(rsArticle("title"),intTitleLen)
if rsArticle("TitleFontType")=1 then
TitleStr="<b>" & TitleStr & "</b>"
elseif rsArticle("TitleFontType")=2 then
TitleStr="<em>" & TitleStr & "</em>"
elseif rsArticle("TitleFontType")=3 then
TitleStr="<b><em>" & TitleStr & "</em></b>"
end if
if rsArticle("TitleFontColor")<>"" then
TitleStr="<font color='" & rsArticle("TitleFontColor") & "'>" & TitleStr & "</font>"
end if
TitleStr="" & TitleStr & ""'<font color='#000000'></font>
strTemp=strTemp & TitleStr & "</a>"
if ShowAuthor=True or ShowDateType>0 or ShowHits=True then
strTemp = strTemp & " "
end if
if ShowHot=True and (now-rsArticle("UpdateTime"))<7 then '
strTemp= strTemp & "<img src='images/hot.gif' alt='热点文章'>"
end if
strTemp= strTemp & " </td>"
if News_ID=14 and style1=0 then
strTemp= strTemp & "<td align=right>["& FormatDateTime(rsArticle("UpdateTime"),2) & "]</td>"
end if
strTemp= strTemp & "</tr>"
response.write strTemp
rsArticle.movenext
i=i+1
if i>=MaxPerPage then exit do
loop
%>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<%
response.write "</table>"
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
set trs=conn.execute("select ClassID from ArticleClass where ParentID=" & ClassID & " or ParentPath like '%" & ParentPath & "," & ClassID & ",%' and Child=0 and LinkUrl='' and BrowsePurview>=" & UserLevel)
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") & "'>"
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(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
'=================================================
'过程名:ShowAnnounce
'作 用:显示本站公告信息
'参 数:ShowType ------显示方式,1为纵向,2为横向
' AnnounceNum ----最多显示多少条公告
'=================================================
sub ShowAnnounce(ShowType,AnnounceNum)
dim sqlAnnounce,rsAnnounce,i
if AnnounceNum>0 and AnnounceNum<=10 then
sqlAnnounce="select top " & AnnounceNum
else
sqlAnnounce="select top 10"
end if
sqlAnnounce=sqlAnnounce & " * from Announce where IsSelected=True order by ID Desc"
Set rsAnnounce= Server.CreateObject("ADODB.Recordset")
rsAnnounce.open sqlAnnounce,conn,1,1
if rsAnnounce.bof and rsAnnounce.eof then
AnnounceCount=0
response.write "<p> 没有通告</p>"
else
AnnounceCount=rsAnnounce.recordcount
if ShowType=1 then
do while not rsAnnounce.eof
response.Write "<a href='Announce.asp?ID=" & rsAnnounce("id") &"' title='" & rsAnnounce("Content") & "' target=_Blank> " & rsAnnounce("title") & "</div><div align='right'>" & rsAnnounce("Author") & " <br>" & FormatDateTime(rsAnnounce("DateAndTime"),1) & "</a> "
rsAnnounce.movenext
loop
else
do while not rsAnnounce.eof
response.Write "<p><a href='Announce.asp?ID=" & rsAnnounce("id") &"' title='" & rsAnnounce("Content") & "' target=_Blank> " & rsAnnounce("title") & " [" & rsAnnounce("Author") & " " & FormatDateTime(rsAnnounce("DateAndTime"),1) & "]</a></p>"
rsAnnounce.movenext
i=i+1
if i<AnnounceCount then response.write "<hr>"
loop
end if
end if
rsAnnounce.close
set rsAnnounce=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,A.Hot from article A inner join Layout L on L.LayoutID=A.LayoutID where A.Deleted=False and A.ClassID="&noshowid&" order by A.UpdateTime 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 "·暂无此类信息!"
else
do while not rsHot.eof
response.Write " <img src='images/tb.jpg'> <a class='Default_Class' target='_blank' href='ShowArticle1.asp?ArticleID=" & rsHot("articleid") &"')>" & gotTopic(rsHot("title"),TitleLen) & "</a>"'<font color=#000000></font>
if rsHot("Hot")=True and (now-rsHot("UpdateTime"))<7 then '
response.write " <img src='images/hot.gif' alt='热点文章'>"
end if
response.write "["&formatdatetime(rsHot("UpdateTime"),2)&"]"
response.write "<br>"
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,A.Hot 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.UpdateTime desc"
Set rsElite= Server.CreateObject("ADODB.Recordset")
rsElite.open sqlElite,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=50
response.write "<table width='95%' border=0 cellspacing=2 cellpadding=0>"
if rsElite.bof and rsElite.eof then
response.write "<li>无推荐文章</li>"
else
do while not rsElite.eof
response.Write "<tr><td height=15>◎</td><td class=title_righttxt> <a target='_blank' href='ShowArticle1.asp?ArticleID="&rsElite("articleid") &"' style=cursor:hand><font color=#000000>" & gotTopic(rsElite("title"),TitleLen) & "</font>"
if rsElite("Hot")=True and (now-rsElite("UpdateTime"))<7 then '
response.write "<img src='images/hot.gif' alt='热点文章' border=0>"
end if
response.write "</a></td><td align=right class=title_righttxt> [<font color=#000000>" & FormatDateTime(rsElite("UpdateTime"),2) & "</font>]</td></tr>"
rsElite.movenext
loop
end if
'response.write "<tr><td align=right colspan=3 class=title_righttxt><a href=showElite.asp><font color=#000000>更多>></font></a></td></tr>"
response.write "</table>"
rsElite.close
set rsElite=nothing
%>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow1(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<%
end sub
'=================================================
'过程名:ShowPrevArticle
'作 用:显示上一篇文章
'参 数:TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowPrevArticle(TitleLen)
dim rsPrev,sqlPrev
sqlPrev="Select Top 1 A.ArticleID,A.Title,A.Author,A.UpdateTime,A.Hits,L.LayoutFileName From Article A inner join Layout L on A.LayoutID=L.LayoutID Where Deleted=False and Passed=True and ClassID=" & rs("ClassID") & " and ArticleID<" & rs("ArticleID")& " order by ArticleID DESC"
Set rsPrev= Server.CreateObject("ADODB.Recordset")
rsPrev.open sqlPrev,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=50
if rsPrev.Eof then
response.write "暂无"
else
response.write "<a href='" & strFileName & "?ArticleID=" & rsPrev("ArticleID")& "' title='文章标题:" & rsPrev("Title") & vbcrlf & "作 者:" & rsPrev("Author") & vbcrlf & "更新时间:" & rsPrev("UpdateTime") & vbcrlf & "点击次数:" & rsPrev("Hits") &"'>" & gotTopic(rsPrev("Title"),TitleLen) & "</a>"
end if
rsPrev.close
set rsPrev=nothing
end sub
'=================================================
'过程名:ShowNextArticle
'作 用:显示上一篇文章
'参 数:TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowNextArticle(TitleLen)
dim rsNext,sqlNext
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -