?? topiclist.asp
字號:
<!--#include file="MarcosCB.asp"-->
<%
dim i,boardId
dim str,url,page,theAct,newTopic,boardName,pageCode,pageTitle,pageOther,pageCountList
getConn()
str=getMainCode(mySkinId)
page=getPost("page")
theAct=getPost("theAct")
boardId=getPost("boardId")
boardName=getPost("boardName")
if not isNumeric(page) then
page=1
end if
if not isNumeric(boardId) and theAct<>"showNew" then
echo "錯誤的版面參數!"
closeConn()
response.End()
end if
select case theAct
case ""
url="?" & request.ServerVariables("QUERY_STRING")
pageTitle="<a href=""" & url & """>" & boardName & "</a>"
pageOther="<script>document.title+=' - " & boardName & "帖子列表';</script>"
sql="select boardId from Marcos_Board where boardId=" & boardId & " and topBoardId<>0"
set rs_sys=conn.execute(sql)
if rs_sys.eof then
echo "錯誤的版面參數!(版塊已被刪除或者此版塊是主版塊)"
closeConn()
response.end
end if
queryTimes=queryTimes+1
nowWhere "查看"&boardName&"帖子列表","topicList.asp?page="&page&"&boardId="&boardId&"&boardName="&boardName
case "showNew"
pageTitle="<a href=""javascript:location.reload();"">論壇新帖</a>"
pageOther="<script>document.title+=' - 查看最新發布的帖子';</script>"
nowWhere "查看論壇新帖","topicList.asp?theAct=showNew"
end select
showHead str,pageTitle,pageOther
select case theAct
case ""
showBody()
case "showNew"
showNew()
end select
showFoot(str)
sub showNew()
dim rs_sys
dim str,body,theBody,tableEnd,tableStart
' if getApp("pageListCode_"&mySkinId&"_"&page)<>"" then
' echo getApp("pageListCode_"&mySkinId&"_"&page)
' exit sub
' end if
pageCode=getPageCode(mySkinId,"PageList")
PageList=split(pageCode,"$$$")
sql="select top 200 * from Marcos_Topic where isRecycled=false order by lastReplyTime desc"
rs.open sql,conn,1,1
rs.pageSize=listNum
if not rs.eof then
rs.absolutePage=page
else
str="<tr height=""180""><td align=center colspan=5>本論壇暫時沒有任何帖子,歡迎發布!</td></tr>"
end if
for i=1 to 10
if i>rs.pageCount then
exit for
end if
pageCountList=pageCountList & "<a href=""?page=" & i & "&theAct=showNew""><font {$font"&i&"}>" & i & "</font></a> "
next
pageCountList=replace(pageCountList,"{$font"&page&"}","class=warningColor")
if rs.pageCount>=1 then
pageCountList=pageCountList & " 跳轉到<select name=page onChange=""this.form.submit();"">"
for i=1 to rs.pageCount
pageCountList=pageCountList & "<option value=""" & i & """ {$selected" & i & "}>第" & i & "頁</option>"
next
pageCountList=pageCountList & "</select>"
pageCountList=pageCountList & "<input type=""hidden"" name=theAct value=""showNew"">"
pageCountList=replace(pageCountList,"{$selected" & page & "}","selected")
end if
for i=1 to listNum
if rs.eof then exit for
body=PageList(1)
body=replace(body,"{$userName}",rs("userName"))
body=replace(body,"{$replyCount}",rs("replyCount"))
body=replace(body,"{$replyPageList}",getPageTwo(rs("replyCount"),rs("topicId"),rs("boardId")))
body=replace(body,"{$visitCount}",rs("visitCount"))
body=replace(body,"{$updateTime}",rs("lastReplyTime"))
str_sys=getStatusImg(rs("replyCount"))
body=replace(body,"{$statusImg}",split(str_sys,"$$$")(0))
body=replace(body,"{$statusTitle}",split(str_sys,"$$$")(1))
body=replace(body,"{$lastPostInfo}",replace(enCode(replace(replace(rs("lastPostInfo"),"$$$",vbNewLine),"@@","")),vbNewLine,"<br>"))
if len(rs("topicTitle"))<=21 then
topicTitle=enCode(rs("topicTitle"))
else
topicTitle=enCode(left(rs("topicTitle"),21) & "...")
end if
if rs("isBest")=true then
topicTitle="<font class=""warningColor"">[精華]</font>"&topicTitle
end if
if rs("isTop")=true then
topicTitle="<font class=""warningColor"">[置頂]</font>"&topicTitle
end if
body=replace(body,"{$topicTitle}",topicTitle)
body=replace(body,"{$topicLink}","topicShow.asp?boardId=" & rs("boardId") & "&topicId=" & rs("topicId"))
body=replace(body,"{$mood}"," <img src=""" & rs("topicMood") & """ border=0>")
body=replace(body,"{$updateUser}",split(split(rs("lastPostInfo"),"$$$")(0),"@@")(1))
str=str&body
rs.movenext
next
rs.close
queryTimes=queryTimes+1
echo PageList(0)
echo str
body=replace(PageList(2),"{$newTopic}",newTopic)
body=replace(body,"{$pageList}",pageCountList)
' setApp "pageListCode_"&mySkinId&"_"&page,PageList(0)&str&body
echo body
end sub
sub showBody()
dim rs_sys
dim str,body,theBody,tableEnd,tableStart
pageCode=getPageCode(mySkinId,"PageList")
PageList=split(pageCode,"$$$")
if canSetTrue(boardId) then
sql="select * from Marcos_Topic where boardId=" & boardId & " order by isRecycled desc,isTop,lastReplyTime desc"
else
sql="select * from Marcos_Topic where boardId=" & boardId & " and isRecycled=false order by isTop,lastReplyTime desc"
end if
rs.open sql,conn,1,1
rs.pageSize=listNum
if not rs.eof then
rs.absolutePage=page
else
str="<tr height=""180""><td align=center colspan=5>本版塊暫時沒有帖子,歡迎發布!</td></tr>"
end if
newTopic="<img src=""Images/{$styleRoot}/newTopic.gif""><a href=""newTopic.asp?boardId=" & boardId & "&boardName=" & boardName & """>發表新帖</a>"
for i=1 to 10
if i>rs.pageCount then
exit for
end if
pageCountList=pageCountList & "<a href=""?page=" & i & "&boardName=" & boardName & _
"&boardId=" & boardId & """><font {$font"&i&"}>" & i & "</font></a> "
next
pageCountList=replace(pageCountList,"{$font"&page&"}","class=warningColor")
if rs.pageCount>=1 then
pageCountList=pageCountList & "跳轉到<select name=page onChange=""this.form.submit();"">"
for i=1 to rs.pageCount
pageCountList=pageCountList & "<option value=""" & i & """ {$selected" & i & "}>第" & i & "頁</option>"
next
pageCountList=pageCountList & "</select>"
pageCountList=pageCountList & "<input type=""hidden"" name=boardId value=""" & boardId & """>"
pageCountList=pageCountList & "<input type=""hidden"" name=boardName value=""" & boardName & """>"
pageCountList=replace(pageCountList,"{$selected" & page & "}","selected")
end if
for i=1 to listNum
if rs.eof then exit for
body=PageList(1)
body=replace(body,"{$userName}",rs("userName"))
body=replace(body,"{$replyCount}",rs("replyCount"))
body=replace(body,"{$replyPageList}",getPageTwo(rs("replyCount"),rs("topicId"),rs("boardId")))
body=replace(body,"{$visitCount}",rs("visitCount"))
body=replace(body,"{$updateTime}",rs("lastReplyTime"))
str_sys=getStatusImg(rs("replyCount"))
body=replace(body,"{$statusImg}",split(str_sys,"$$$")(0))
body=replace(body,"{$statusTitle}",split(str_sys,"$$$")(1))
body=replace(body,"{$lastPostInfo}",replace(enCode(replace(replace(rs("lastPostInfo"),"$$$",vbNewLine),"@@","")),vbNewLine,"<br>"))
if len(rs("topicTitle"))<=21 then
topicTitle=enCode(rs("topicTitle"))
else
topicTitle=enCode(left(rs("topicTitle"),21) & "...")
end if
if rs("isRecycled")=true then
topicTitle="<font class=""warningColor"">[已回收]</font>"&topicTitle
else
if rs("isBest")=true then
topicTitle="<font class=""warningColor"">[精華]</font>"&topicTitle
end if
if rs("isTop")=true then
topicTitle="<font class=""warningColor"">[置頂]</font>"&topicTitle
end if
end if
body=replace(body,"{$topicTitle}",topicTitle)
body=replace(body,"{$topicLink}","topicShow.asp?boardId=" & boardId & "&boardName=" & boardName & "&topicId=" & rs("topicId"))
body=replace(body,"{$mood}"," <img src=""" & rs("topicMood") & """ border=0>")
body=replace(body,"{$updateUser}",split(split(rs("lastPostInfo"),"$$$")(0),"@@")(1))
str=str&body
rs.movenext
next
rs.close
queryTimes=queryTimes+1
echo PageList(0)
echo str
body=replace(PageList(2),"{$newTopic}",newTopic)
body=replace(body,"{$pageList}",pageCountList)
echo body
end sub
closeConn()
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -