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

📄 listtheme.asp

📁 在线考试系统
💻 ASP
字号:
<%@ Language=VBScript %>

<% option explicit %>

<!-- #include file="conn_forum.asp" -->
<!-- #include file="inc_session.asp" -->

<%
	dim uid
	uid=Getsession()

	dim sSort
	dim iSort
	dim iDay
	dim iPage
	dim iArea

	iSort=clng(Request("lstSort"))
	iPage=clng(Request("Page"))
	iArea=clng(Request("Area"))
	
	if Request("lstDay")="" then	'//default value
		iDay=90
	else
		iDay=clng(Request("lstDay"))
	end if

	select case iSort
		case 0
			sSort="Date DESC, Time DESC"
		case 1
			sSort="Theme"
		case 2
			sSort="Author"
		case 3
			sSort="Hit DESC"
		case 4
			sSort="ReplyCount DESC"
		case 5
			sSort="Replier"
	end select

	dim dNow
	dim dAgo

	dNow=date()

	if iDay<>0 and iDay<>-1 then
		dAgo=DateAdd("d",-iDay,dNow)
	else
		dAgo=dNow
	end if

	dNow=CDate(dNow)
	dAgo=CDate(dAgo)

	Const ListCount =25

	Dim rs
	set rs=Server.CreateObject ("ADODB.Recordset")
	
	dim sFields
	sFields="ThemeID,ParentID,AreaID,Theme,Author,Date,Time,Hit,ReplyCount,Replier,Icon,lock,selected"
	
	if iDay=0 then	'//Today
		rs.Open "SELECT " & sFields & " FROM tcontent WHERE ParentID=-1 AND AreaId=" & iArea & " AND Date=#" & dNow & "# ORDER BY selected DESC, " & sSort,connf,1 ,1
	elseif iDay=-1 then	'//All
		rs.Open "SELECT " & sFields & " FROM tcontent WHERE ParentID=-1 AND AreaId=" & iArea & " ORDER BY selected DESC, " & sSort ,connf,1 ,1
	else
		rs.Open "SELECT " & sFields & " FROM tcontent WHERE ParentID=-1 AND AreaId=" & iArea & " AND date BETWEEN #" & dAgo & "# AND #" & dNow & "# ORDER BY selected DESC, " & sSort,connf,1 ,1
	end if

	if rs.BOF and rs.EOF then
		'
	else
		rs.PageSize =ListCount
		if iPage=0 then	iPage =1
		if iPage>rs.PageCount then iPage=rs.PageCount
		rs.AbsolutePage=iPage
	end if

%>

<%
	dim rsi
	dim ana

	set rsi=Server.CreateObject ("ADODB.Recordset")
	rsi.Open "SELECT areaName FROM tindex WHERE areaID=" & iArea ,connf,1 ,1
	ana=rsi("areaName")
	rsi.Close
	set rsi=nothing
%>

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>主题列表 - <%=ana%></title>
<link rel="stylesheet" type="text/css" href="../main.css">
</head>

<body bgcolor="#FFFFFF">

<SCRIPT language=JavaScript src="../include/header.inc" type=text/javascript></SCRIPT>
<center>
<table border="0" width="760" cellspacing="0">
  <tr>
    <td width="43%"><a href="index.asp"><img border="0" src="images/logo_forum.gif" alt="论坛首页"></a></td>
    <td width="57%" align="left" valign="top">

		<img src="images/f_root.gif" border="0" align="top"><a href="index.asp">论坛首页</a><br>
		<img src="images/f_theme.gif" border="0" align="top"><%=ana%>

    </td>
  </tr>
  <tr>

    <td width="43%"></td>
    <td width="57%" align="right">
    <a href="write.asp?area=<%=iarea%>&ParentId=-1"><img src="images/b_newtheme.gif" alt="发新文章" border="0"></a>
      <%
		if rs.BOF and rs.EOF then
			Response.Write "<img src='images/b_search.gif' alt='文章搜索' border='0'>"
		else
			Response.Write "<a href='search.asp?area=" & iarea & "'><img src='images/b_search.gif' alt='文章搜索' border='0'></a>"
		end if
	  %>
	</td>
  </tr>
</table>

<table border="0" width="760" bgcolor="#CCCCCC" cellspacing="1">
  <tr>
    <td width="5%" bgcolor="#687088" align="center" height="25"> </td>
    <td width="36%" bgcolor="#687088" align="center" height="25"><font color="#FFFFFF"><b>主题</b></font></td>
    <td width="11%" bgcolor="#687088" align="center" height="25"><font color="#FFFFFF"><b>作者</b></font></td>
    <td width="20%" bgcolor="#687088" align="center" height="25"><font color="#FFFFFF"><b>更新时间</b></font></td>
    <td width="8%" bgcolor="#687088" align="center" height="25"><font color="#FFFFFF"><b>点击</b></font></td>
    <td width="8%" bgcolor="#687088" align="center" height="25"><font color="#FFFFFF"><b>回复数</b></font></td>
    <td width="12%" bgcolor="#687088" align="center" height="25"><font color="#FFFFFF"><b>回复者</b></font></td>
  </tr>

<%
	if rs.BOF and rs.EOF then
		'
	else

		dim RowCount
		RowCount=ListCount
		'rs.MoveFirst
		do

%>

  <tr>
    <td width="5%" bgcolor="#FFFBEE" height="22" align="center">
		<a href="viewtheme.asp?area=<%=iArea%>&lstsort=<%=iSort%>&lstday=<%=iDay%>&page=<%=iPage%>&id=<%=rs("ThemeID")%>" target="_blank"><img border="0" src="images/titleicon/<%=rs("Icon")%>" alt="用新窗口打开主题" width="15" height="15"></a></td>
    <td width="36%" bgcolor="#FFFFFF" height="22">
		<a href="viewtheme.asp?area=<%=iArea%>&lstsort=<%=iSort%>&lstday=<%=iDay%>&page=<%=iPage%>&id=<%=rs("ThemeID")%>">
		<%
		Response.Write rs("Theme")
		Response.Write "</a>"
		
		if rs("selected")=1 then
			Response.Write " <img src='images/topmost.gif' alt='顶端主题' border='0'>"
		end if
		
		if rs("Hit") >= 35 then
			Response.Write " <img src='images/hot.gif' alt='热门主题' border='0'>"
		end if
		%>
		</td>

    <td width="11%" bgcolor="#EFEFEF" height="22" align="center"><a href="viewinfo.asp?uid=<%=rs("Author")%>"><%=rs("Author")%></a></td>
    <td width="20%" bgcolor="#FFFFFF" height="22"><%=rs("Date") & "&nbsp;" & rs("Time")%></td>
    <td width="8%" bgcolor="#EFEFEF" height="22" align="right"><%=rs("Hit")%></td>
    <td width="8%" bgcolor="#FFFFFF" height="22" align="right"><%=rs("ReplyCount")%></td>
    <td width="12%" bgcolor="#EFEFEF" height="22" align="center"><a href="../reg/view.asp?id=<%=rs("Replier")%>"><%=rs("Replier")%></a></td>
  </tr>

<%
			rs.MoveNext
			RowCount=RowCount-1
		loop until (RowCount<=0) or (rs.EOF)

	end if
%>

</table>

<p align="center">页码:<%=iPage & "/" & rs.PageCount%></p>

<form method="POST" action="listtheme.asp" id=form1 name=form1>

  <table border="0" width="760" cellspacing="0" bgcolor="#F0F0F0">
	<tr>
		<td width="55%" align="left">
        <select size="1" name="lstSort" style="background-color: #FFFBEE">
        <option value="0" <% if iSort=0 then Response.Write "selected" %>>按日期排列</option>
        <option value="1" <% if iSort=1 then Response.Write "selected" %>>按主题排列</option>
        <option value="2" <% if iSort=2 then Response.Write "selected" %>>按作者排列</option>
        <option value="3" <% if iSort=3 then Response.Write "selected" %>>按点击数排列</option>
        <option value="4" <% if iSort=4 then Response.Write "selected" %>>按回复次数排列</option>
        <option value="5" <% if iSort=5 then Response.Write "selected" %>>按回复人排列</option>
        </select>
        &nbsp;
        <select size="1" name="lstDay" style="background-color: #FFFBEE">
        <option value="0" <% if iDay=0 then Response.Write "selected" %>>显示今天的主题</option>
        <option value="3" <% if iDay=3 then Response.Write "selected" %>>显示三天以来的主题</option>
        <option value="7" <% if iDay=7 then Response.Write "selected" %>>显示一周以来的主题</option>
        <option value="30" <% if iDay=30 then Response.Write "selected" %>>显示一个月以来的主题</option>
        <option value="90" <% if iDay=90 then Response.Write "selected" %>>显示三个月以来的主题</option>
        <option value="365" <% if iDay=365 then Response.Write "selected" %>>显示一年以来的主题</option>
        <option value="-1" <% if iDay=-1 then Response.Write "selected" %>>显示所有的主题</option>
        </select>
        &nbsp;
        <input type="submit" value="Go" name="cmdGo">

		</td>

		<td width="45%" align="right">
        <%
        if iPage<>1 then
			Response.Write "<a href='listtheme.asp?area=" & iArea & "&lstSort=" & iSort & "&lstDay=" & iDay & "&page=1" & "'>第一页</a> | "
			Response.Write "<a href='listtheme.asp?area=" & iArea & "&lstSort=" & iSort & "&lstDay=" & iDay & "&page=" & iPage-1 & "'>前一页</a> | "
		else
			Response.Write "<font color='#AAAAAA'>第一页</font> | "
			Response.Write "<font color='#AAAAAA'>前一页</font> | "
		end if

		if iPage<>rs.PageCount then
			Response.Write "<a href='listtheme.asp?area=" & iArea & "&lstSort=" & iSort & "&lstDay=" & iDay & "&page=" & ipage+1 & "'>后一页</a> | "
			Response.Write "<a href='listtheme.asp?area=" & iArea & "&lstSort=" & iSort & "&lstDay=" & iDay & "&page=" & rs.PageCount  & "'>最后一页</a> | "
		else
			Response.Write "<font color='#AAAAAA'>后一页</font> | "
			Response.Write "<font color='#AAAAAA'>最后一页</font> | "
		end if
        %>
        &nbsp;转到第 <input type="text" name="page" size="4" style="background-color: #FFFBEE; border: 1 solid #FF9933" value="<%=iPage%>"> 页
        <input type="hidden" name="area" value="<%=iArea%>">
		</td>

		</tr>
	</table>
</form>
</center>

<%
	rs.Close
	call closeconnf()
%>

<p> </p>
<SCRIPT language=JavaScript src="../include/buttom.inc" type=text/javascript></SCRIPT>
</body>
</html>

⌨️ 快捷键说明

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