PageRenderTime 28ms CodeModel.GetById 0ms RepoModel.GetById 1ms app.codeStats 0ms

/Wap/Space/Group.asp

https://github.com/joechen2010/health
ASP | 553 lines | 509 code | 23 blank | 21 comment | 0 complexity | c8e294fa35452f49b3c618d7433b3c88 MD5 | raw file
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <%Response.ContentType = "text/vnd.wap.wml; charset=utf-8"%><?xml version="1.0" encoding="utf-8"?>
  3. <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
  4. <!--#include file="../Conn.asp"-->
  5. <!--#include file="../KS_Cls/Kesion.CommonCls.asp"-->
  6. <!--#include file="../KS_Cls/Kesion.Label.CommonCls.asp"-->
  7. <!--#include file="../KS_Cls/Kesion.SpaceCls.asp"-->
  8. <%
  9. Dim KSCls
  10. Set KSCls = New Group
  11. KSCls.Kesion()
  12. Set KSCls = Nothing
  13. Class Group
  14. Private KS,KSBCls,KSRFObj
  15. Private TotalPut,RS,MaxPerPage
  16. Private CurrentPage
  17. Private ID,Template,TeamName,GroupAdmin
  18. Private Sub Class_Initialize()
  19. Set KS=New PublicCls
  20. Set KSBCls=New BlogCls
  21. Set KSRFObj=New Refresh
  22. End Sub
  23. Private Sub Class_Terminate()
  24. Set KS=Nothing
  25. Set KSBCls=Nothing
  26. Set KSRFObj=Nothing
  27. End Sub
  28. Public Sub Kesion()
  29. If KS.SSetting(0)=0 Then
  30. Call KS.ShowError("对不起!","对不起,本站点关闭空间站点功能!")
  31. End If
  32. ID=KS.ChkClng(KS.S("ID"))
  33. If ID=0 Then Response.End()
  34. Set RS=Server.CreateObject("ADODB.RECORDSET")
  35. RS.Open "Select * From KS_Team Where ID=" & ID,Conn,1,1
  36. If RS.Eof And RS.Bof Then
  37. Call KS.ShowError("对不起!","参数传递出错!")
  38. End If
  39. If RS("Verific")=0 Then
  40. Call KS.ShowError("对不起!","该圈子尚未审核!")
  41. ElseIf RS("Verific")=2 Then
  42. Call KS.ShowError("对不起!","该圈子已被管理员锁定!")
  43. End If
  44. TeamName=RS("TeamName")
  45. GroupAdmin=RS("UserName")
  46. Template="<wml>" &vbcrlf
  47. Template=Template & "<head>" &vbcrlf
  48. Template=Template & "<meta http-equiv=""Cache-Control"" content=""no-Cache""/>" &vbcrlf
  49. Template=Template & "<meta http-equiv=""Cache-Control"" content=""max-age=0""/>" &vbcrlf
  50. Template=Template & "</head>" &vbcrlf
  51. Template=Template & "<card id=""main"" title=""" & TeamName & """>" &vbcrlf
  52. Template=Template & KSRFObj.LoadTemplate(KS.WSetting(26))
  53. Template=KSBCls.ReplaceGroupLabel(RS,Template)
  54. Select Case KS.S("Action")
  55. Case "showtopic"'显示帖子列表
  56. Template=Replace(Template,"{$GroupMain}",ShowTopic)
  57. Case "replay"'回复
  58. Template=Replace(Template,"{$GroupMain}",Replay)
  59. Case "replaysave"'保存回复
  60. Call ReplaySave()
  61. Case "users"'成员列表
  62. Template=Replace(Template,"{$GroupMain}",ShowUser)
  63. Case "join"'申请加入圈子
  64. Template=Replace(Template,"{$GroupMain}",ShowJoin)
  65. Case "joinsave"'保存申请加入圈子
  66. Template=Replace(Template,"{$GroupMain}",JoinSave)
  67. Case "alldeltopic"'删除
  68. Template=Replace(Template,"{$GroupMain}",AllDelTopic)
  69. Case "deltopic"'删除
  70. Template=Replace(Template,"{$GroupMain}",DelTopic)
  71. Case "settop"'置顶设置
  72. Call SetTop()
  73. Case "setbest"'精华设置
  74. Call SetBest()
  75. Case "post"'发表新贴
  76. Template=Replace(Template,"{$GroupMain}",ShowPost)
  77. Case "connectpost"
  78. Template=Replace(Template,"{$GroupMain}",ConnectPost)
  79. Case "connectpostsave"
  80. Template=Replace(Template,"{$GroupMain}",ConnectPostSave)
  81. Case "topicsave"'保存发表
  82. Template=Replace(Template,"{$GroupMain}",TopicSave)
  83. Case "info"'圈子信息
  84. Template=Replace(Template,"{$GroupMain}",ShowInfo)
  85. Case Else'圈子主题列表
  86. Template=Replace(Template,"{$GroupMain}",TeamTopic)
  87. End Select
  88. Template=Template & "</card>" &vbcrlf
  89. Template=Template & "</wml>" &vbcrlf
  90. Response.Write Template
  91. RS.Close:Set RS=Nothing
  92. End Sub
  93. Function Replay()
  94. Dim Tid:Tid=KS.Chkclng(KS.S("Tid"))
  95. Replay = "【回复话题】<br/>"
  96. IF Cbool(KSUser.UserLoginChecked)=false Then
  97. Replay = Replay &"登录后才可以参与该话题的讨论,如要参与讨论请先<a href=""../User/Login/?../Space/Group.asp?Action=replay&amp;ID=" & ID & "&amp;Tid=" & Tid & """>登录</a>到会员中心!"
  98. Else
  99. On Error Resume Next
  100. 'Replay = Replay &"Re:" & Conn.Execute("select Title from KS_TeamTopic where ID="& Tid )(0) & "<br/>"
  101. Replay = Replay &"回复内容:<input name=""Content" & Minute(Now) & Second(Now) & """ type=""text"" maxlength=""300"" emptyok=""false"" value=""""/>"
  102. Replay = Replay &"<anchor>回复<go href=""Group.asp?action=replaysave&amp;ID=" & ID & "&amp;Tid=" & Tid & "&amp;" & KS.WapValue & """ method=""post"">"
  103. Replay = Replay &"<postfield name=""Title"" value=""Re:" & Conn.Execute("select Title from KS_TeamTopic where ID="& Tid )(0) & """/>"
  104. Replay = Replay &"<postfield name=""Content"" value=""$(Content" & Minute(Now) & Second(Now) & ")""/>"
  105. Replay = Replay &"</go></anchor><br/>"
  106. End If
  107. End Function
  108. '保存回复
  109. Function ReplaySave()
  110. Dim Tid:Tid=KS.chkclng(KS.S("Tid"))
  111. Dim Title:Title=KS.S("Title")
  112. Dim Content:Content=KS.S("Content")
  113. If Content="" Then
  114. ReplaySave="请输入回复内容!"
  115. Exit Function
  116. End If
  117. If Cbool(KSUser.UserLoginChecked)=false Then
  118. ReplaySave="请先登录!"
  119. Exit Function
  120. End If
  121. Dim UserName:UserName=KS.R(KSUser.UserName)
  122. Dim RS:set RS=server.createobject("adodb.recordset")
  123. RS.Open "select * from KS_TeamTopic",Conn,1,3
  124. RS.Addnew
  125. RS("ParentID")=Tid
  126. RS("TeamID")=ID
  127. RS("Title")=Title
  128. RS("Content")=Content
  129. RS("Adddate")=Now
  130. RS("UserIP")=KS.GetIP
  131. RS("Status")=1
  132. RS("UserName")=UserName
  133. RS("IsBest")=0
  134. RS("IsTop")=0
  135. RS.Update
  136. RS.Close:set RS=Nothing
  137. Response.Redirect KS.GetDomain&"Space/Group.asp?Action=showtopic&ID="& ID & "&Tid=" & Tid & "&" & KS.WapValue & ""
  138. End Function
  139. Function ShowJoin()
  140. IF Cbool(KSUser.UserLoginChecked)=false Then
  141. ShowJoin = "对不起,申请加入圈子之前必须先<a href=""../User/Login/?../Space/Group.asp?Action=showpost&amp;ID=" & ID & """>登录</a>到会员中心!<br/>"
  142. Exit Function
  143. End If
  144. If Not Conn.Execute("select UserName from KS_TeamUsers where UserName='" & KSUser.UserName & "' And TeamID=" & ID).EOF Then
  145. ShowJoin = "您不能再申请,产生的可能原因如下:<br/>"
  146. ShowJoin = ShowJoin & "您已申请过,未得到圈主的审核;<br/>"
  147. ShowJoin = ShowJoin & "您已是本圈子的成员,不需要再申请;<br/>"
  148. ShowJoin = ShowJoin & "您可能已被圈主邀请,但您还未在会员中心确认;<br/>"
  149. ShowJoin = ShowJoin & "【申请须知】<br/>"
  150. ShowJoin = ShowJoin & RS("Note")
  151. ShowJoin = ShowJoin & "<br/>"
  152. Exit Function
  153. End If
  154. ShowJoin = ShowJoin & "【申请加入】<br/>"
  155. ShowJoin = ShowJoin & "申 请 人:" & KSUser.UserName & "<br/>"
  156. ShowJoin = ShowJoin & "加入理由:<input name=""Reason" & Minute(Now) & Second(Now) & """ type=""text"" maxlength=""30"" value="""" emptyok=""false""/>"
  157. ShowJoin = ShowJoin & "<anchor>提交申请<go href=""Group.asp?ID=" & ID & "&amp;Action=joinsave&amp;" & KS.WapValue & """ method=""post"">"
  158. ShowJoin = ShowJoin & "<postfield name=""UserName"" value=""" & KSUser.UserName & """/>"
  159. ShowJoin = ShowJoin & "<postfield name=""Reason"" value=""$(Reason" & Minute(Now) & Second(Now) & ")""/>"
  160. ShowJoin = ShowJoin & "</go></anchor><br/><br/>"
  161. ShowJoin = ShowJoin & "【申请须知】<br/>"
  162. ShowJoin = ShowJoin & RS("Note")
  163. ShowJoin = ShowJoin & "<br/>"
  164. End Function
  165. '保存申请
  166. Function JoinSave()
  167. Dim id:id=KS.chkclng(KS.S("id"))
  168. Dim UserName:UserName=KS.R(KS.S("UserName"))
  169. Dim Reason:Reason=KS.R(KS.S("Reason"))
  170. If Reason="" Then
  171. JoinSave = "请输入加入圈子的理由!<br/><anchor><prev/>返回重写</anchor><br/>"
  172. Exit Function
  173. End If
  174. Dim RS:set RS=server.createobject("adodb.recordset")
  175. RS.Open "select * from KS_TeamUsers where TeamID=" & id & " And UserName='" & UserName & "'",Conn,1,3
  176. If RS.EOF Then
  177. RS.Addnew
  178. RS("TeamID")=ID
  179. RS("UserName")=UserName
  180. RS("Status")=2 '申请加入
  181. RS("Power")=0 '普通用户
  182. RS("Reason")=Reason
  183. RS("Applydate")=Now
  184. RS.Update
  185. End If
  186. RS.Close:set RS=Nothing
  187. JoinSave = "你的申请已提交,请等待圈主的审核!<br/>"
  188. End Function
  189. '续写
  190. Function ConnectPost()
  191. Dim Tid:Tid=KS.Chkclng(KS.S("Tid"))
  192. Set RST=Conn.Execute("select Content from ks_teamtopic where UserName='"&KSUser.UserName&"' and id="&tid&"")
  193. If RST.EOF Then
  194. ConnectPost = "非法参数!<br/>"
  195. Else
  196. ConnectPost = "非法参数!<br/>"
  197. ConnectPost = ConnectPost & "【贴子续写】<br/>"
  198. ConnectPost = ConnectPost & "尾部内容:" & Right(KS.LoseHtml(RST("Content")),20) & "<br/>"
  199. ConnectPost = ConnectPost & "追加内容:<input name=""Content" & Minute(Now) & Second(Now) & """ type=""text"" maxlength=""500"" value=""""/>"
  200. ConnectPost = ConnectPost & "<anchor>确定<go href=""Group.asp?Action=connectpostsave&amp;ID=" & ID & "&amp;Tid=" & Tid & "&amp;" & KS.WapValue & """ method=""post""><postfield name=""Content"" value=""$(Content" & Minute(Now) & Second(Now) & ")""/></go></anchor><br/>"
  201. End If
  202. RST.Close:Set RST=Nothing
  203. End Function
  204. '续写保存
  205. Function ConnectPostSave()
  206. Dim Tid:Tid=KS.Chkclng(KS.S("Tid"))
  207. Set RST=Conn.Execute("select * from KS_TeamTopic where UserName='"&KSUser.UserName&"' And ID="&Tid&"")
  208. If RST.EOF Then
  209. ConnectPostSave = "非法参数!<br/>"
  210. Else
  211. Dim Content:Content=KS.S("Content")
  212. If Content="" Then
  213. ConnectPostSave = "出错提示,你没有输入续写内容!<br/><anchor><prev/>返回重写</anchor><br/>"
  214. Else
  215. Set RSObj=Server.CreateObject("Adodb.Recordset")
  216. RSObj.Open "select * from KS_TeamTopic where UserName='"&KSUser.UserName&"' And ID="&Tid&"",Conn,1,3
  217. RSObj("Content")=RST("Content") & Content
  218. RSObj.Update:RSObj.Close:Set RSObj=Nothing
  219. ConnectPostSave = "续写成功。<br/><a href=""Group.asp?Action=showtopic&amp;ID="&ID&"&amp;Tid="&Tid&"&amp;" & KS.WapValue & """>贴子查看</a><br/>"
  220. End IF
  221. End If
  222. RST.Close:Set RST=Nothing
  223. End Function
  224. '发表新贴
  225. Function ShowPost()
  226. IF Cbool(KSUser.UserLoginChecked)=false Then
  227. ShowPost = "对不起,发表新贴之前必须先<a href=""../User/Login/?../Space/Group.asp?action=showpost&amp;ID="&ID&""">登录</a>到会员中心!<br/>"
  228. Exit Function
  229. End If
  230. If Conn.Execute("select UserName from KS_TeamUsers where UserName='"& KSUser.UserName & "' And TeamID=" & ID).EOF Then
  231. ShowPost = "对不起,你不是该圈子的成员,没有权利发表话题!<br/>"
  232. Exit Function
  233. ElseIf Conn.Execute("select UserName from KS_TeamUsers where UserName='"& KSUser.UserName & "' And Status<>2 And TeamID=" & ID).EOF Then
  234. ShowPost = "对不起,你提交的申请还未得到确认,没有权利发表话题!<br/>"
  235. Exit Function
  236. End If
  237. ShowPost =""
  238. ShowPost = ShowPost & "话题:<input name=""Topic" & Minute(Now) & Second(Now) & """ type=""text"" maxlength=""50"" emptyok=""false"" value=""""/><br/>"
  239. ShowPost = ShowPost & "内容:<input name=""Content" & Minute(Now) & Second(Now) & """ type=""text"" emptyok=""false"" value=""""/><br/>"
  240. ShowPost = ShowPost & "<anchor>OK,发表<go href=""Group.asp?Action=topicsave&amp;ID=" & ID & "&amp;" & KS.WapValue & """ method=""post"">"
  241. ShowPost = ShowPost & "<postfield name=""UserName"" value=""" & KSUser.UserName &"""/>"
  242. ShowPost = ShowPost & "<postfield name=""Topic"" value=""$(Topic" & Minute(Now) & Second(Now) & ")""/>"
  243. ShowPost = ShowPost & "<postfield name=""Content"" value=""$(Content" & Minute(Now) & Second(Now) & ")""/>"
  244. ShowPost = ShowPost & "</go></anchor><br/>"
  245. ShowPost = ShowPost & "仅该圈子成员可以发起主题,非成员仅可以回复<br/>"
  246. End Function
  247. '保存发表
  248. Function TopicSave()
  249. Dim ID:ID=KS.Chkclng(KS.S("ID"))
  250. Dim Topic:Topic=KS.R(KS.S("Topic"))
  251. Dim Content:Content=KS.S("Content")
  252. IF Topic="" Then
  253. TopicSave = "请输入讨论话题!<br/><anchor><prev/>返回重写</anchor><br/>"
  254. End If
  255. IF Content="" Then
  256. TopicSave = "请输入讨论内容!<br/><anchor><prev/>返回重写</anchor><br/>"
  257. End If
  258. Dim RS:set RS=Server.Createobject("adodb.recordset")
  259. RS.Open "select * from KS_TeamTopic",Conn,1,3
  260. RS.Addnew
  261. RS("Title")=Topic
  262. RS("Content")=Content
  263. RS("TeamID")=ID
  264. RS("ParentID")=0
  265. RS("UserName")=KS.S("UserName")
  266. RS("Adddate")=now
  267. RS("UserIP")=KS.GetIP
  268. RS("Status")=1
  269. RS("IsBest")=0
  270. RS("IsTop")=0
  271. RS.Update
  272. RS.Close:set RS=Nothing
  273. TopicSave = "您的讨论话题发表成功!<br/>"
  274. End Function
  275. '圈子信息
  276. Function ShowInfo()
  277. ShowInfo = "【圈子信息】<br/>"
  278. ShowInfo = ShowInfo &"<img src=""" & RS("PhotoUrl") & """ alt=""""/><br/>"
  279. 'ShowInfo = ShowInfo &"圈子名称:" & RS("TeamName") & "<br/>"
  280. ShowInfo = ShowInfo &"创 建 者:" & RS("UserName") & "<br/>"
  281. ShowInfo = ShowInfo &"创建时间:" & RS("Adddate") & "<br/>"
  282. ShowInfo = ShowInfo &"成员人数:" & Conn.Execute("select Count(UserName) from KS_TeamUsers where status=3 And TeamID=" & RS("ID"))(0) & "<br/>"
  283. ShowInfo = ShowInfo &"主题回复:" & Conn.Execute("select Count(*) from KS_TeamTopic where ParentID=0 and TeamID=" & ID )(0) & "/" & Conn.Execute("select count(*) from KS_TeamTopic where ParentID<>0 and TeamID=" & ID )(0) & "<br/>"
  284. ShowInfo = ShowInfo &"【管 理 员】<br/>"
  285. Dim RSU:set RSU=Server.Createobject("adodb.recordset")
  286. RSU.Open "select * from KS_User where UserName='" & RS("UserName") &"'",Conn,1,1
  287. If Not RSU.EOF Then
  288. 'Dim UserFaceSrc:UserFaceSrc=RSU("UserFace")
  289. 'Dim FaceWidth:FaceWidth=KS.ChkClng(RSU("FaceWidth"))
  290. 'Dim FaceHeight:FaceHeight=KS.ChkClng(RSU("FaceHeight"))
  291. 'If Ucase(Left(UserFaceSrc,4))<>"http" Then UserFaceSrc="../" & UserFaceSrc
  292. 'ShowInfo = ShowInfo &"<img src=""" & UserFaceSrc & """ width=""" & FaceWidth & """ height=""" & FaceHeight & """ alt=""""/><br/>"
  293. ShowInfo = ShowInfo &"<a href=""index.asp?u=" & RSU("UserName") & "&amp;" & KS.WapValue & """>" & RS("UserName") & "(" & RSU("Province") & RSU("City") & ")</a><br/>"
  294. End If
  295. RSU.Close:set RSU=Nothing
  296. End Function
  297. Function AllDelTopic()
  298. IF Cbool(KSUser.UserLoginChecked)=false Then
  299. AllDelTopic = "对不起,请先登录!<br/>"
  300. Exit Function
  301. End If
  302. Dim Tid:Tid=KS.Chkclng(KS.S("Tid"))
  303. If Tid=0 Then Response.End
  304. Dim RST:set RST=server.createobject("adodb.recordset")
  305. RST.Open "select * from KS_TeamTopic where ID=" & Tid,Conn,1,3
  306. If Not RST.EOF Then
  307. If RST("UserName")=KSUser.UserName or KSUser.UserName=GroupAdmin Then
  308. Conn.Execute("delete from KS_TeamTopic where ParentID=" & Tid & "")
  309. RST.Delete
  310. Else
  311. RST.Close:Set RST=Nothing
  312. AllDelTopic = "对不起,你没有删除的权限<br/>"
  313. End If
  314. End If
  315. RST.Close:Set RST=Nothing
  316. Response.Redirect KS.GetDomain&"Space/Group.asp?ID="& ID & "&" & KS.WapValue & ""
  317. End Function
  318. Function DelTopic()
  319. IF Cbool(KSUser.UserLoginChecked)=false Then
  320. DelTopic = "对不起,请先登录!<br/>"
  321. Exit Function
  322. End If
  323. Dim Pid:Pid=KS.Chkclng(KS.S("Pid"))
  324. If Pid=0 Then Response.End
  325. Dim RST:set RST=server.createobject("adodb.recordset")
  326. RST.Open "select * from KS_TeamTopic where ID=" & Pid,Conn,1,3
  327. If Not RST.EOF Then
  328. If RST("UserName")=KSUser.UserName or KSUser.UserName=GroupAdmin Then
  329. RST.Delete
  330. Else
  331. RST.Close:Set RST=Nothing
  332. DelTopic = "对不起,你没有删除的权限<br/>"
  333. End If
  334. End If
  335. RST.Close:Set RST=Nothing
  336. Response.Redirect KS.GetDomain&"Space/Group.asp?Action=showtopic&ID="& ID & "&Tid=" & KS.Chkclng(KS.S("Tid")) & "&" & KS.WapValue & ""
  337. End Function
  338. '置顶设置
  339. Sub SetTop()
  340. Dim Tid:Tid=KS.Chkclng(KS.S("Tid"))
  341. Dim RS:set RS=Server.Createobject("adodb.recordset")
  342. RS.Open "select IsTop from KS_TeamTopic where ID=" & Tid,Conn,1,3
  343. If Not RS.EOF Then
  344. If RS(0)=1 Then
  345. RS(0)=0
  346. Else
  347. RS(0)=1
  348. End If
  349. RS.Update
  350. End If
  351. RS.Close:set RS=Nothing
  352. Response.Redirect "Group.asp?Action=showtopic&ID="& ID & "&Tid=" & Tid & "&" & KS.WapValue & ""
  353. End Sub
  354. '精华设置
  355. Sub SetBest()
  356. Dim Tid:Tid=KS.Chkclng(KS.S("Tid"))
  357. Dim RS:set RS=Server.Createobject("adodb.recordset")
  358. RS.Open "select IsBest from KS_TeamTopic where ID=" & Tid,Conn,1,3
  359. If Not RS.EOF Then
  360. If RS(0)=1 Then
  361. RS(0)=0
  362. Else
  363. RS(0)=1
  364. End If
  365. RS.Update
  366. End If
  367. RS.Close:set RS=Nothing
  368. Response.Redirect "Group.asp?Action=showtopic&ID="& ID & "&Tid=" & Tid & "&" & KS.WapValue & ""
  369. End Sub
  370. '圈子主题列表
  371. Function TeamTopic()
  372. MaxPerPage =10
  373. If KS.S("page") <> "" Then
  374. CurrentPage = KS.ChkClng(KS.G("page"))
  375. Else
  376. CurrentPage = 1
  377. End If
  378. Dim Param:Param=" where TeamID=" & ID & " And ParentID=0"
  379. If KS.Chkclng(KS.S("IsBest"))=1 Then Param=Param & " And IsBest=1 "
  380. Dim RSObj:Set RSObj=Server.CreateObject("ADODB.RECORDSET")
  381. RSObj.Open "select * from KS_TeamTopic "& Param & " Order by IsTop desc,Adddate desc" ,Conn,1,1
  382. If RSObj.EOF And RSObj.Bof Then
  383. TeamTopic = "没有任何讨论话题! <br/>"
  384. Else
  385. TotalPut = RSObj.RecordCount
  386. If CurrentPage < 1 Then CurrentPage = 1
  387. If (CurrentPage - 1) * MaxPerPage > totalPut Then
  388. If (TotalPut Mod MaxPerPage) = 0 Then
  389. CurrentPage = TotalPut \ MaxPerPage
  390. Else
  391. CurrentPage = TotalPut \ MaxPerPage + 1
  392. End If
  393. End If
  394. If CurrentPage >1 And (CurrentPage - 1) * MaxPerPage < TotalPut Then
  395. RSObj.Move (CurrentPage - 1) * MaxPerPage
  396. Else
  397. CurrentPage = 1
  398. End If
  399. Dim I
  400. Do While Not RSObj.EOF
  401. If RSObj("IsTop")=1 Then TeamTopic = TeamTopic & "[顶]"
  402. If RSObj("isbest")=1 Then TeamTopic = TeamTopic & "[精]"
  403. TeamTopic = TeamTopic & "<a href=""Group.asp?Action=showtopic&amp;ID=" & ID & "&amp;Tid=" & RSObj("ID") & "&amp;" & KS.WapValue & """>" & ((I+1)+CurrentPage*MaxPerPage)-MaxPerPage &"." & RSObj("Title") & "(" & Conn.Execute("select Count(id) from KS_TeamTopic where ParentID=" & RSObj("ID"))(0) & ")</a><br/>"
  404. 'TeamTopic = TeamTopic & "作者:<a href=""Space.asp?UserName=" & RSObj("UserName") & "&amp;" & KS.WapValue & """>" & RSObj("UserName") & "</a> "
  405. 'TeamTopic = TeamTopic & "" & KS.DateFormat(RSObj("AddDate"),17) & "<br/>"
  406. RSObj.MoveNext
  407. I = I + 1
  408. If I >= MaxPerPage Then Exit Do
  409. Loop
  410. TeamTopic = TeamTopic & KS.ShowPagePara(TotalPut, MaxPerPage, "Group.asp", True, "个", CurrentPage, "ID=" & ID & "&amp;IsBest=" & IsBest & "&amp;" & KS.WapValue & "")
  411. TeamTopic = TeamTopic & "<br/>"
  412. End If
  413. RSObj.Close:Set RSObj=Nothing
  414. End Function
  415. '会员列表
  416. Function ShowUser()
  417. MaxPerPage =10
  418. If KS.S("page") <> "" Then
  419. CurrentPage = KS.ChkClng(KS.G("page"))
  420. Else
  421. CurrentPage = 1
  422. End If
  423. Dim RSObj:set RSObj=server.createobject("adodb.recordset")
  424. RSObj.open "select * from KS_TeamUsers where TeamID=" &ID & " and Status=3",Conn,1,1
  425. If Not RSObj.EOF Then
  426. TotalPut = RSObj.RecordCount
  427. If CurrentPage < 1 Then CurrentPage = 1
  428. If (CurrentPage - 1) * MaxPerPage > totalPut Then
  429. If (TotalPut Mod MaxPerPage) = 0 Then
  430. CurrentPage = TotalPut \ MaxPerPage
  431. Else
  432. CurrentPage = TotalPut \ MaxPerPage + 1
  433. End If
  434. End If
  435. If CurrentPage >1 And (CurrentPage - 1) * MaxPerPage < TotalPut Then
  436. RSObj.Move (CurrentPage - 1) * MaxPerPage
  437. Else
  438. CurrentPage = 1
  439. End If
  440. Dim I
  441. Do While Not RSObj.EOF
  442. ShowUser = ShowUser & "<a href=""Space.asp?UserName="&RSObj("UserName")&"&amp;" & KS.WapValue & """>"&RSObj("UserName")&"</a><br/>"
  443. RSObj.MoveNext
  444. I = I + 1
  445. If I >= MaxPerPage Then Exit Do
  446. Loop
  447. ShowUser = ShowUser & KS.ShowPagePara(TotalPut, MaxPerPage, "Group.asp", True, "个", CurrentPage, "Action=ShowUsers&amp;ID=" & ID & "&amp;IsBest=" & IsBest & "&amp;" & KS.WapValue & "")
  448. ShowUser = ShowUser & "<br/>"
  449. End If
  450. RSObj.Close:Set RSObj=Nothing
  451. End Function
  452. '显示帖子列表
  453. Function ShowTopic()
  454. Dim Tid:Tid=KS.Chkclng(KS.S("Tid"))
  455. Dim RS:set RS=server.createobject("adodb.recordset")
  456. RS.Open "select b.UserName,b.UserFace,b.UserID,a.* from KS_TeamTopic a ,KS_User b where a.UserName=b.UserName And a.ID=" &Tid,Conn,1,1
  457. If RS.EOF And RS.BOF Then
  458. RS.Close:set RS=Nothing
  459. ShowTopic = "参数传递出错!<br/>"
  460. Exit Function
  461. End If
  462. ShowTopic = "<b>"&RS("Title")&"</b><br/>"
  463. If KS.Chkclng(KS.S("Page"))<1 Then
  464. ShowTopic = ShowTopic & "作者:<a href=""Space.asp?UserName=" & RS(0) & "&amp;" & KS.WapValue & """>" & RS(0) & "</a> " & KS.DateFormat(RS("Adddate"),17) & "<br/>"
  465. Dim Content
  466. Content=KS.UBBToHTML(KS.LoseHtml(KS.HTMLToUBB(KS.ReplaceTrim(KS.GetEncodeConversion(RS("Content"))))))
  467. ShowTopic = ShowTopic & ""&KS.ContentPagination(Content,200,"Group.asp?Action=showtopic&amp;ID="& ID &"&amp;Tid=" & RS("ID") & "&amp;" & KS.WapValue & "",False,False)&""
  468. ShowTopic = ShowTopic & "<br/>"
  469. End If
  470. If Cbool(KSUser.UserLoginChecked)=False Then
  471. ShowTopic = ShowTopic & "登录后才可以参与该贴子的讨论!如要参与讨论请先<a href=""../User/Login/?../Space/Group.asp?Action=showtopic&amp;ID="&ID&"&amp;Tid="&Tid&""">免费注册登陆</a>!<br/>"
  472. Else
  473. ShowTopic = ShowTopic & "<a href=""Group.asp?Action=replay&amp;ID="&ID&"&amp;Tid="&RS("ID")&"&amp;" & KS.WapValue & """>回复(" & Conn.Execute("select Count(ID) from KS_TeamTopic where ParentID=" & Tid)(0) & ")</a> "
  474. End If
  475. If RS(0)=KSUser.UserName or KSUser.UserName=GroupAdmin Then
  476. ShowTopic = ShowTopic & "<a href=""Group.asp?Action=connectpost&amp;ID="&ID&"&amp;Tid="&RS("ID")&"&amp;" & KS.WapValue & """>续写</a> "
  477. ShowTopic = ShowTopic & "<a href=""Group.asp?Action=alldeltopic&amp;ID="&ID&"&amp;Tid="&RS("ID")&"&amp;" & KS.WapValue & """>删除</a> "
  478. If KSUser.UserName=GroupAdmin Then
  479. If RS("istop")=1 Then
  480. ShowTopic = ShowTopic & "<a href=""Group.asp?Action=settop&amp;ID="&ID&"&amp;tid="&RS("ID")&"&amp;" & KS.WapValue & """>取消置顶</a> "
  481. Else
  482. ShowTopic = ShowTopic & "<a href=""Group.asp?Action=settop&amp;ID="&ID&"&amp;tid="&RS("ID")&"&amp;" & KS.WapValue & """>设为置顶</a> "
  483. End If
  484. If RS("isbest")=1 Then
  485. ShowTopic = ShowTopic & "<a href=""Group.asp?Action=setbest&amp;ID="&ID&"&amp;tid="&RS("ID")&"&amp;" & KS.WapValue & """>取消精华</a>"
  486. Else
  487. ShowTopic = ShowTopic & "<a href=""Group.asp?Action=setbest&amp;ID="&ID&"&amp;tid="&RS("ID")&"&amp;" & KS.WapValue & """>设为精华</a>"
  488. End If
  489. End If
  490. End If
  491. ShowTopic = ShowTopic & "<br/>"
  492. MaxPerPage=10
  493. CurrentPage=KS.ChkClng(KS.S("Page"))
  494. If CurrentPage<=0 Then CurrentPage=CurrentPage+1
  495. Dim RSP:set RSP=Server.Createobject("adodb.recordset")
  496. RSP.Open "select b.UserName,b.UserID,b.UserFace,a.* from KS_TeamTopic a, KS_User b where a.UserName=b.UserName and ParentID=" & Tid & " order by Adddate desc",Conn,1,1
  497. If Not RSP.EOF Then
  498. TotalPut = RSP.Recordcount
  499. If CurrentPage < 1 Then CurrentPage = 1
  500. If (CurrentPage - 1) * MaxPerPage > totalPut Then
  501. If (TotalPut Mod MaxPerPage) = 0 Then
  502. CurrentPage = TotalPut \ MaxPerPage
  503. Else
  504. CurrentPage = TotalPut \ MaxPerPage + 1
  505. End If
  506. End If
  507. If CurrentPage >1 And (CurrentPage - 1) * MaxPerPage < TotalPut Then
  508. RSP.Move (CurrentPage - 1) * MaxPerPage
  509. Else
  510. CurrentPage = 1
  511. End If
  512. Do While Not RSP.EOF
  513. ShowTopic = ShowTopic & KS.LoseHtml(KS.HTMLCode(RSP("Content"))) & "<br/>"
  514. ShowTopic = ShowTopic & "<a href=""Space.asp?UserName=" & RSP(0) & "&amp;" & KS.WapValue & """>" & RSP(0) & "</a> " & KS.DateFormat(RSP("Adddate"),17) & ""
  515. If RS(0)=KSUser.UserName or KSUser.UserName=GroupAdmin Then
  516. ShowTopic = ShowTopic & "<a href=""Group.asp?Action=deltopic&amp;ID=" & ID & "&amp;Tid=" & RS("ID") & "&amp;Pid=" & RSP("ID") & "&amp;" & KS.WapValue & """>删除</a>"
  517. End If
  518. ShowTopic = ShowTopic & "<br/>"
  519. RSP.MoveNext
  520. I = I + 1
  521. If I >= MaxPerPage Then Exit Do
  522. Loop
  523. ShowTopic = ShowTopic & KS.ShowPagePara(TotalPut, MaxPerPage, "Group.asp", True, "个", CurrentPage, "Action=showtopic&amp;ID=" & ID & "&amp;Tid=" & Tid & "&amp;" & KS.WapValue & "")
  524. ShowTopic = ShowTopic & "<br/>"
  525. End If
  526. RSP.Close:set RSP=Nothing
  527. RS.Close:set RS=Nothing
  528. End Function
  529. End Class
  530. %>