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

📄 gbookshow.asp

📁 庐江二中
💻 ASP
字号:
<!--#include file="conn.asp" --> 
<%
dim javastr
javastr="" 
javastr=javastr+"<br><table width=98% border=0 cellspacing=0 cellpadding=0 align=center>"
javastr=javastr+"<tr><td>"

dim BigClassName,BigClassType,SmallClassName,SmallClassType,SpecialName,NewsID,IfClass,g,cols,thistitle
BigClassName=Request("BigClassName")
BigClassType=Request("BigClassType")
SmallClassName=Request("SmallClassName")
SmallClassType=Request("SmallClassType")
SpecialName=Request("SpecialName")
NewsID=Request("NewsID")
cols=Request("cols")		'内容框长度
	
if BigClassName<>"" then
	IfClass="where BigClassName='"&BigClassName&"' "
	ifclassurl="BigClassName="&BigClassName&"&BigClassType="&BigClassType
	thistitle=BigClassName
end if
if SmallClassName<>"" then
	IfClass="where BigClassName='"&BigClassName&"' and SmallClassName='"&SmallClassName&"' "
	ifclassurl="BigClassName="&BigClassName&"&BigClassType="&BigClassType&"&SmallClassName="&SmallClassName&"&SmallClassType="&SmallClassType
	thistitle=SmallClassName
end if	
if SpecialName<>"" then
	IfClass="where SpecialName='"&SpecialName&"' "
	ifclassurl="SpecialName="&SpecialName
	thistitle=SpecialName
end if	
if NewsID<>"" then
	IfClass="where NewsID="&NewsID&" "
	ifclassurl="NewsID="&NewsID
	thistitle=NewsID&"号文章"
end if

if ifclassurl<>"" then
	if1="?"
	if2="&"
end if	

if thistitle<>"" then thistitle=thistitle+"-"	

sql="select * from gstbook "&IfClass&" order by id desc;"
rs.Open sql,conn,1,1

Totalcount =INT(RS.recordcount)

javastr=javastr+"<fieldset> <legend align=left>╣ "&thistitle&"会员评论(共 "&Totalcount&" 篇) ╠</legend>"
javastr=javastr+"<table border=0 width=100% cellspacing=0 style=""TABLE-LAYOUT: fixed"">"

g=0		'条数
do while not rs.eof
javastr=javastr+"<tr>"

name=rs("name")
GBcontenta=Replace(rs("content"),"<br>",CHR(10))
GBcontent=left(GBcontenta,80)
lenTotal = 0
for i=1 to Len(GBcontent)
strWord = mid(GBcontent, i, 1)
if strWord=CHR(10) then
GBcontent = left(GBcontent, i-1)
exit for
end if
next

javastr=javastr+"<td width=5% align=center class=MainContentS style=""WORD-WRAP: break-word"">"
javastr=javastr+"<img src=""images/gbook.gif""></td>"
javastr=javastr+"<td width=97% class=MainContentS style=""WORD-WRAP: break-word""> <a class=MainContentS href=""gbookread.asp?id="&rs("id")&if2&ifclassurl&"""  target=""_blank"">"&GBcontent&"</a> "
javastr=javastr+"&nbsp;<font color=""#666666"">["&name&","&Month(rs("datetime"))&"-"&day(rs("datetime"))&"] "
if rs("replay")>0 then javastr=javastr+"["&rs("replay")&"篇回复] "
javastr=javastr+"</font> "
if DateValue(rs("datetime"))=date() then javastr=javastr+"<font color=red> 新</font> "
if session("xpUser")<>"" and session("UserLevel")>7 then javastr=javastr+"[<a href=""gbookdel.asp?id="&rs("id")&if2&ifclassurl&""">删</a>] "
javastr=javastr+"</td>"
javastr=javastr+"</tr>"
g=g+1
if g>=4 then exit do
rs.movenext
loop
rs.close
set rs=nothing
conn.close
set conn=nothing

if totalcount>4 then
	javastr=javastr+"<tr>"
	javastr=javastr+"<td colspan=""2"" align=""right""><a href=""GBookMore.asp"&if1&ifclassurl&""" target=""_blank""><img src=""images/more4.jpg"" border=""0""></a>&nbsp;</td>"
	javastr=javastr+"</tr>"
end if
javastr=javastr+"</table>"
javastr=javastr+"</fieldset><br>"
%>
<!--
function Form1_Validator(theForm)
{if (theForm.name.value =="")
{alert("请输入您注册的会员名!");
theForm.name.focus();
return (false);}

if (theForm.password.value =="")
{alert("请输入密码!");
theForm.password.focus();
return (false);}

if (theForm.name.value.length > 20)
{alert("名字太长!至多20个字符");
theForm.name.focus();
return (false);}

if (theForm.content.value =="")
{alert("没有内容!");
theForm.content.focus();
return (false);}

if (theForm.content.value.length > 500)
{alert("话也太多了些吧,至多500个字符!");
theForm.content.focus();
return (false);}
return (true);}
//-->
<%
javastr=javastr+"<fieldset> <legend align=left>╣ 发表评论 ╠</legend>"
javastr=javastr+"<table border=""0"" width=""95%"" cellspacing=""0"" cellpadding=""0"" align=""center"" style=""TABLE-LAYOUT: fixed"">"
javastr=javastr+"<form method=POST name=Form1 action=GBookSave.asp"&if1&ifclassurl&" onsubmit=return Form1_Validator(this)>"
javastr=javastr+"<tr><td width=""70%"">&nbsp;姓名:<INPUT maxLength=16 name=name class=""textb"" "
	if session("xpUser")<>"" then javastr=javastr+" value="&Session("xpUser")
	javastr=javastr+" size=10 onfocus=this.select()>"
javastr=javastr+"&nbsp;&nbsp;密码:<INPUT type=password name=password class=textb "
	if session("xpPwd")<>"" then javastr=javastr+" value="&Session("xpPwd")
	javastr=javastr+" size=10 onfocus=this.select()></td>"
javastr=javastr+"<td align=right><input class=submit type=submit value=提交 name=B1>&nbsp;<input class=submit type=reset  value=重写 name=B2>&nbsp;</td></tr>"
javastr=javastr+"<tr><td width=100% valign=top style=""WORD-WRAP: break-word"" colspan=2><TEXTAREA name=content rows=3 cols="&cols&"></TEXTAREA></td></tr>"
javastr=javastr+"<tr><td width=100% valign=top colspan=2 height=6></td></tr>"
javastr=javastr+"</FORM>"
javastr=javastr+"</table>"
javastr=javastr+"</fieldset>"
javastr=javastr+"<table width=90% border=0 height=6 cellpadding=0 cellspacing=0><tr><td></td></tr></table>"
javastr=javastr+"</td></tr>"
javastr=javastr+"</table>"
response.write ("document.write('"&javastr&"')")
response.end
%>

⌨️ 快捷键说明

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