?? gustbook_sub.asp
字號:
<%
Function RongCuo(RongCuoName,MaxValue,TrueValue) '容錯判斷是否是數字且在范圍(0到..)之內
If Not Isnumeric(RongCuoName) then
If RongCuoName="" then
RongCuo=TrueValue
Else
RongCuo=RongCuoName
End If
ElseIf MaxValue=0 and RongCuoName<0 then '如該數無最大要求,則,若為負即賦予默認值
RongCuo=TrueValue
ElseIf MaxValue<>0 and (RongCuoName<0 or RongCuoName>MaxValue) then
''如該數有最大要求,則,若為負或超過最大值即賦予默認值
RongCuo=TrueValue
Else
RongCuo=RongCuoName
End If
End Function
Sub DQE_gustbook(lanmu,bookNum,LeftNum,bookform,bookname)
'Call DQE_gustbook(5,4,25,1,"留言區")
'詳細參數說明
'lanmu ------- 調用評論的欄目:容錯默認為0
'bookNum ------- 評論條數:容錯默認為5
'LeftNum ------- 顯示標題最左邊的字符數,默認40,一個漢字算兩個字符
'bookform ------- 是否顯示發言表單, 默認0為不顯示,1為顯示,并自定義,容錯默認為0
'bookname ------- 顯示在評論頁面的標題:必須加雙引號,如:"留言區"
lanmu=RongCuo(lanmu,0,0)
bookNum=RongCuo(bookNum,0,5)
LeftNum=RongCuo(LeftNum,50,40)
bookform=RongCuo(bookform,1,0)
%>
<style type="text/css">
<!--
.xianyan {
font-family: "宋體";
font-size: 9pt;
color: #FF6600;
font-weight: bold;
}
.wenzi {
font-family: "宋體";
font-size: 9pt;
color: #333333;
}
.huisekuang {
border: 1px solid #E7E7E7;
}
-->
</style>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td colspan="3" class="huisekuang"><table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20">
<% Set mRs= Server.CreateObject("adodb.recordSet")
mRs.open "Select * from dqe_gustbook where lanmu="&lanmu, conn, 1, 1
dim plrenshu
plrenshu=0
do while not mRs.eof
plrenshu=plrenshu+1
mRs.movenext
loop
mRs.Close
Set mRs = nothing
%><div align="left"><span class="wenzi">現在有<span class="xianyan"><%= plrenshu %></span>人發表評論 <a href="<%= Url %>?lanmu=<%= lanmu %>&xsming=<%= bookname %>"><span class="xianyan">查看所有評論</span></a></span></div></td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="huisekuang">
<% Set mRs= Server.CreateObject("adodb.recordSet")
mRs.open "Select * from dqe_gustbook where lanmu="&lanmu, conn, 1, 1
dim tiaoshu
tiaoshu=0
do while not mRs.eof and tiaoshu<bookNum+1
%><% tiaoshu=tiaoshu+1 %><tr>
<td height="18"><span class="wenzi">【<%= mRs("who") %>】說:<%= left(mRs("biaoti"),LeftNum) %> <% response.write "<font color=999999>["&month(mRs("shijian"))&"月"&day(mRs("shijian"))&"日]</font>" %></span> </td>
</tr>
<% mRs.movenext
loop %><% mRs.Close
Set mRs = nothing %>
</table></td>
</tr><% If bookform=1 Then %>
<tr>
<td height="160" align="left" valign="bottom"><form name="form1" method="post" action="<%= Url %>?lanmu=<%= lanmu %>&xsming=<%= bookname %>">
<table width="100%" height="140" border="0" cellpadding="0" cellspacing="0" class="huisekuang">
<tr>
<td width="5%" height="30"><div align="center"><span class="wenzi">作者:</span> </div></td>
<td width="10%" height="30"><input name="textfield2" type="text" class="huisekuang" size="10"></td>
<td width="6%" height="30"><div align="center"><span class="wenzi">標題:</span></div></td>
<td width="79%" height="30"> <input name="textfield" type="text" class="huisekuang" size="25"></td>
</tr>
<tr>
<td height="80"><div align="center"><span class="wenzi">內容:</span> </div></td>
<td height="80" colspan="3"><textarea name="textarea" cols="50" rows="5" class="huisekuang"></textarea></td>
</tr>
<tr>
<td height="25"></td>
<td height="25" colspan="3"><div align="left">
<input type="Submit" name="Submit" value="提交評論" style="background-color: #FFFFFF; border-color: #E7E7E7; border-style: solid; border-width: 1px 1px 1px"
>
</div></td>
</tr>
</table>
</form></td>
</tr><% End If %>
</table></td>
</tr>
</table>
<% End Sub %>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -