📄 talkbook.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 %>
<Script language="javascript">
function fanye(){
var strfanye;
strfanye='talkbook.asp?page='+txtfanye.value;
location.href(strfanye);
}
</Script>
<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" class="rdbar"><tr>
<td width="28%" height="100%">
<a href="index.asp">[首页]</a>-<a href="talkbook.asp">[班级讨论区]</a>
</td>
<td align="right">
<a href="talk_seek.asp"><img src="img/seek.gif" border="0" hspace="0" vspace="0" align="absmiddle"></a>
</td>
</tr></table>
<%
'分页的统计
dim rdcount,pgcount,pgsize
pgsize=5
rdcount=conn.Execute("SELECT COUNT(t_ID) FROM tbltalk WHERE t_isreply=False AND t_class>1",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=1
colmid=colnum\2
'生成快捷页的函数
Sub PageQuick()
%>
<% if rdcount>0 then %>
<a href="talkbook.asp?page=1"><font face="webdings" title="头页">9</font></a>
<% else %>
<font face="webdings" title="头页">9</font>
<% end if %>
<% If curpage>1 Then %>
<a href="talkbook.asp?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=talkbook.asp?"&"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=talkbook.asp?"&"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=talkbook.asp?"&"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=talkbook.asp?"&"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="talkbook.asp?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="talkbook.asp?page=<% =pgcount %>"><font face="webdings" title="尾页">:</font></a>
<% else %>
<font face="webdings" title="尾页">:</font>
<% end if %>
全部<u>置顶</u><font color="<% =cohover %>"><% =rdcount %></font>个 共<font color="<% =cohover %>"><% =pgcount %></font>页 每页<font color="<% =cohover %>"><% =pgsize %></font>个
<%
End Sub
%>
<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" style="background-color:<% =bg3 %>;">
<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 class="rdr">
<MARQUEE width="350" height="100%" scrollamount="2" scrolldelay="50" align="bottom">
<%
'获取公告信息
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">
<% 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">
</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_class>1 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" class="rdbar">
<tr>
<th width="35" height="100%" class="rdr">
</th>
<th width="485" class="rdr" style="padding-left:4px; padding-right:4px; background:<% =bg1 %>">
全 部 讨 论 版 面
</th>
<th style="padding-left:12px;">
相关信息
</th>
</tr>
</table>
<%
dim vnotadm
vkd_now=now()
sqlstr="SELECT * FROM tblkind ORDER BY kd_class DESC"
rs.open sqlstr,conn,1,1
IF rs.eof AND rs.bof THEN
Response.Write "<div align=center>讨论区暂无任何版面!</div>"
ELSE
For i=1 To rs.RecordCount
vkd_upd=rs("kd_upd")
if isNULL(rs("kd_upd")) then
vkd_pic="img/skin/"&defstyle&"/bbs_notnew.gif"
elseif FormatDateTime(vkd_now,2)<>FormatDateTime(vkd_upd,2) then
vkd_pic="img/skin/"&defstyle&"/bbs_notnew.gif"
else
vkd_pic="img/skin/"&defstyle&"/bbs_new.gif"
end if
%>
<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" class="rde">
<tr>
<th width="35" height="100%" class="rdr" valign="middle">
<img src="<% =vkd_pic %>" align="absmiddle" vspace="0" hspace="0" border="0">
</th>
<td width="485" class="rdr" valign="middle" style="padding-left:4px; padding-right:4px;">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="*" valign="middle">
<a href='talklist.asp?kind=<% =rs("kd_ID") %>'><b><% =rs("kd_name") %></b></a>
<br><% =rs("kd_tip") %>
<br><font class="ft1">版主:</font>
<%
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>
<%
end if
next
if vnotadm=1 then
Response.Write "暂时空缺"
end if
%>
</td>
<td width="1%" valign="middle">
<%
if Len(rs("kd_pic"))>4 then
%>
<img src='<% =rs("kd_pic") %>' align="absmiddle" vspace="0" hspace="0" border="0">
<%
end if
%>
</td>
</tr>
</table>
</td>
<td valign="middle" style="padding-left:4px;">
主题:共<% =rs("kd_topic") %>篇<br>
更新:<% =vkd_upd %>
</td>
</tr>
</table>
<%
rs.MoveNext
Next
END IF
rs.close
%>
<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" style="background-color:<% =bg3 %>;">
<tr>
<td align="center" width="100%" height="100%">
<img src='<% ="img/skin/"&defstyle&"/bbs_new.gif" %>' align="absmiddle" vspace="0" hspace="0" border="0"> 有新帖
|
<img src='<% ="img/skin/"&defstyle&"/bbs_notnew.gif" %>' align="absmiddle" vspace="0" hspace="0" border="0"> 无新帖
</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 + -