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

📄 talkview.asp

📁 一个超级漂亮的班级主页asp代码
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--插入html头部分以及数据库接口-->
<!--#include file="in_conn.asp"-->
<!-- #include file="UbbCode.asp" -->
<!--插入星座判断函数-->
<!--#include file="in_starbirth.asp"-->
<!--获取发布内容字数限制-->
<!--#include file="in_talksize.asp"-->

<body>

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

<script language="JavaScript" src="bbcode.js"></script>
<script language="javascript">

function checkfill(){
	if(document.fm1.txtcontent.value.length><% =DEF_talksize*1024 %>){
		alert("内容文字过多,请按要求控制在<% =DEF_talksize*1024 %>字符以内");
		return false;
		}
	else if(document.fm1.txtcontent.value==""){
		alert("填写不完整:您没有填写回复的内容!");
		return false;
		}
	else{
		return true;
		}
}

function okpress(){
	if(checkfill()){
		document.fm1.cmdpub.disabled=true;
		document.fm1.submit();
		}
}
</script>


<%
'获取page传值
dim curpage

IF Request.QueryString("page")="" THEN
	curpage=1
ELSEIF isNumeric(Request.QueryString("page")) THEN
	curpage=CLng(Request.QueryString("page"))
ELSE
	curpage=1
END IF


'获取id传值
dim vtid,vre,vclk
dim vtopic
IF isNumeric(Request.QueryString("id")) THEN
	vtid=CLng(Request.QueryString("id"))
	'找出主题
	sqlstr="SELECT t_topic,t_re,t_clk,t_isreply,t_class,t_kind FROM tbltalk WHERE t_ID="&vtid
	rs.open sqlstr,conn,1,3
		'获取版面ID
		vkind=rs("t_kind")

		if rs.eof AND rs.bof then
			Response.Redirect "resp.asp?cmd=talk_idmiss"
		elseif rs("t_isreply")=True then
			Response.Redirect "resp.asp?cmd=not_a_topic"
		else
			vtopic=rs("t_topic")
			vre=rs("t_re")
					'点击增加
					if curpage=1 then
						rs("t_clk")=rs("t_clk")+1
						rs.update
					end if
			vclk=rs("t_clk")
		end if

			'管理员置顶
			IF u_power>1 THEN
				if rs("t_class")<2 then
					strsettop="<br><a href='talk_settop.asp?cmd=settop&id="&vtid&"' class='ccjh'>[设为置顶]</a>"
				else
					strsettop="<br><a href='talk_settop.asp?cmd=cleartop&id="&vtid&"' class='ccjh'>[取消置顶]</a>"
				end if
					strsettop=strsettop&"&nbsp;<a href='talk_move.asp?id="&vtid&"' class='ccjh'>[转移此主题到其他版面]</a>"
			END IF
	rs.close
ELSE
	Response.Redirect "resp.asp?cmd=talk_idmiss"
END IF

'分页的统计
dim rdcount,pgcount,pgsize
pgsize=DEF_pg_topic
rdcount=conn.Execute("SELECT COUNT(t_ID) FROM tbltalk WHERE t_ID="&vtid&" OR t_belong="&vtid,0,1)(0)
pgcount=Abs(Int(rdcount/pgsize*(-1)))

'页码再处理
	if curpage<1 OR curpage>pgcount then
		curpage=1
	end if
IF Request.QueryString("page")="end" THEN
	curpage=pgcount
END IF
%>

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

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

<% If curpage>1 Then %>
<a href="talkview.asp?id=<% =vtid %>&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

dim pg_wei
IF pgcount<colnum THEN
	for pg_i=1 to pgcount
		if pg_i<>curpage then
			response.write "<a href=talkview.asp?id="&vtid&"&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=talkview.asp?id="&vtid&"&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=talkview.asp?id="&vtid&"&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=talkview.asp?id="&vtid&"&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="talkview.asp?id=<% =vtid %>&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="talkview.asp?id=<% =vtid %>&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
%>


<%
'版面是否存在
dim kind_name
IF isNumeric(vkind) THEN
	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
	rs.close
ELSE
	Response.Redirect "resp.asp"
END IF

%>


<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" class="rdbar"><tr>
	<td width="100%" height="60%">
		&nbsp;<a href="index.asp">[首页]</a>-<a href="talkbook.asp">[班级讨论区]</a>-<a href='talklist.asp?kind=<% =vkind %>'><% =unhtml(kind_name) %></a>-<font class="ft1">[查看主题]</font>
	</td>
	<td align="right">
		<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" style="background-color:<% =bg3 %>;">
	<tr>
		<td width="150" 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>
			&nbsp;<a href="reply.asp?kind=<% =vkind %>&id=<% =vtid %>&cmd=pub"><img src="img/icn_reply.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" class="rdbar" style="padding-left:6px;padding-right:6px;">
		<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" class="intbl"><tr><td valign="top">
		<b>
		主题:<% =unhtml(vtopic) %>
		</b>
		&nbsp;&nbsp;
		人气:<font class="ft1"><% =vclk %></font>
		回帖:<font class="ft1"><% =vre %></font><% =strsettop %>
		</td></tr></table>
</td></tr>

<%
sqlstr="SELECT m.ID,m.name,m.sex,m.power,m.faceurl,m.facew,m.faceh,m.birthday,m.regdate,m.cnt_on,m.cnt_water,m.signline,m.hp,t.t_ID,t.t_author,t.t_topic,t.t_content,t.t_datepub,t.t_datefre,t.t_emotion,t.t_isreply,t_class FROM tblmates AS m INNER JOIN tbltalk AS t ON m.name=t.t_author WHERE t.t_ID="&vtid&" OR t.t_belong="&vtid&" ORDER BY t.t_datepub ASC"
rs.open sqlstr,conn,1,1

⌨️ 快捷键说明

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