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

📄 talklist.asp

📁 一个超级漂亮的班级主页asp代码
💻 ASP
字号:
<!--插入html头部分以及数据库接口-->
<!--#include file="in_conn.asp"-->


<body>
<!--插入网站置顶-->
<% if u_name="" then %>
<!--#include file="in_top.asp"-->
<% else %>
<!--#include file="in_topmb.asp"-->
<% end if %>


<%
'获取版面分类的传值
dim vkind
vkind=Request.QueryString("kind")

dim kind_name
IF isNumeric(Request.QueryString("kind"))=false THEN
	Response.Redirect "resp.asp"
ELSE
	vkind=CLng(vkind)
	'找出该版面的相关信息
	sqlstr="SELECT * FROM tblkind WHERE kd_ID="&vkind
	rs.open sqlstr,conn,1,1
		if rs.eof AND rs.bof then
			Response.Redirect "resp.asp?cmd=kindmiss"
		else
			kind_name=rs("kd_name")
		end if

%>



<Script language="javascript">
function fanye(){
var strfanye;
	strfanye='talklist.asp?kind=<% =vkind %>&page='+txtfanye.value;
	location.href(strfanye);
}
</Script>

<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" class="rdbar"><tr>
	<td height="100%">
		&nbsp;<a href="index.asp">[首页]</a>-<a href="talkbook.asp">[班级讨论区]</a>-<% =unhtml(kind_name) %>
	</td>
	<td width="218" align="right">
		跳到:<input type="text" ID="txtfanye" name="txtfanye" size="4" maxlength="5" class="kong" onKeypress="if (event.keyCode < 48 || event.keyCode > 57) event.returnValue=false;">页
		&nbsp;<input type="button" name="btnfan" value=" GO " class="an" onClick="JavaScript:fanye();" style="line-height:12px; font-size:12px; height:15px" align="absmiddle">

		&nbsp;&nbsp;&nbsp;<a href="talk_seek.asp"><img src="img/seek.gif" border="0" hspace="0" vspace="0" align="absmiddle"></a>&nbsp;
	</td>
</tr></table>
<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" class="rde"><tr>
	<td width="100%" height="100%">
	&nbsp;版主:
						<%
						vnotadm=1
						for i45=1 to 3
							if rs("master_"&i45)<>"" then
								vnotadm=0
						%>
							<a href="viewinfo.asp?id=<% =rs("masterID_"&i45) %>" title="点击查看该同学详细资料"><% =rs("master_"&i45) %></a>&nbsp;
						<%
							end if
						next
						if vnotadm=1 then
							Response.Write "暂时空缺"
						end if
						%>
	</td>
</tr></table>
<%
	rs.close
END IF

'分页的统计
dim rdcount,pgcount,pgsize
pgsize=DEF_pg_bbs
rdcount=conn.Execute("SELECT COUNT(t_ID) FROM tbltalk WHERE t_isreply=False AND t_kind="&vkind,0,1)(0)
pgcount=Abs(Int(rdcount/pgsize*(-1)))

'获取传值
dim curpage
curpage=Request.QueryString("page")

IF isNumeric(Request.QueryString("page")) THEN
	curpage=CLng(curpage)
	if curpage<1 OR curpage>pgcount then
		curpage=1
	end if
ELSE
	curpage=1
END IF

%>

<%
dim colnum,colmid,pg_i
'定义显示快捷页个数
colnum=5
colmid=colnum\2
'生成快捷页的函数
Sub PageQuick()
%>

<% if rdcount>0 then %>
<a href="talklist.asp?kind=<% =vkind %>&page=1"><font face="webdings" title="头页">9</font></a>
<% else %>
<font face="webdings" title="头页">9</font>
<% end if %>

<% If curpage>1 Then %>
<a href="talklist.asp?kind=<% =vkind %>&page=<% =curpage-1 %>"><font face="webdings" title="上页">7</font></a>
<% Else %>
<font face="webdings" title="上页">7</font>
<% End if %>

<%
'前省略号的使用
if pgcount>colnum AND curpage-colmid>1 then
	Response.Write "…"
end if

IF pgcount<colnum THEN
	for pg_i=1 to pgcount
		if pg_i<>curpage then
			response.write "<a href=talklist.asp?kind="&vkind&"&page="&pg_i&">["&pg_i&"]</a>"
		else
			response.Write "["&pg_i&"]"
		end if
	next
ELSEIF curpage-1>=colmid AND pgcount-curpage>=colmid THEN
	for pg_i=curpage-colmid to curpage+colmid
		if pg_i<>curpage then
			response.write "<a href=talklist.asp?kind="&vkind&"&page="&pg_i&">["&pg_i&"]</a>"
		else
			response.Write "["&pg_i&"]"
		end if
	next
ELSEIF curpage-1>=colmid AND pgcount-curpage<colmid THEN
	for pg_i=pgcount-colnum+1 to pgcount
		if pg_i<>curpage then
			response.write "<a href=talklist.asp?kind="&vkind&"&page="&pg_i&">["&pg_i&"]</a>"
		else
			response.Write "["&pg_i&"]"
		end if
	next
ELSE
	for pg_i=1 to 5
		if pg_i<>curpage then
			response.write "<a href=talklist.asp?kind="&vkind&"&page="&pg_i&">["&pg_i&"]</a>"
		else
			response.Write "["&pg_i&"]"
		end if
	next
END IF

'后省略号的使用
if pgcount>colnum AND curpage+colmid<pgcount then
	Response.Write "…"
end if
%>

<% If curpage<pgcount Then %>
<a href="talklist.asp?kind=<% =vkind %>&page=<% =curpage+1 %>"><font face="webdings" title="下页">8</font></a>
<% Else %>
<font face="webdings" title="下页">8</font>
<% End if %>

<% if rdcount>0 then %>
<a href="talklist.asp?kind=<% =vkind %>&page=<% =pgcount %>"><font face="webdings" title="尾页">:</font></a>
<% else %>
<font face="webdings" title="尾页">:</font>
<% end if %>

&nbsp;本版面主题<font color="<% =cohover %>"><% =rdcount %></font>个&nbsp;分为<font color="<% =cohover %>"><% =pgcount %></font>页&nbsp;每页<font color="<% =cohover %>"><% =pgsize %></font>个&nbsp;第<font color="<% =cohover %>"><% =curpage %></font>页&nbsp;
<%
End Sub
%>

<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" style="background-color:<% =bg3 %>;">
	<tr>
		<td width="130" height="100%">
			&nbsp;<a href="talkpub.asp?kind=<% =vkind %>"><img src="img/icn_pub.gif" align="absmiddle" border="0" vspace="0" hspace="0" alt="[→发表新主题]"></a>
			<a href="talkvote.asp?kind=<% =vkind %>"><img src="img/icn_newvote.gif" align="absmiddle" border="0" vspace="0" hspace="0" alt="[→发起新投票]"></a>
		</td>
		<td align="right">
			<% call PageQuick() %>
		</td>
	</tr>
</table>

<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0">
<tr><td width="100%" height="25">
	<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" class="rdbar">
	<tr>
		<th width="25" height="100%" class="rdr">&nbsp;
			
		</th>
		<th width="280" class="rdr" style="padding-left:4px; padding-right:4px; background:<% =bg1 %>">
			主 题
		</th>
		<th width="140" align="center" class="rdr">
			作 者
		</th>
		<th width="90" align="center" class="rdr" style="background:<% =bg1 %>">
			回复/点击
		</th>
		<th style="padding-left:12px;">
			最后发表
		</th>
	</tr>
	</table>
</td></tr>

<%
IF rdcount<1 THEN
%>
<tr><th width="100%" class="rdkuang"><font class="ft1">抱歉,该版面还没有任何文章!</font></th></tr>

<%
ELSE

sqlstr="SELECT m.ID,m.name,m.sex,m.power,t.t_ID,t.t_author,t.t_topic,t.t_datepub,t.t_datefre,t.t_class,t.t_re,t.t_clk,t.t_emotion,t.t_lastre FROM tblmates AS m INNER JOIN tbltalk AS t ON m.name=t.t_author WHERE t.t_isreply=False AND t.t_kind="&vkind&" ORDER BY t.t_class DESC,t.t_idfre DESC"
rs.open sqlstr,conn,1,1

'给分页所需的中间变量赋值
rs.PageSize=pgsize

'当前页转到指定的页码
	rs.AbsolutePage=curpage

'开始读取数据
dim icn_top,icn_sex,vlastre,vlink,vttype
FOR i=1 to pgsize
		If rs.eof Then
			EXIT FOR
		End If
		'判断主题级别和表情
			if rs("t_emotion")=0 or rs("t_class")<2 then
				icn_top="img/topic/"&rs("t_emotion")&".gif"
			else
				icn_top="img/icn_top.gif"
			end if
		IF rs("t_class")>1 THEN
			vlink="class='ccjh'"
		ELSE
			vlink=""
		END IF
		'判断是否为投票主题
		
		IF rs("t_emotion")=0 THEN
			vttype="voteview.asp"
		ELSE
			vttype="talkview.asp"
		END IF

		'判断身份或者性别
		IF rs("power")>1 THEN
				icn_sex="img/icn_adm1.gif"
		ELSEIF rs("sex")=True THEN
				icn_sex="img/icn_gg.gif"
		ELSE
				icn_sex="img/icn_mm.gif"
		END IF
		'总管判断
		if DEF_sysadm=rs("name") then
			icn_sex="img/icn_admsys.gif"
		end if

		'最后发表的人
		IF isNULL(rs("t_lastre")) OR rs("t_lastre")="" THEN
			vlastre="------"
		ELSE
			vlastre=rs("t_lastre")
		END IF

%>

<tr><td width="100%" height="42">
	<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" class="rde">
	<tr>
		<th width="25" height="100%" class="rdr">
			<img src="<% =icn_top %>" border="0">
		</th>
		<td width="280" class="rdr" style="padding-left:4px; padding-right:4px; background:<% =bg3 %>">
			<a <% =vlink %> href="<% =vttype %>?id=<% =rs("t_ID") %>" title="主题:<% =stryin2(KillHTMLLabel(rs("t_topic"))) %><br>作者:<% =rs("t_author") %><br>发布于:<% =rs("t_datepub") %>"><% =unhtml(hhstr(rs("t_topic"),40)) %></a>
		</td>
		<td width="140" align="center" class="rdr">
			<img src="<% =icn_sex %>" border="0" align="absmiddle">
			<a href="viewinfo.asp?id=<% =rs("ID") %>" title="点击查看该同学详细资料"><% =rs("t_author") %></a>
		</td>
		<td width="90" align="center" class="rdr" style="background:<% =bg3 %>">
			<%
			Response.Write "<FONT class='ft1'>"&rs("t_re")&"</FONT>/"&rs("t_clk")
			%>
		</td>
		<td style="padding-left:12px;">
			<%
			IF isNULL(rs("t_datefre")) THEN
				Response.Write rs("t_datepub")
			ELSE
				Response.Write rs("t_datefre")
			END IF
			Response.Write "<br>"&vlastre
			%>
		</td>
	</tr>
	</table>
</td></tr>

<%
		rs.MoveNext
Next
rs.close

END IF
%>
</table>

<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" style="background-color:<% =bg3 %>;">
	<tr>
		<td width="130" height="100%">
			&nbsp;<a href="talkpub.asp?kind=<% =vkind %>"><img src="img/icn_pub.gif" align="absmiddle" border="0" vspace="0" hspace="0" alt="[→发表新主题]"></a>
			<a href="talkvote.asp?kind=<% =vkind %>"><img src="img/icn_newvote.gif" align="absmiddle" border="0" vspace="0" hspace="0" alt="[→发起新投票]"></a>
		</td>
		<td align="right">
			<% call PageQuick() %>
		</td>
	</tr>
</table>


<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" style="background-color:<% =bg2 %>;">
	<tr>
		<td width="26" height="100%" align="right">
			<img src="img/skin/<% =defstyle %>/announce.gif" border="0" vspace="0" hspace="0" align="absmiddle">
		</td>
		<td width="435" height="25">
			<MARQUEE width="100%" scrollamount="2" scrolldelay="50" align="absmiddle">
				<%
				'获取公告信息
				sqlstr="SELECT anc,anc_date FROM tblsys"
				rs.open sqlstr,conn,0,1
				%>
					<font color="<% =colink %>"><% =rs("anc") %></font>
					<% =rs("anc_date") %>
				<%
				rs.close
				%>
			</MARQUEE>
		</td>
		<td align="right">

	<select name="lovetan" onChange='window.location.href=this.options[this.selectedIndex].value' class="an">
			<%
			Response.Write "<option value='#'>-跳转到其他版面-</option>"
			'列出所有版面分类
			sqlstr="SELECT kd_ID,kd_name FROM tblkind ORDER BY kd_class DESC"
			rs.open sqlstr,conn,1,1
					FOR i=1 TO rs.RecordCount
						Response.Write "<option value='talklist.asp?kind="&rs("kd_ID")&"'>"&unhtml(rs("kd_name"))&"</option>"
						rs.MoveNext
					NEXT
			rs.Close
			%>
 	</select>

		</td>
	</tr>
</table>




<!--插入在线统计-->
<!--#include file="in_online.asp"-->
<!--插入网站置底-->
<!--#include file="in_bottom.asp"-->
</body>

</html>

⌨️ 快捷键说明

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