⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default.asp

📁 教师评估系统
💻 ASP
字号:
<!-- #include file="../Cls.asp" -->
<%
Dim NoID
RequestStr=Request.QueryString
if (Instr(RequestStr,".htm")<1 And RequestStr<>Empty) Or RequestStr=".htm" then Error("非法提交参数")
ID=ChkNumeric(ReplaceText(RequestStr,"[A-Za-z+-."&chr(34)&"-"&chr(39)&"]",""))
Way=Left(RequestStr,2)
Select case Way
case "t-"
 if ID>0 Then
  sql="select Topic,Replies,Views,IsDel,ForumID,Tags,PostsTableName from [WxThreads] where id="&ID&""
  Rs.Open sql,Conn,1,3
  if Rs.Eof Then Error("该主题不存在")
  ThreadID=ID
  Topic=ReplaceText(Rs(0),"<[^>]*>","")
  Replies=Rs(1)
  Rs(2)=Rs(2)+1
  Rs.update
  Views=Rs(2)
  IsDel=Rs(3)
  ForumID=Rs(4)
  Tags=Rs(5)
  PostsTableName=Rs(6)
  Rs.Close
  %><!-- #include file="../Inc/ForumPermissions.asp" --><%
  if PermissionsRead=0 then Error("您没有阅读主题的权限")
  if IsDel=1 and PermissionsManage=0 then Error("该主题已被删除")
  Set Rs=Conn.Execute("select ForumName from [WxForums] where id="&ForumID&"")
  if Rs.Eof Then Error("该版块不存在")
  ForumName=Rs(0)
  Rs.Close
  NoID=1
  DispTitle()
  DispThreads(ID)
 Else
  Error("非法提交参数")
 end if
case "f-"
 if ID>0 Then
  Set Rs=Conn.Execute("select ForumName from [WxForums] where ID="&ID&"")
  if Rs.Eof Then Error("该版块不存在")
  ForumID=ID
  ForumName=Rs(0)
  Rs.Close
  DispTitle()
  %><ol>
  <%DispThreadsList(ID)%></ol>
  <%
 end if
case Else
 DispTitle()
 DispDefault(0)
 PageEnd()
end Select

sub DispTitle()
if Topic<>"" Then TopicTitle=Topic&" - "
if ForumName<>"" Then ForumTitle=ForumName&" - "
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="Archiver.css" rel="stylesheet" />
<title><%=TopicTitle&ForumTitle&Cache("SiteName")%></title>
</head>

<body>
<h1>
<a href="<%=Cache("SiteUrl")%>Archiver/"><%=Cache("SiteName")%></a>
<%if ForumName<>"" Then%> &raquo; <a href="?f-<%=ForumID%>.htm"><%=ForumName%></a><%end if%>
<%if Topic<>"" Then%> &raquo; <a href="?t-<%=ThreadID%>.htm"><%=Topic%></a><%end if%>
</h1>
<%
if NoID<>1 Then Response.write "<div id=""body"">"
end sub

sub DispDefault(ParentID)
ForumList=CacheRowsList("Archiver_Forum"&ParentID,"select ID,ForumName from [WxForums] where ParentID="&ParentID&" order By SortNum Asc",600)
if IsArray(ForumList) Then
For i=0 To UBound(ForumList,2)
ForumID=ForumList(0,i)
ForumName=ForumList(1,i)
if Not Conn.Execute("select top 1 ID from [WxForums] where ParentID="&ForumID).Eof Then
 Response.write "<ul>"&vbcrlf&"<li><h4>"&ForumName&"</h4><ul>"&vbcrlf
 DispDefault(ForumID)
 Response.write "</ul></li></ul>"&vbcrlf
Else
 Response.write "<li><a href=""?f-"&ForumID&".htm"">"&ForumName&"</a></li>"&vbcrlf
 DispDefault(ForumID)
end if
Next
end if
end sub

sub DispThreadsList(ForumID)
ThreadsList=CacheRowsList("Archiver_DispThreadsList"&ForumID,"select ID,Topic,UserName from [WxThreads] where ForumID="&ForumID&" order by PostTime desc",600)
if IsArray(ThreadsList) Then
For i=0 To UBound(ThreadsList,2)
ThreadID=ThreadsList(0,i)
Topic=ThreadsList(1,i)
UserName=ThreadsList(2,i)
%><li><a href="?t-<%=ThreadID%>.htm"><%=Topic%> (by <%=UserName%>) </a><a href="<%=Cache("SiteUrl")&"Threads.asp?Tid="&ThreadID%>">[full]</a></li><%
Next
end if
PageEnd()
end sub

sub DispThreads(ThreadID)
TotalCount=Replies+1
PageSetup=Cache("PostsPerPage") '设定每页的显示数量
TotalPage=Abs(Int(TotalCount/PageSetup*(-1))) '总页数
PageCount = cint(Request.QueryString("PageIndex")) '获取当前页
if PageCount <1 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage
sql="select * from [WxPosts"&PostsTableName&"] where ThreadID="&ThreadID&" order by Posttime"
if PageCount<11 then
Set Rs=Conn.Execute(sql)
else
rs.Open sql,Conn,1
end if
if Rs.Eof then Error("该主题不存在")
if TotalPage>1 then Rs.Move (PageCount-1) * pagesetup
'On Error Resume Next
Do while Not Rs.Eof%>
<div class="body">
<div class="nav"><b><%=Rs("Username")%></b> <%=Rs("PostTime")%></div>
<div class="cell"><%=ReplaceText(""&Rs("Content")&"","\[(postjb|postjy|postwz|postml|postww|postmoney|retopic|postfact|postme|postdj)[^]]*\].*\[\/[^]]*\]","<hr noshade size=1><font color=red>此帖为特殊帖,请根据要求登录查看!</font><br /><hr noshade size=1>")%></div>
</div><%
Rs.MoveNext
Loop
Rs.Close
%><div class="body">
<div class="cell">文章标签:<%
if Instr(Tags," ")>0 Then
Lists=split(Tags," ")
 for i=0 to ubound(Lists)
 Response.write "<a target=_blank href='http://www.baidu.com/s?tn=wxskycn_pg&word="&Lists(i)&"'>"&Lists(i)&"</a> "
 next
Else
Response.write "<a target=_blank href='http://www.baidu.com/s?tn=wxskycn_pg&word="&Tags&"'>"&Tags&"</a>"
end if%><br />本帖共有 阅读 <%=Views%> 次 | 回复 <%=Replies%> 篇</div></div>
<%
PageEnd()
end sub

sub PageEnd()
%><div id="full">查看完整版本:<a href="<%=Cache("SiteUrl")%>"><%=Cache("SiteName")%></a>
<%if ForumName<>"" Then%> <a href="../Forums.asp?Fid=<%=ForumID%>"><%=ForumName%></a><%end if%>
<%if Topic<>"" Then%> <a href="../Threads.asp?Tid=<%=ThreadID%>"><%=Topic%></a><%end if%></div>
</div>
<div class="body" align="center"><a href="<%=Cache("SiteUrl")%>"><%=Cache("SiteName")%></a> | <a href="<%=Cache("CompanyUrl")%>"><%=Cache("CompanyName")%></a> | <a href="http://www.miibeian.gov.cn/" target="_blank"><%=Cache("ICPName")%></a><br /><%=Cache("BottomAD")%><br /><a href="http://www.wxsky.cn/">论坛基于 WxBBS 构建</a></div>
</body>
</html>
<%
CloseDataBase
end sub

sub Error(Message)
Response.Clear()
PageHead("错误信息")
%><div class=err><span class=title>错误信息</span><br /><br />系统发生错误,以下是错误的详细信息<br /><%=Message%></div><%
PageEnd()
end sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -