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

数据库编程

开发平台:

ASP/ASPX

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <% Option Explicit %>
  3. <!--#include file="../FS_Inc/Const.asp"-->
  4. <!--#include file="../FS_InterFace/MF_Function.asp" -->
  5. <!--#include file="../FS_Inc/Function.asp" -->
  6. <!--#include file="../FS_Inc/Func_page.asp" -->
  7. <%
  8. MF_Default_Conn
  9. Dim Configobj,Topic,isUser,PageS,Style,Conn,sql
  10. Set Configobj= server.CreateObject(G_FS_RS)
  11. sql="select ID,Title,IsUser,IsAut,PageSize,Style From FS_WS_Config"
  12. configobj.open sql,Conn,1,1
  13. if not configobj.eof then
  14. Topic=configobj("Title")
  15. PageS=configobj("PageSize")
  16. IsUser=configobj("IsUser")
  17. Style = configobj("Style")
  18. if Style<>"" then
  19. Style = Style
  20. else
  21. Style = "3"
  22. end if
  23. end if
  24. response.Cookies("FoosunUserCookies")("UserLogin_Style_Num") = Style
  25. set configobj=nothing
  26. Dim int_Start,int_RPP,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo
  27. int_RPP=PageS '设置每页显示数目
  28. toF_="<font face=webdings>9</font>"    '首页 
  29. str_nonLinkColor_="#999999" '非热链接颜色
  30. int_RPP =20
  31. int_showNumberLink_=10 '数字导航显示数目
  32. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  33. toF_="<font face=webdings>9</font>"    '首页 
  34. toP10_=" <font face=webdings>7</font>" '上十
  35. toP1_=" <font face=webdings>3</font>" '上一
  36. toN1_=" <font face=webdings>4</font>" '下一
  37. toN10_=" <font face=webdings>8</font>" '下十
  38. toL_="<font face=webdings>:</font>"
  39. dim CountRs,TodayNotes,obj_count_rs,TodayBbs,YesterdayNote,All,sqlDate,ClassAll,TodayClassAll,ClassAllRs,ClassSqlcount,PersRs,PersN,PersB
  40. Set ClassAllRs= Server.CreateObject(G_FS_RS)
  41. Set obj_count_rs= Server.CreateObject(G_FS_RS)
  42. if G_IS_SQL_DB=0 then
  43. sqlDate="#"&datevalue(now())-1&"#"
  44. else
  45. sqlDate="'"&datevalue(now())-1&"'"
  46. end If
  47. if G_IS_SQL_DB=0 then
  48. obj_count_rs.open "select id from FS_WS_BBS where ParentID<>'0' and datevalue(AddDate)>"&sqlDate&"",conn,1,1
  49. Else
  50. obj_count_rs.open "select id from FS_WS_BBS where ParentID<>'0' and convert(nvarchar(10),AddDate,120)>"&sqlDate&"",conn,1,1
  51. End if
  52. TodayBbs = obj_count_rs.recordcount
  53. obj_count_rs.close
  54. obj_count_rs.open"select id from FS_WS_BBS where ParentID='0' and AddDate>"&sqlDate&"",conn,1,1
  55. TodayNotes=obj_count_rs.recordcount
  56. obj_count_rs.close
  57. if G_IS_SQL_DB=0 then
  58. obj_count_rs.open "select id from FS_WS_BBS where ParentID='0' and AddDate>#"&datevalue(now())-2&"# and AddDate<"&sqlDate&"",conn,1,1
  59. else
  60. obj_count_rs.open "select id from FS_WS_BBS where ParentID='0' and AddDate>'"&datevalue(now())-2&"' and AddDate<"&sqlDate&"",conn,1,1
  61. end if
  62. YesterdayNote=obj_count_rs.recordcount
  63. obj_count_rs.close
  64. obj_count_rs.open "select id from FS_WS_BBS",conn,1,1
  65. All=obj_count_rs.recordcount
  66. obj_count_rs.close
  67. Set obj_count_rs=nothing
  68. %>
  69. <html>
  70. <HEAD>
  71. <TITLE>FoosunCMS留言系统</TITLE>
  72. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  73. <link href="../<% = G_USER_DIR %>/images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  74. </HEAD>
  75. <script language="javascript">
  76. function opencat(i)
  77. {
  78.   if(document.getElementById("Note"+i).style.display=="none"){
  79.      document.getElementById("Note"+i).style.display="";
  80.  document.getElementById("Img"+i).src="images/nofollow.gif";
  81.   } else {
  82.      document.getElementById("Note"+i).style.display="none"; 
  83.  document.getElementById("Img"+i).src="images/plus.gif";
  84.   }
  85. }
  86. </script>
  87. <body>
  88. <!--公告-->
  89. <!--#include file="Tell.asp"-->
  90. <!--登录-->
  91. <!--主页面-->
  92. <%
  93. Dim ClassRs,ClassSql,NoteRs,NoteSql,MsRs,MsSql,NoteAct,NoteSqlEnd,i,SelectClassID
  94. i=0
  95. Set ClassRs=Server.CreateObject(G_FS_RS)
  96. Set MsRs=Server.CreateObject(G_FS_RS)
  97. ClassRs.open "Select ID,ClassID,ClassName,ClassExp,Pid,Author,AddDate from FS_WS_Class order by Pid desc",Conn,1,1
  98. If not ClassRs.eof then
  99. ClassRs.PageSize=int_RPP
  100. cPageNo=NoSqlHack(Request.QueryString("Page"))
  101. If cPageNo="" Then 
  102. cPageNo = 1
  103. End if
  104. If not isnumeric(cPageNo) Then 
  105. cPageNo = 1
  106. cPageNo = Clng(cPageNo)
  107. End If
  108. If cPageNo<=0 Then 
  109. cPageNo=1
  110. End If
  111. If cPageNo>ClassRs.PageCount Then 
  112. cPageNo=ClassRs.PageCount 
  113. ClassRs.AbsolutePage=cPageNo
  114. End IF
  115. %>
  116. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  117.   <%
  118.   if session("FS_UserName")="" then
  119.    Response.write("<tr><td width=""100%"" class=""hback"" height=""30"">您是我们的会员吗?请单击这里:<a href=""../User/login.asp?UrlAddress=../GuestBook/index.asp""><font color=""red"">登陆</font></a></td></tr>")
  120.   else
  121.   '统计个人信息
  122. Set PersRs=Server.CreateObject(G_FS_RS)
  123. PersRs.open "Select ID from FS_WS_BBS where User='"&session("FS_UserName")&"' and ParentID='0'",Conn,1,1
  124. PersN=PersRs.recordcount
  125. PersRs.close
  126. PersRs.open "Select ID from FS_WS_BBS where User='"&session("FS_UserName")&"' and ParentID<>'0'",Conn,1,1
  127. PersB=PersRs.recordcount
  128. PersRs.close
  129. Set PersRs=nothing
  130.   %>
  131.   <tr class="hback" height="30">
  132.     <td>
  133. 欢迎您:<%=session("FS_UserName")%>! <a href="../<% = G_USER_DIR %>/LoginOut.asp?sUrl=../GuestBook/index.asp">退出</a>  您共发贴<font color="red"><%=PersN%></font>篇;共回复<font color="red"><%=PersB%></font>篇;  帖子统计:今日贴<font color="red"><%=TodayNotes%></font>篇;主题总数<font color="red"><%=TodayBbs%></font>篇;昨日贴<font color="red"><%=YesterdayNote%></font>篇;总贴数<font color="red"><%=All%></font>篇</td>
  134.   </tr>
  135.    <%end if%>
  136. </table>
  137. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  138. <%
  139.  FOR int_Start=1 TO int_RPP 
  140. %>
  141.   <tr class="xingmu">
  142.     <td height="30" colspan="3" align="center" valign="middle" ><div align="left"><a href="DefNoteList.asp?ClassID=<%=ClassRs("ClassID")%>" class="Top_Navi"><strong><%=ClassRs("ClassName")%></strong></a></div></td>
  143.   </tr>
  144.   <tr class="hback">
  145.     <td width="33%" rowspan="2" class="tdhback"><img src="images/nofollow.gif" name="Img" id="Img">&nbsp;<a href="DefNoteList.asp?ClassID=<%=ClassRs("ClassID")%>"><%=ClassRs("ClassExp")%></a></td>
  146. <td width="28%"  class="tdhback">创建时间:<font color="#FF0000"><%=ClassRs("AddDate")%></font></td>
  147.     <td width="39%" rowspan="2"  class="tdhback"><%
  148. dim rs,str_topic,pub_topbic,pub_date,str_id
  149. set rs = Conn.execute("select top 1 Id,Topic,AddDate,LastUpdateDate,LastUpdateUser,user From FS_WS_BBS where State='0' and ClassID='"&ClassRs("ClassId")&"' order by LastUpdateDate desc,id desc")
  150. if rs.eof then
  151. str_topic = "无"
  152. pub_topbic = "无"
  153. pub_date = "无"
  154. str_id = ""
  155. rs.close:set rs = nothing
  156. else
  157. str_topic = rs("Topic")
  158. if rs("LastUpdateUser")<>"游客" and rs("LastUpdateUser")<>"过客" then
  159. pub_topbic = "<a href=../"&G_USER_DIR&"/ShowUser.asp?UserName="&rs("LastUpdateUser")&" target=""_blank"">"&rs("LastUpdateUser")&"</a>"
  160. else
  161. pub_topbic = rs("LastUpdateUser")
  162. end if
  163. pub_date = rs("LastUpdateDate")
  164. str_id = rs("id")
  165. rs.close:set rs = nothing
  166. end if
  167. %>
  168.     <table width="100%" border="0" cellspacing="0" cellpadding="2">
  169.   <tr>
  170.     <td>主题:
  171. <%if str_id<>"" then%>
  172.       <a href="ShowNote.asp?NoteID=<%=str_id%>&ClassName=<%=ClassRs("ClassName")%>&ClassID=<%=ClassRs("ClassId")%>"><% = str_topic %></a></td>
  173.    <%else%>
  174.       <% = str_topic %></td>
  175. <%end if%>
  176.   </tr>
  177.   <tr>
  178.     <td>发帖:
  179.       <% = pub_topbic %></td>
  180.   </tr>
  181.   <tr>
  182.     <td>日期:
  183.       <% = pub_date %></td>
  184.   </tr>
  185. </table>
  186.     </td>
  187.   </tr>  
  188.   <tr>
  189.   <%
  190.   ClassAllRs.open "Select ID From FS_WS_BBS where ClassID='"&ClassRs("ClassID")&"'",conn,1,1  
  191.   ClassAll=0
  192.   TodayClassAll=0
  193.   if not ClassAllRs.eof then
  194.    ClassAll=ClassAllRs.recordcount
  195.   end if
  196.   ClassAllRs.close
  197.   if G_IS_SQL_DB=0 then
  198. ClassSqlcount="Select ID From FS_WS_BBS where ClassID='"&ClassRs("ClassID")&"' and AddDate>#"& datevalue(now())-1&"#"
  199. else
  200. ClassSqlcount="Select ID From FS_WS_BBS where ClassID='"&ClassRs("ClassID")&"' and AddDate>'"&datevalue(now())-1&"'"
  201.   end if
  202.   ClassAllRs.open ClassSqlcount,conn,1,1
  203. if not ClassAllRs.eof then
  204.    TodayClassAll=ClassAllRs.recordcount
  205.   end if
  206.   ClassAllRs.close
  207.   %>
  208.   <td  class="hback" >总帖:<font color="red"><%=ClassAll%></font>篇&nbsp;&nbsp;今日帖:<font color="red"><%=TodayClassAll%></font>篇&nbsp;</td>
  209.   </tr>
  210.   <%  
  211.     ClassRs.MoveNext
  212. if ClassRs.eof or ClassRs.bof then exit for
  213.     NEXT
  214. response.Write "<tr><td colspan=""4"" class=""hback_1"" align=""right"">"&  fPageCount(ClassRs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)&"</td></tr>"
  215.   %>
  216. </table>
  217. <%
  218. Else
  219. Response.Write("暂无内容")
  220. End If
  221. Set ClassRs=nothing
  222. Set Conn=nothing
  223. %>
  224. </body>
  225. </html>