Group_unit.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:14k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../FS_Inc/Const.asp" -->
  3. <!--#include file="../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../FS_Inc/Function.asp" -->
  5. <!--#include file="../FS_Inc/Func_Page.asp"-->
  6. <!--#include file="lib/strlib.asp" -->
  7. <!--#include file="lib/UserCheck.asp" -->
  8. <%'Copyright (c) 2006 Foosun Inc. Code by Einstein.liu
  9. Dim GroupRs,DebateRs,DebateID,GroupID,GroupName,CroupContent,InfoType,ClassType,AddTime,PerPageNum,GroupCreater,GroupManager,isSys,hits,GroupMembers,GroupMembersArray,TempRs,HotGroupNumber,ForwardNumber,ForIndex,GroupManagerArray,re,AppointUserNumber,AppointUserGroup
  10. Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo,i
  11. GroupID=NoSqlHack(Request.QueryString("GDID"))
  12. Set GroupRs=Server.CreateObject(G_FS_RS)
  13. Set DebateRs=Server.CreateObject(G_FS_RS)
  14. GroupRs.open "select gdID,title,content,InfoType,ClassType,AddTime,PerPageNum,UserNumber,ClassMemberNum,AdminName,ClassMember,isSys,hits from FS_ME_GroupDebateManage where gdID="&GroupID,User_Conn,1,3
  15. DebateRs.open "select DebateID,title,content,ParentID,UserNumber,AddTime,AppointUserNumber,AppointUserGroup,AddIP from FS_ME_GroupDebate  where ClassID="&GroupID&" and ParentID=0 order by AddTime desc,DebateID desc",User_Conn,1,1
  16. PerPageNum=GroupRs("PerPageNum")
  17. '---------------------------------分页定义
  18. int_RPP=PerPageNum '设置每页显示数目
  19. int_showNumberLink_=8 '数字导航显示数目
  20. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  21. str_nonLinkColor_="#999999" '非热链接颜色
  22. toF_="<font face=webdings title=""首页"">9</font>"   '首页 
  23. toP10_=" <font face=webdings title=""上十页"">7</font>" '上十
  24. toP1_=" <font face=webdings title=""上一页"">3</font>" '上一
  25. toN1_=" <font face=webdings title=""下一页"">4</font>" '下一
  26. toN10_=" <font face=webdings title=""下十页"">8</font>" '下十
  27. toL_="<font face=webdings title=""最后一页"">:</font>" '尾页
  28. '--------------------------------------------------
  29. if NoSqlHack(Request.QueryString("act"))="join" then 
  30. GroupMembers=GroupRs("ClassMember")
  31. GroupMembers=DelHeadAndEndDot(GroupMembers)&"," &session("FS_UserNumber")
  32. GroupMembersArray=split(GroupMembers,",")
  33. GroupRs("ClassMember")=GroupMembers
  34. GroupRs("ClassMemberNum")=Ubound(GroupMembersArray)
  35. GroupRs.update
  36. GroupRs.close
  37. if err.number=0 then 
  38. Response.Redirect("lib/success.asp?ErrCodes=<li>成功加入该组</li>&ErrorURL=../Group_unit.asp?GDID="&GroupID)
  39. Response.End()
  40. else
  41. Response.Redirect("lib/error.asp?ErrCodes=<li>"&err.description&"</li>")
  42. Response.End()
  43. end if
  44. elseif NoSqlHack(Request.QueryString("act"))="exit" then
  45. GroupMembers=GroupRs("ClassMember")
  46. Set re = New RegExp '正则匹配一个逗号
  47. re.Pattern = session("FS_UserNumber")&",*"
  48. GroupMembers=re.replace(GroupMembers,"")
  49. GroupMembersArray=split(GroupMembers,",")
  50. GroupRs("ClassMember")=GroupMembers
  51. GroupRs("ClassMemberNum")=Ubound(GroupMembersArray)
  52. GroupRs.update
  53. GroupRs.close
  54. if err.number=0 then 
  55. Response.Redirect("lib/success.asp?ErrCodes=<li>成功退出该组</li>&ErrorURL=../Group_unit.asp?GDID="&GroupID)
  56. Response.End()
  57. else
  58. Response.Redirect("lib/error.asp?ErrCodes=<li>"&err.description&"</li>")
  59. Response.End()
  60. end if
  61. end if
  62. %>
  63. <html xmlns="http://www.w3.org/1999/xhtml">
  64. <title>User Manage Center-网站内容管理系统</title>
  65. <meta name="keywords" content="风讯cms,cms,FoosunCMS,FoosunOA,FoosunVif,vif,风讯网站内容管理系统">
  66. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  67. <meta content="MSHTML 6.00.3790.2491" name="GENERATOR" />
  68. <link href="images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  69. <head></head>
  70. <body> 
  71. <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="table"> 
  72.   <tr> 
  73.     <td> <!--#include file="top.asp" --> </td> 
  74.   </tr> 
  75. </table> 
  76. <table width="98%" height="135" border="0" align="center" cellpadding="1" cellspacing="1" class="table"> 
  77.   <tr class="back"> 
  78.     <td   colspan="2" class="xingmu" height="26"> <!--#include file="Top_navi.asp" --> </td> 
  79.   </tr> 
  80.   <tr class="back"> 
  81.     <td width="18%" valign="top" class="hback"> <div align="left"> 
  82.         <!--#include file="menu.asp" --> 
  83.       </div></td> 
  84.     <td width="82%" valign="top" class="hback"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> 
  85.         <tr> 
  86.           <td width="72%"  valign="top"> <table width="98%" height="112" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> 
  87.               <tr class="hback_1"> 
  88.                 <td height="33">&nbsp;&nbsp;&nbsp;
  89. <a href='GroupClass.asp?Act=Add'>创建社群</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  90. <a href='myGroup.asp?userNumber=<%=session("FS_UserNumber")%>'>我的社群</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  91. <a href='Group.asp'>社群首页</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  92. <a href='#'>社群帮助</a>
  93. </td> 
  94.               </tr>
  95.               <%
  96. '-------------------------------------群介绍
  97. GroupID=GroupRs("gdID")
  98. GroupName=GroupRs("title")
  99. CroupContent=GroupRs("content")
  100. InfoType=GroupRs("InfoType")
  101. ClassType=GroupRs("ClassType")
  102. AddTime=GroupRs("AddTime")
  103. GroupCreater=GroupRs("UserNumber")
  104. GroupManager=GroupRs("AdminName")
  105. isSys=GroupRs("isSys")
  106. hits=GroupRs("hits")
  107. GroupMembers=GroupRs("ClassMember")
  108. '----------------------获得管理员------------------
  109. GroupManagerArray=split(GroupManager,",")
  110. GroupManager=""
  111. for ForIndex=0 to ubound(GroupManagerArray)
  112. Set TempRs=User_Conn.execute("Select UserName from FS_ME_Users where UserNumber='"&GroupManagerArray(ForIndex)&"'")
  113. if not TempRs.eof then
  114. GroupManager=GroupManager&","&TempRs("UserName")
  115. end if
  116. next
  117. GroupManager=DelHeadAndEndDot(GroupManager)
  118. '-------------获得创建人-------------------------------
  119. if isSys=1 then
  120. GroupCreater="管理员"
  121. else
  122. Set TempRs=User_Conn.execute("Select UserName from FS_ME_Users where UserNumber='"&GroupCreater&"'")
  123. if not TempRs.eof then
  124. GroupCreater=TempRs("UserName")
  125. end if
  126. end if
  127. '-----------------获得社群所属行业----------------------
  128. Set TempRs=User_Conn.execute("select vClassName from FS_ME_VocationClass where vcid="&ClassType)
  129. if not TempRs.eof then
  130. ClassType=TempRs("vClassName")
  131. else
  132. ClassType="其他"
  133. end if
  134. '-----------------获得社群成员数----------------------
  135. if GroupMembers<>"" then
  136. GroupMembersArray=split(GroupMembers,",")
  137. end if
  138. '------------------------------------------
  139. Response.Write("<tr class='hback'><td>")
  140. Response.Write("<table width='100%' height='60' border='0' cellpadding='3' cellspacing='1' class='table'>"&Chr(10)&chr(13))
  141. Response.Write("<tr class='hback'><td colspan=9><a href='Group_unit.asp?GDID="&GroupID&"'><strong><img src=""images/GroupUser.gif"" border=""0""/> "&GroupName&"</strong></a></td></tr>"&Chr(10)&chr(13))
  142. Response.Write("<tr height='20'>"&Chr(10)&chr(13))
  143. Response.Write("<td class='hback' align='right' width='8%'>创建时间:</td><td class='hback' align='left'>"&Datevalue(AddTime)&"</td>"&Chr(10)&chr(13))
  144. Response.Write("<td class='hback' align='right'>创建人:</td><td class='hback' align='left'><a href=""ShowUser.asp?UserName="& GroupCreater &""" target=""_blank"">"&GroupCreater&"</a></td>"&Chr(10)&chr(13))
  145. Response.Write("<td class='hback' align='right'>管理员:</td><td class='hback' align='left'><a href=""ShowUser.asp?UserName="& GroupManager &""" target=""_blank"">"&GroupManager&"</a></td>"&Chr(10)&chr(13))
  146. Response.Write("<td class='hback' align='right'>所属行业:</td><td class='hback' align='left'>"&ClassType&"</td>"&Chr(10)&chr(13))
  147. Response.Write("<td class='hback' align='right'>"&Chr(10)&chr(13))
  148. if Instr(GroupMembers,session("FS_UserNumber"))=0 then
  149. Response.Write("<a href='Group_unit.asp?act=join&GDID="&GroupID&"'>加入该社区</a>")
  150. else
  151. Response.Write("<a href='Group_unit.asp?act=exit&GDID="&GroupID&"'>退出该社区</a>")
  152. end if
  153. Response.Write("</td>")
  154. Response.Write("</tr>"&Chr(10)&chr(13))
  155. Response.Write("<tr height='30'>"&Chr(10)&chr(13))
  156. Response.Write("<td class='hback' colspan=9><img src=""images/GroupNews.gif""/>"&CroupContent&"</td>"&Chr(10)&chr(13))
  157. Response.Write("</tr>"&Chr(10)&chr(13))
  158. Response.Write("</table>")
  159. Response.Write("</td></tr>")
  160. '-------------------------------------------------社群成员
  161. GroupMembers=""
  162. Set GroupMembersArray=nothing
  163. Response.Write("<tr class='hback'><td>"&Chr(10)&chr(13))
  164. Response.Write("<table width='100%' height='60' border='0' cellpadding='5' cellspacing='1' class='table'>"&Chr(10)&chr(13))
  165. Response.Write("<tr class='hback'><td align='left'><img src=""images/GroupMembers.gif"">社群成员</td></tr>")
  166. if GroupRs("ClassMember")<>"" then
  167. GroupMembersArray=split(DelHeadAndEndDot(GroupRs("ClassMember")),",")
  168. If IsArray(GroupMembersArray) Then
  169. Dim memberRs,userName
  170. for ForIndex =0 to Ubound(GroupMembersArray)
  171. Set memberRs=User_Conn.execute("Select UserName from FS_ME_Users where UserNumber='"&GroupMembersArray(ForIndex)&"'")
  172. If Not memberRs.eof Then
  173. userName="<a  href='ShowUser.asp?UserNumber="&GroupMembersArray(ForIndex)&"' title='点击查看该用户详情'>"&memberRs("UserName")&"</a>"
  174. Else
  175. userName=""
  176. End If
  177. If userName<>"" then
  178. GroupMembers=GroupMembers&"&nbsp;<img src='images/DebateUser.gif'/>&nbsp;"&userName&"</a>"
  179. End if
  180. Next
  181. If Not isNull(memberRs) Then memberRs.close()
  182. End if
  183. end if
  184. Response.Write("<tr><td  class='hback'>")
  185. Response.Write(GroupMembers)
  186. Response.Write("</td></tr>"&Chr(10)&chr(13))
  187. Response.Write("</table>"&Chr(10)&chr(13))
  188. Response.Write("</td></tr>"&Chr(10)&chr(13))
  189. '-------------------------------------------------社群讨论贴
  190. Response.Write("<tr class='hback'><td>"&Chr(10)&chr(13))
  191. Response.Write("<table width='100%' height='60' border='0' cellpadding='5' cellspacing='1' class='table'>"&Chr(10)&chr(13))
  192. Response.Write("<tr class='hback'><td align='left' colspan='2'>&nbsp;社群讨论<div align='right'><a href='Debate_Add.asp?act=new&ClassID="&GroupID&"'><img src=""images/newTopic.gif"" border=""0""/>发表主题</a></div></td></tr>"&Chr(10)&chr(13))
  193. If Not DebateRs.eof then
  194. '分页使用-----------------------------------
  195. DebateRs.PageSize=int_RPP
  196. cPageNo=NoSqlHack(Request.QueryString("page"))
  197. If cPageNo="" Then cPageNo = 1
  198. If not isnumeric(cPageNo) Then cPageNo = 1
  199. cPageNo = Clng(cPageNo)
  200. If cPageNo<=0 Then cPageNo=1
  201. If cPageNo>DebateRs.PageCount Then cPageNo=DebateRs.PageCount 
  202. DebateRs.AbsolutePage=cPageNo
  203. End if
  204. for i=0 to int_RPP
  205. if DebateRs.eof then exit for
  206. AppointUserNumber=DebateRs("AppointUserNumber")
  207. AppointUserGroup=DebateRs("AppointUserGroup")
  208. if AppointUserNumber<>"" then
  209. if instr(AppointUserNumber,Session("FS_UserNumber"))=0 then
  210. Response.Write("<tr height='20' class='hback'>")
  211. Response.Write("<td width='3%' align=""Center""><img src=""images/GroupTopic.gif""></td>")
  212. Response.Write("<td align='left'>该贴被作者隐藏</td>"&Chr(10)&chr(13))
  213. Response.Write("</tr>")
  214. else
  215. Response.Write("<tr height='20' class='hback'>")
  216. Response.Write("<td width='3%' align=""Center""><img src=""images/GroupTopic.gif""></td>")
  217. Response.Write("<td align='left'><a href='Debate_unit.asp?DebateID="&DebateRs("DebateID")&"&gdid="&GroupID&"'>"&DebateRs("title")&"</a></td>"&Chr(10)&chr(13))
  218. Response.Write("</tr>")
  219. end if
  220. elseif AppointUserGroup<>"" then
  221. if instr(AppointUserGroup,Session("FS_Group"))=0 then
  222. Response.Write("<tr height='20' class='hback'>")
  223. Response.Write("<td width='3%' align=""Center""><img src=""images/GroupTopic.gif""></td>")
  224. Response.Write("<td align='left'>该贴被作者隐藏</td>"&Chr(10)&chr(13))
  225. Response.Write("</tr>")
  226. else
  227. Response.Write("<tr height='20' class='hback'>")
  228. Response.Write("<td width='3%' align=""Center""><img src=""images/GroupTopic.gif""></td>")
  229. Response.Write("<td align='left'><a href='Debate_unit.asp?DebateID="&DebateRs("DebateID")&"&gdid="&GroupID&"'>"&DebateRs("title")&"</a></td>"&Chr(10)&chr(13))
  230. Response.Write("</tr>")
  231. end if
  232. else
  233. Response.Write("<tr height='20' class='hback'>")
  234. Response.Write("<td width='3%' align=""Center""><img src=""images/GroupTopic.gif""></td>")
  235. Response.Write("<td align='left'><a href='Debate_unit.asp?DebateID="&DebateRs("DebateID")&"&gdid="&GroupID&"'>"&DebateRs("title")&"</a></td>"&Chr(10)&chr(13))
  236. Response.Write("</tr>")
  237. end if
  238. DebateRs.movenext
  239. next
  240. Response.Write("</table>"&Chr(10)&chr(13))
  241. Response.Write("</td></tr>"&Chr(10)&chr(13))
  242.   %>
  243.   <%
  244. Response.Write("<tr>"&vbcrlf)
  245. Response.Write("<td align='right' colspan='5'  class=""hback"">"&fPageCount(DebateRs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)&"</td>"&vbcrlf)
  246. Response.Write("</tr>"&vbcrlf)
  247. %>
  248.           </table></td> 
  249.         </tr> 
  250.       </table></td> 
  251.   </tr> 
  252.   <tr class="back"> 
  253.     <td height="20"  colspan="2" class="xingmu"> <div align="left"> 
  254.         <!--#include file="Copyright.asp" --> 
  255.       </div></td> 
  256.   </tr> 
  257. </table> 
  258. </body>
  259. </html>
  260. <%
  261. GroupRs.close
  262. DebateRs.close
  263. Set GroupRs=nothing
  264. Set DebateRs=nothing
  265. Set User_Conn=nothing
  266. Set Fs_User = Nothing
  267. %>
  268. <!--Powsered by Foosun Inc.,Product:FoosunCMS V4.0系列-->