Say.Asp
上传用户:btntkt
上传日期:2021-04-16
资源大小:5296k
文件大小:12k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

DOS

  1. <!--#include file="Inc/SysConfig.Asp"-->
  2. <script type="text/javascript" src="inc/Editor/htmlEditor.js"></script>
  3. <script type="text/javascript">
  4. var editor = new htmlEditor("editor");
  5. editor.hiddenName = "content";
  6. editor.width = "100%";
  7. editor.height = "250px";
  8. editor.imagePath="inc/editor/images/";
  9. editor.iconPath = 'inc/editor/images/face/';
  10. </script><%
  11. Dim Caption,Action,Submiturl,bbsCaption,ThisFace,IsTitle,BbsContent,Quote,Page,bbsVote,ID,Rs,rs1
  12. If Not YxBBs.Founduser then YxBBs.Error("您还没有注册或者登陆!")
  13. YxBBs.CheckBoard()
  14. ID=YxBBs.CheckNum(Request.QueryString("ID"))
  15. Page=YxBBs.CheckNum(Request.QueryString("page"))
  16. IsTitle=True
  17. Action=lcase(Request.QueryString("action"))
  18. Select Case Action
  19. Case"vote"
  20. Vote()
  21. Case"reply"
  22. Reply()
  23. Case"edit"
  24. Edit()
  25. Case Else
  26. YxBBs.Stats="发表新帖"
  27. Caption=YxBBs.Stats
  28. bbsCaption="<input name='Caption' type='text' style='width:80%' maxlength=200>"
  29. Submiturl="Save.Asp?BoardID="&YxBBs.BoardID&""
  30. End Select
  31. YxBBs.Head(YxBBs.Stats)
  32. Set Rs=YxBBs.Execute("Select Name,GradeNum From [YX_user]where Name='"&YxBBs.MyName&"' And PassWord='"&YxBBs.MyPwd&"' And ID="&YxBBs.MyID&"")
  33. ShowMain()
  34. YxBBs.Footer()
  35. Set YxBBs=Nothing
  36. Sub Vote()
  37. Dim Temp,i
  38. Temp=YxBBs.BoardSetting(4)
  39. If Cint(YxBBs.ClassSetting(3))=0 Then YxBBs.Error("您没有查看投票的权限!")
  40. bbsVote="<tr><td valign=top><br><b>&nbsp;投票选项:<b></td><td>&nbsp;请选择投票项目数:<SELECT align=absmiddle name=VoteNum id=VoteNum onchange=SetNum(this)>"
  41. for i = 2 to int(Temp)
  42. bbsVote=bbsVote&"<option value='"&I&"'>"&I&"</option>"
  43. Next
  44. bbsVote=bbsVote&"</SELECT> 允许多选 <input type='checkbox' name='VoteType' value='2'> 过期时间:<select size='1' name='OutTime' ><option value='1'>一天</option><option value='3'>三天</option><option value='7'>一周</option><option value='15'>半个月</option><option value='31'>一个月</option><option value='93'>三个月</option><option value='365'>一年</option><option value='10000' selected>不过期</option></select><hr size=1 width='98%'><span id=optionid><table cellpadding=0 cellspacing=3 width='100%' border=0><tr><td>选项1:</td><td><input type='text' name='Votes1' style='width:300'></td></tr><tr><td>选项2:</td><td><input type='text' name='Votes2' style='width:300'><INPUT TYPE='hidden' name='AutoValue' value='2'></td></tr></table></span></td></tr>"
  45. YxBBs.Stats="发表新投票"
  46. Caption="发表新投票"
  47. bbsCaption="<input name='Caption' type=text style='width:80%' maxlength=200>"
  48. Submiturl="Save.Asp?BoardID="&YxBBs.BoardID
  49. End Sub
  50. Sub Reply()
  51. Dim Rs,BbsID,TopicCaption
  52. if Id=0 Then YxBBs.Error("错误的地址栏参数,请不要手动去更改地址栏参数!")
  53. If Cint(YxBBs.ClassSetting(3))=0 Then YxBBs.Error(12)
  54. YxBBs.Stats="回复帖子"
  55. IsTitle=False
  56. Set Rs=YxBBs.Execute("Select Caption,SqlTableID,IsLock From [YX_Topic] where TopicID="&ID)
  57. If Rs.Eof Then
  58. YxBBs.Error("该帖子不存在或已经删除!")
  59. ElseIf Rs(2) Then
  60. YxBBs.Error("该帖子已经被锁定!")
  61. Else
  62. TopicCaption=Rs(0)
  63. YxBBs.TB=Rs(1)
  64. End If
  65. Set Rs=Nothing
  66. bbsCaption=" <input type=hidden name='Caption' value='Re:"&TopicCaption&"'>"
  67. Caption="回复主题:"&TopicCaption
  68. Submiturl="Save.Asp?Action=Reply&BoardID="&YxBBs.BoardID&"&TB="&YxBBs.TB&"&ID="&ID&"&page="&page&""
  69. BbsID=YxBBs.CheckNum(Request.QueryString("BbsID"))
  70. If BbsID<>"" Then
  71. Set Rs=YxBBs.Execute("select top 1 B.ReplyTopicID,B.TopicID,B.Name,B.AddTime,B.Content,B.BoardID,U.IsShow from [YX_Bbs"&YxBBs.TB&"] As B inner join [YX_User] As U on B.Name=U.Name where B.BbsID="&BbsID&" And B.IsDel=False")
  72. If Not Rs.Eof Then
  73. If Rs(1)<>ID And Rs(0)<> Id Then YxBBs.Error("错误的地址栏参数,请不要手动去更改地址栏参数!")
  74. If Rs(6) Then
  75. BbsCaption=BbsCaption &"<Font Color=Red>屏蔽内容不能引用</Font>"
  76. Else
  77. BbsCaption=BbsCaption &" <Font Color=Red>引用 "&Rs(2)&" 的发言</Font>"
  78. Quote="<tr><td>&nbsp;<b>引用的内容:<input name='QuoteName' type='hidden' value='[quote]以下是引用  <font color=0000FF>"&Rs(2)&"</font>  在( "&Rs(3)&" )的发言:"&chr(10)&chr(10)&"'></b><br>&nbsp;可以编辑要引用的内容</td><td width='76%'>&nbsp;<TEXTAREA name='Quote'  cols=90 rows='5' style='WIDTH: 95%;'>"&YxBBs.Fun.StrLeft(QuoteCode(Rs(4)),500)&"</textarea></td>"
  79. End If
  80. End if
  81. Set Rs=Nothing
  82. End If
  83. End Sub
  84. Sub Edit()
  85. Dim Rs,BbsID,TopicIsLock,TopicRs,IsTop,Content
  86. BbsID=YxBBs.CheckNum(Request.QueryString("BbsID"))
  87. IF BbsID=0 Or ID=0 Then YxBBs.Error("错误的地址栏参数,请不要手动去更改地址栏参数!")
  88. Set Rs=YxBBs.Execute("Select BoardID,TopType,SqlTableID,IsLock,TitleType,face From [YX_Topic] where IsDel=False And TopicID="&ID)
  89. If Rs.Eof Then
  90. YxBBs.Error("该帖子不存在或已经删除!")
  91. Else
  92. TopicRs=Rs.GetRows(-1)
  93. End If
  94. Rs.Close
  95. '如果是总顶或顶
  96. Set Rs=YxBBs.Execute("select BoardID,Name,AddTime,TopicID,Caption,Content,IsDel From [YX_Bbs"&TopicRs(2,0)&"] where IsDel=False And BbsID="&BbsID&"")
  97. Set Rs1=YxBBs.Execute("select face From [YX_Topic] where TopicID="&ID)
  98. If Rs.eof  Then
  99. YxBBs.Error("该帖子不存在或已经删除!")
  100. Else
  101. If Not(TopicRs(1,0)=5 or TopicRs(1,0)=4) and TopicRs(0,0)<>YxBBs.BoardID Then YxBBs.Error("错误的地址栏参数,请不要手动去更改地址栏参数!")
  102. If lcase(YxBBs.MyName)<>lcase(rs("name")) Then
  103. If Cint(YxBBs.ClassSetting(18))=0 Then YxBBs.Error("您没有编辑别人帖子的权限!")
  104. Else
  105. '编辑自己帖子的权限
  106. If Cint(YxBBs.ClassSetting(9))=0 Then YxBBs.Error("您没有编辑自己帖子的权限!")
  107. End If
  108. If YxBBs.ClassID>2 And Not YxBBs.IsBoardAdmin Then
  109. If YxBBs.BBSSetting(31)<>0 Then If lcase(YxBBs.MyName)=lcase(rs("name")) And DateDiff("s",Rs("AddTime")+YxBBs.BBSSetting(31)/1440,YxBBs.NowBbsTime)>0 Then YxBBs.Error("你超过了允许普通用户编辑自己帖子的时限 (发帖后<Font color=red>"&YxBBs.BBSSetting(31)&"</Font>分钟内)")
  110. If lcase(YxBBs.MyName)=lcase(rs("name")) And TopicRs(3,0) Then YxBBs.Error("该帖子已经被锁定!")
  111. End If
  112. BbsCaption=rs("Caption")
  113. IF Rs("TopicID")=0 Then
  114. IsTitle=False
  115. bbsCaption="<input type=hidden name='Caption' value='"&BbsCaption&"'>编辑回复帖"
  116. Else 
  117. bbsCaption="<input name='Caption' type=text value='"&bbsCaption&"' size=70 maxlength=200><input type=hidden name=OldTitleType value='"&TopicRs(4,0)&"'>"
  118. End If
  119. ThisFace=Rs1("Face")
  120. BbsContent=replaceUBB(rs("Content"))
  121. End if
  122. Rs.Close
  123. YxBBs.Stats="编辑帖子"
  124. Caption=YxBBs.Stats
  125. Submiturl="Save.Asp?Action=Edit&ID="&ID&"&BbsID="&BbsID&"&BoardID="&YxBBs.BoardID&"&TB="&YxBBs.TB&"&page="&page&""
  126. End Sub
  127. Function QuoteCode(str)
  128. Dim re,restr
  129. Set re=new RegExp
  130. re.IgnoreCase=true
  131. re.Global=True
  132. restr="[COLOR=RED]…… 加密内容不能引用 ……[/COLOR]"
  133. re.Pattern="([DATE=(.[^[]*)])(.[^[]*)([/DATE])"
  134. str=re.Replace(str,restr)
  135. re.Pattern="([SEX=*([0-1]*)])(.[^[]*)([/SEX])"
  136. str=re.Replace(str,restr)
  137. re.Pattern="([COIN=*([0-9]*)])(.[^[]*)([/COIN])"
  138. str=re.Replace(str,restr)
  139. re.Pattern="([USERNAME=(.[^[]*)])(.[^[]*)([/USERNAME])"
  140. str=re.Replace(str,restr)
  141. re.Pattern="([GRADE=*([0-9]*)])(.[^[]*)([/GRADE])"
  142. str=re.Replace(str,restr)
  143. re.Pattern="([MARK=*([0-9]*)])(.[^[]*)([/MARK])"
  144. str=re.Replace(str,restr)
  145. re.Pattern="([BUYPOST=*([0-9]*)])(.[^[]*)([/BUYPOST])"
  146. str=re.Replace(str,restr)
  147. re.Pattern=vbcrlf&vbcrlf&vbcrlf&"([RIGHT])([COLOR=(.[^[]*)])(.[^[]*)([/COLOR])([/RIGHT])"
  148. str=re.Replace(str,"")
  149. re.Pattern="(<p align=right><font color=#0080FF>「该帖子被(.*)编辑过」</font></p>)" 
  150. str=re.Replace(str," ")
  151. Str = Replace(Str, chr(10), "")
  152. re.Pattern="([reply])(.+?)([/reply])"
  153. str=re.Replace(str,restr)
  154. set re=Nothing
  155. QuoteCode=str
  156. End Function
  157. Function replaceUBB(str)
  158. dim re
  159. If Str="" Then Exit Function
  160. Set re=new RegExp
  161. re.IgnoreCase=true
  162. re.Global=True
  163. re.Pattern="(>)("&vbNewLine&")(<)"
  164. Str=re.Replace(Str,"$1$3")
  165. re.Pattern="(>)("&vbNewLine&vbNewLine&")(<)"
  166. Str=re.Replace(Str,"$1$3")
  167. re.Pattern=vbNewLine
  168. Str=re.Replace(Str,"<br>")
  169.         re.Pattern="(<p align=right><font color=#0080FF>(.[^[]*)</font></p>)"
  170.         str=re.Replace(str," ")
  171. str=Replace(Str,"  ","&nbsp;&nbsp;")
  172. Set re=Nothing
  173. replaceUBB=str
  174. End function
  175. Function ShowMain()
  176. Dim Temp,Face,I,J,Rs_1
  177.         
  178. Temp=Temp&"<form style='margin:0;' method=POST name='topicform' action='"&Submiturl&"' >"
  179. If IsTitle Then
  180. Temp=Temp&"<tr><td width='24%' height='30'><b>&nbsp;帖子主题:</b><select name=title onChange=DoTitle(this.options[this.selectedIndex].value) style='font-size: 9pt'><option selected value="""">话题</option><option value=[原创]>[原创]</option><option value=[转帖]>[转帖]</option><option value=[讨论]>[讨论]</option><option value=[求助]>[求助]</option><option value=[推荐]>[推荐]</option><option value=[公告]>[公告]</option><option value=[注意]>[注意]</option><option value=[贴图]>[贴图]</option><option value=[建议]>[建议]</option><option value=[下载]>[下载]</option></select></td><td>"
  181. Else
  182. Temp=Temp&Quote&"<tr><td colspan=2 height='30'>"
  183. End If
  184. If Action="reply" Then
  185. Temp=Temp&"&nbsp;"&bbsCaption&"</td></tr>"
  186. Else
  187. Temp=Temp&"&nbsp;"&bbsCaption&"&nbsp;&nbsp;<select name=""topicximoo""><option value=0>标题醒目</option><option value=1>红色醒目</option><option value=2>蓝色醒目</option><option value=3>绿色醒目</option></select></td></tr>"
  188. Temp=Temp&"<tr><td width='24%'>&nbsp;<b>图标:</b></td><td>"
  189. Face="&nbsp;<input name=face type=radio value=99 checked>无&nbsp;<script>for(i=1;i<=9;i=i+1) {document.write(""<input type=radio value=""+i+"" name=face><img border=0 src=images/face/""+i+"".gif>"")}</script>"
  190.         End If
  191. Temp=Temp&Face&"</td></tr>"&bbsVote&"<tr><td>&nbsp;<b>附件上传类型:</b><br>&nbsp;"&Join(Split(YxBBs.BoardSetting(1),"|"),",")&"</td><td>"
  192.         If Int(Rs("GradeNum"))>Int(YxBBs.BBSSetting(36)) then
  193. Temp=Temp&"<table border=0 cellpadding=0 cellspacing=0><tr><td>&nbsp;<iframe Src='ViewFile.Asp?Action=Upload&BoardID="&YxBBs.BoardID&"' scrolling='no' frameborder='0' height='20' width='260'></iframe></td><td>[每日您可以上传 <font color=blue>"&YxBBs.ClassSetting(11)&"</font> 个 小于 <font color=blue>"&YxBBs.ClassSetting(12)&"</font> KB / 每个]</td></tr></table>"
  194.         Else
  195.                Temp=Temp&"您的等级未达到 <B><font Color=red>"&YxBBs.BBSSetting(36)&"级</font></B> 不能上传文件!<br>"
  196.         End if
  197. Temp=Temp&"</td></tr><tr><td valign='top'><table width='100%'  border='0' cellpadding='0' cellspacing='4'><tr><td colspan='2'><b>发特殊帖:</b></td></tr>"
  198. Temp=Temp&"<tr><td rowspan='4' width=10 ></td></tr><tr><td><br><li><a href=javascript:Especial('[Reply]','内容[/Reply]')>回复可见</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=javascript:Especial('[Coin=1000]','内容[/Coin]')>金钱可见</a></li><br><li><a href=javascript:Especial('[Grade=1]','内容[/Grade]')>等级可见</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=javascript:Especial('[Username=昵称]','内容[/Username]')>指定读者</a></li><br><li><a href=javascript:Especial('[Buypost=100]','内容[/Buypost]')>付费可见</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=javascript:Especial('[Date=2006-10-1]','内容[/Date]')>日期可见</a></li><br><li><a href=javascript:Especial('[Sex=1]','内容[/Sex]')>性别可见</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=javascript:Especial('[Login]','内容[/Login]')>登陆可见</a></li></td></tr><tr><td><br><li>帖子内容最多允许:<font color=red>"&YxBBs.BoardSetting(3)/1024&"KB</font></li><br><br><li>如发帖失败,按<font color=bule>Ctrl+v</font>可找回内容!</li></td></tr></table></td>"
  199. Temp=Temp&"<td width='76%' valign='top'><table border='0' cellpadding='0' cellspacing='3'  width='100%'><tr><td colspan='2'>"
  200.         Temp=Temp&"<textarea name='content' cols='40' rows='2' style='display:none'>"&BbsContent&"</textarea><script type=""text/javascript"">editor.show()</script></tr></table></td></tr><tr><td height='40' colspan='2' align='center'>"
  201.         If Action="edit" And (YxBBs.ClassID<=3) Then Temp= Temp & "<input name='EditChalk' type='checkbox' value='No'>不留下编辑标记 "
  202. If Cint(YxBBs.BoardSetting(0))=1 Then Temp=Temp&""&YxBBs.GCode&""
  203. Temp=Temp&"&nbsp;<input class=submit type=button value=OK_!发表 name='B1' onclick='submitform()'>&nbsp;&nbsp;&nbsp; <input class=submit type=button value='预  览!' onclick='preview()' name='B3'>&nbsp;&nbsp;&nbsp; <input class=submit type=reset value=NO_!重写 onclick='Goreset()' name=B2>&nbsp; [ 按 Ctrl+Enter 直接发送 ]" 
  204. Temp=Temp&"<font color=#D8D8D8></font></td></tr></form>"
  205. Call YxBBs.ShowTable(Caption,Temp)
  206. Response.Write"<form style='margin:0;' name='form1' action='See.asp?Action=preview' method='post' target='showgg'><input type='hidden' name='Caption' /><input type='hidden' name='content' /></form>"
  207. End Function
  208. %>