?? post.asp
字號:
<!--#INCLUDE FILE="config.asp" -->
<%
if DateDiff("s",Session("LastPostTime"),now())<PostTime then
response.write "<html><script>alert(""如果發(fā)貼還需要等待"&PostTime - DateDiff("s",Session("LastPostTime"),now())&"秒"");self.location=(""javascript:history.go(-1)"")</script></html>"
response.end
end if
%>
<%
set my_conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open ConnString
%>
<!--#INCLUDE FILE="online.asp" -->
<%
if Request.QueryString("method") = "edit" then
strSql ="SELECT * from reply where reply_id = " & Request.QueryString("reply_id")
msg = "<br>注意:只有管理員、本版版主或作者才可以修改回復(fù)!"
'on Error resume next
set rs = my_conn.Execute (StrSql)
txtmsg = rs("r_message")
End if
if Request.QueryString("method") = "editTopic" then
strSql ="SELECT T_Message from Topics where Topic_id = " & Request.QueryString("reply_id")
msg = "<br>注意:只有管理員、本版版主或作者才可以修改主題!"
'on Error resume next
set rs = my_conn.Execute (StrSql)
txtmsg = rs("T_Message")
End if
%>
<!--#include file="top.asp" -->
<SCRIPT LANGUAGE="JavaScript">
function insertstr(str)
{document.PostTopic.Message.value=document.PostTopic.Message.value+str;}
function btn_b()
{
txt=prompt("粗體文字:","粗體字");
if (txt!=null)
{
AddTxt="[b]"+txt;
insertstr(AddTxt);
AddTxt="[/b]";
insertstr(AddTxt);
}
}
function btn_i()
{
txt=prompt("斜體文字:","斜體字");
if (txt!=null)
{
AddTxt="[i]"+txt;
insertstr(AddTxt);
AddTxt="[/i]";
insertstr(AddTxt);
}
}
function btn_url()
{
txt=prompt("鏈接顯示:\n如果置空則表示直接顯示鏈接地址","");
if (txt!=null)
{
txt2=prompt("鏈接地址:","http://");
if (txt2!=null)
{
if (txt=="")
{
AddTxt="[url]"+txt2;
insertstr(AddTxt);
AddTxt="[/url]";
insertstr(AddTxt);
}
else
{
AddTxt="[url="+txt2+"]"+txt;
insertstr(AddTxt);
AddTxt="[/url]";
insertstr(AddTxt);
}
}
}
}
function btn_img()
{
txt=prompt("圖片的URL地址:","http://");
if(txt!=null)
{
AddTxt="\r[img]"+txt;
insertstr(AddTxt);
AddTxt="[/img]";
insertstr(AddTxt);
}
}
function btn_swf()
{
txt=prompt("Flash動畫的URL地址:","http://");
if(txt!=null)
{
AddTxt="\r[swf]"+txt;
insertstr(AddTxt);
AddTxt="[/swf]";
insertstr(AddTxt);
}
}
function btn_q()
{
txt=prompt("引用內(nèi)容:","文字");
if(txt!=null)
{
AddTxt="[quote]"+txt;
insertstr(AddTxt);
AddTxt="[/quote]";
insertstr(AddTxt);
}
}
function showcolor(color)
{
txt=prompt("文字顏色:"+color,"文字");
if(txt!=null)
{
AddTxt="[color="+color+"]"+txt;
insertstr(AddTxt);
AddTxt="[/color]";
insertstr(AddTxt);
}
}
function showsize(size)
{
txt=prompt("文字大小:"+ size,"文字");
if (txt!=null)
{
AddTxt="[size="+size+"]"+txt;
insertstr(AddTxt);
AddTxt="[/size]";
insertstr(AddTxt);
}
}
</SCRIPT>
<table border=0 width=<%=TableWidth%> align=center class="sft">
<tr>
<td align=left>
<a href="index.asp">論壇首頁</a> >
<a href="forum.asp?forum_id=<%= Request.QueryString("Forum_id") %>&forum_title=<%=server.Urlencode(Request.QueryString("forum_title"))%>"><%=Request.QueryString("forum_title")%></a> >
<%
if Request.QueryString("method") = "reply" then
Response.Write "回復(fù)主題:" &Request.QueryString("topic_title")
else
if Request.QueryString("type") = "vote" then
Response.Write "發(fā)布新投票"
else
if Request.QueryString("method") = "Topic" then
Response.Write "發(fā)表新主題"
else
Response.Write "編輯主題:" &Request.QueryString("topic_title")
end if
end if
end if%>
</td></tr></table>
<center><br><%=msg%>
<form action="post2.asp" method="post" name="PostTopic">
<table align="center" bgcolor=<%=TableColor%> border="0" width=<%=TableWidth%> cellspacing="1" cellpadding="3" class="sft">
<tr><td align="center" bgcolor="<%=HeadColor%>" class="sfh" width="20%" colspan=2>編輯帖子</td></tr>
<tr><td bgcolor=<%=CellColor1%> align="right" width="20%">用戶名 :</td>
<td bgcolor=<%=CellColor1%> width="80%">
<input maxLength="25" name="UserName" size="20" Value="<%=Request.Cookies("User")("Name")%>" class="box"> </td></tr>
<tr><td bgcolor=<%=CellColor1%> align="right">密碼 :</td>
<td bgcolor=<%=CellColor1%>>
<input maxLength="13" name="Password" size="20" type="password" value="<%=Request.Cookies("User")("Pword")%>" class="box">
<a href="register.asp">尚未注冊?</a> <a href="password.asp">遺忘密碼?</a></td></tr>
<% if lcase(Request.QueryString("method")) = "topic" then %>
<tr><td bgcolor=<%=CellColor1%> align="right">主題 :</td>
<td bgcolor=<%=CellColor1%>>
<input maxLength="85" name="TopicSubject" size="40" class="box"></td></tr>
<% End If
if Request.QueryString("type") = "vote" then
%>
<tr><td bgcolor=<%=CellColor1%> align="right" vAlign="top">投票 :</td>
<td bgcolor=<%=CellColor1%>>每一行文字為一個投票項<br><textarea cols="45" name="VoteItem" rows="5" wrap="VIRTUAL" class="box"><%=trim(txtMsg)%></textarea>
<input name="vote" type="hidden" value="yes"></td></tr>
<%
end if
%>
<tr><td bgcolor=<%=CellColor1%> vAlign="top" align="right"> <br><br>內(nèi)容 :
</td>
<td bgcolor=<%=CellColor1%>>
<img onClick=btn_b() src="images/btn_b.gif" alt="插入粗體字" align="absbottom">
<img onClick=btn_i() src="images/btn_i.gif" alt="插入斜體字" align="absbottom">
<img onClick=btn_url() src="images/btn_url.gif" alt="插入超級鏈接" align="absbottom">
<img onClick=btn_img() src="images/btn_img.gif" alt="插入圖片" align="absbottom">
<img onClick=btn_swf() src="images/btn_swf.gif" alt="插入Flash動畫" align="absbottom">
<img onClick=btn_q() src="images/btn_q.gif" alt="插入引用內(nèi)容" align="absbottom">
<select onChange=showcolor(this.options[this.selectedIndex].value) name=color class="box">
<option style=color:#cc0099 value=#cc0099 Selected>◆深紫◆</option>
<option style=color:#009933 value=#009933>◆深綠◆</option>
<option style=color:#ff9900 value=#ff9900>◆棕色◆</option>
<option style=color:#00cc99 value=#00cc99>◆葉綠◆</option>
<option style=color:#ff9999 value=#ff9999>◆粉紅◆</option>
<option style=color:#cc0066 value=#cc0066>◆深紅◆</option>
<option style=color:#33ccff value=#33aaff>◆天藍◆</option>
<option style=color:#330099 value=#330099>◆深藍◆</option>
<option style=color:#333333 value=#333333>◆深灰◆</option>
</select>
<select onChange=showsize(this.options[this.selectedIndex].value) name=size class="box">
<option value=1> 1 </option>
<option value=2 selected> 2 </option>
<option value=3> 3 </option>
<option value=4> 4 </option>
<option value=5> 5 </option>
<option value=6> 6 </option>
</select>
<br>
<%
if Request.QueryString("type") = "quotetopic" then
set my_conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open ConnString
strSql ="SELECT T_Message, T_date, T_Originator from Topics where Topic_id = " & Request.QueryString("topic_id")
set rsMsg = my_conn.Execute (strSql)
txtmsg = rsMsg("T_date")&"說道:"&"<br><br>"&rsMsg("T_Message")
strSql = "SELECT M_Name from Members where Member_id= "&rsMsg("T_originator")
set rsMsg = my_conn.Execute (strSql)
txtmsg = "[quote]"&rsMsg("M_Name")&"在"&txtmsg&"[/quote]" &CHR(10)
set rsMsg = nothing
End if
if Request.QueryString("type") = "quotereply" then
set my_conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open ConnString
strSql ="SELECT R_Message, R_Posted, R_Posted_By from Reply where Reply_id = " & Request.QueryString("reply_id")
set rsMsg = my_conn.Execute (StrSql)
txtmsg = rsMsg("R_Posted")&"說道:"&"<br><br>"&rsMsg("R_Message")
strSql = "SELECT M_Name from Members where Member_id= "&rsMsg("R_Posted_By")
set rsMsg = my_conn.Execute (strSql)
txtmsg = "[quote]"&rsMsg("M_Name")&"在"&txtmsg&"[/quote]" &CHR(10)
set rsMsg = nothing
End if
%>
<textarea cols="80" name="Message" rows="16" wrap="VIRTUAL" class="box"><%=trim(txtMsg)%></textarea><br>
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="sft"><tr><td>
<%
for i = 1 to 16
if i =9 then Response.Write "<br>"
Response.Write "<img src=""emot/em" & i & ".gif"" onClick=""insertstr(':em" & i &":')""> "
next
%>
←點擊插入心情符<br></td></tr></table>
<input name="Sig" type="checkbox" value="yes" checked>包含我的個性簽名<br>
<%
if (Request.QueryString("method") = "Topic") then
%>
<input name="notreply" type="checkbox" value="yes">禁止別人回復(fù)本主題
<%
end if
%>
</td></tr></table>
<input name="forum_id" type="hidden" value="<%=Request.QueryString("forum_id") %>">
<input name="forum_title" type="hidden" value="<%=Request.QueryString("forum_title") %>">
<input name="method_type" type="hidden" value="<%=Request.QueryString("method") %>">
<input name="Author" type="hidden" value="<%=Request.QueryString("auth") %>">
<input name="topic_id" type="hidden" value="<%=Request.QueryString("topic_id") %>">
<input name="topic_title" type="hidden" value="<%=Request.QueryString("topic_title") %>">
<input name="reply_id" type="hidden" value="<%=Request.QueryString("reply_id") %>">
<input name="refer" type="hidden" value="<%=Request.ServerVariables("HTTP_REFERER") %>">
<input name="Submit" type="submit" value="確 定" class="btn">
<input name="Reset" type="reset" value="清 除" class="btn"> </td></tr></table></form>
<%
if (Request.QueryString("method") = "reply") then
set my_conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open ConnString
mySQL=request("strSQL")
IF mySQL="" THEN
mySQL=SQLtemp
END IF
Function FormatStr(String)
on Error resume next
String = Replace(String, CHR(13), "")
String = Replace(String, CHR(10) & CHR(10), "</P><P>")
String = Replace(String, CHR(10), "<BR>")
FormatStr = String
End Function
Function DoDropDown(tblName, DispField, ValueField, SelVal, name)
StrSQL = "SELECT " & DispField & ", " & ValueField
StrSQl = StrSQL & " FROM " & tblName
rsdrop.Open strSQL, my_Conn
Response.Write "<Select Name='" & name & "'>"
if rsdrop.EOF or rsdrop.BOF then
Response.Write "<Option>無任何選項</option>" & vbcrlf
Else
do until rsdrop.EOF
if rs(ValueField) = cint(SelVal) then
Response.Write "<option value='" & rsdrop(ValueField) & "' Selected>"
Response.Write rsdrop(DispField) & "</option>" & vbcrlf
Else
Response.Write "<option value='" & rsdrop(ValueField) & "'>"
Response.Write rsdrop(DispField) & "</option>" & vbcrlf
End if
rsdrop.MoveNext
loop
End if
Response.Write "</select>" & vbcrlf
rsdrop.Close
set rsdrop = nothing
End Function
Sub GetFirst
strSql = "SELECT Members.M_Name,Members.M_ICQ, Members.Member_id, Topics.T_date, Topics.T_subject, Topics.T_Message, Topics.T_Originator, Topics.Topic_ID "
strSql = strSql & "FROM Members INNER JOIN Topics ON Members.Member_id = Topics.T_Originator "
strSql = strSql & "where topics.topic_id = " & Request.QueryString("topic_id")
set rs = my_conn.Execute (strSql)
If rs.Eof or rs.Bof then
Response.Write "<tr><td colspan=2>無任何話題</td></tr>"
Else
Response.Write "<tr><td bgcolor='" & CellColor1 & "' valign=""top"">" & rs("M_name") & "</td>"
Response.Write "<td bgcolor='" & CellColor1 & "' valign='top'>發(fā)表于:" & rs("T_Date") & ""
Response.Write "<hr noshade size=1>" & formatStr(rs("T_Message")) & "</td>"
Response.Write "</tr></TD></TR>"
End If
set rs = nothing
End Sub
%>
<table align=center bgcolor=<%=TableColor%> border="0" width=<%=TableWidth%> cellspacing="1" cellpadding="3" class="sft" style='TABLE-LAYOUT: fixed'>
<tr><td align="center" bgcolor="<% =HeadColor %>" class="sfh" width="150">原文作者</td>
<td align="center" bgcolor="<% =HeadColor %>" class="sfh">原文主題:<%=Request.QueryString("Topic_title")%></td></tr>
<%
Call GetFirst
%>
</table><br><br>
<%
strSql ="SELECT Members.M_Name, Members.M_ICQ, Reply.Reply_ID, Reply.R_Posted_By, Reply.Topic_ID, Reply.R_Message, Reply.R_Posted "
strSql = strSQl & "FROM Members INNER JOIN Reply ON Members.Member_id = Reply.R_Posted_By "
strSql = strSQl & "where topic_id = " & Request.QueryString("topic_id") & " order by reply.R_Posted DESC"
set rs = Server.CreateObject("ADODB.Recordset")
rs.cachesize=15
rs.open strSQL, my_conn, 3
i = 0
If rs.Eof or rs.Bof then
Response.Write ""
Else
%>
<table align=center bgcolor=<%=TableColor%> border="0" width=<%=TableWidth%> cellspacing="1" cellpadding="3" class="sft" style='TABLE-LAYOUT: fixed'>
<tr bgcolor="<%=HeadColor%>"><td width=150></td><td align="center" class="sfh">最后回復(fù) (當(dāng)前設(shè)置為:只顯示最后<%=ReplyView%>個)<br></td></tr>
<%
rs.movefirst
rec = 0
do until rs.Eof or rec = ReplyView
if i = 0 then
CColor = CellColor2
else
CColor = CellColor1
End if
Response.Write "<tr><td bgcolor='" & CColor & "' valign=top>" & rs("M_name") & "</td>"
Response.Write "<td bgcolor='" & CColor & "' valign='top'>發(fā)表于:" & rs("R_Posted") & ""
Response.Write "<hr noshade size=1>" & formatStr(rs("R_Message")) & "</td></tr>"
rs.MoveNext
i = i + 1
if i = 2 then i = 0
rec = rec + 1
loop
End If
%>
</table>
<%
end if
my_conn.Close
set my_conn = nothing
set rsMsg = nothing
%>
<!--#include file="copyright.asp" -->
</body></html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -