⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.asp

📁 这个论坛也不错.适合做毕业设计的
💻 ASP
字号:
<!--#INCLUDE FILE="config.asp" -->
<%
set my_conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open ConnString

set rs = Server.CreateObject("ADODB.Recordset")
strsql = "Select * from Totals"
rs.open strSQL, my_conn

Users = rs("U_Count")
Posts = rs("P_Count")
strsql = "select SFAdmin_Subject from SFAdmin"
set rs = my_conn.Execute (strsql)
%>
<!--#INCLUDE FILE="top.asp" -->
<table border =0 width=<%=TableWidth%> align="center" class="sft"><tr><td width="20">
<img src="images/aff.gif"></td><td width="50%"><marquee scrollamount=2><a href="aff.asp" target=_blank><%=rs("SFAdmin_Subject")%></a></marquee>
</td><td align=right>帖子总数:<%=Posts%>, 注册用户: <%=Users %></td></tr>
</table>
<table bgcolor=<%=TableColor%> border="0" width=<%=TableWidth%> align="center" cellspacing="1" cellpadding="3" class="sft">
<%
if Request.Cookies("User")("Name") = "" then
 Response.Write "<form name=Login method=post action='login.asp?login=yes&Cookies_Time=7'><tr bgcolor=" & CategoryColor & " class=sfh><td colspan=5 align=center>用户名:<input maxLength=10 name=UserName size=20  class=box>"
 Response.Write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;密码:<input maxLength=16 name=Password size=20 type=password class=box>&nbsp;&nbsp;<a href='register.asp'>尚未注册?</a>&nbsp;&nbsp;<a href='password.asp'>遗忘密码?</a>"
 Response.Write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name=Submit type=submit value='登 录' class=btn></td></tr></form>"
end if%>
  <tr bgcolor="<% =HeadColor %>" class="sfh">
    <td align="center" width="5%"></td>
    <td align="center" width="47%">论坛</td>
    <td align="center" width="8%">帖子数</td>
    <td align="center" width="25%">最后回复</td>
    <td align="center" width="15%">版主</td>
  </tr>
<% 
strSql = "SELECT * FROM Category"
set rs = my_conn.Execute (StrSql)

If rs.Eof or rs.Bof then
	Response.Write "<tr bgcolor="&CellColor1&"><td colspan=5>无任何论坛</td></tr>"
Else
	do until rs.eof
	
	 Response.Write "<tr class=sfh bgcolor='" & CategoryColor & "'><td colspan=5>"& rs("cat_name") & "</td></tr>"
	 strSql = "SELECT Forum.Forum_ID, Forum.F_Name, Forum.F_Description, Forum.F_Cat, Forum.F_Count, Forum.F_Last_Post, Forum.F_Last_Reply, F_Last_Member, F_Last_ID "
	 ' strSql = strSql & "FROM Members INNER JOIN Forum ON Members.Member_id = Forum.F_Moderator "
	 strSql = strSql & "from forum where Forum.F_Cat = " & rs("cat_id")
	
	 set rsForum =  my_conn.Execute (StrSql)
	 
	 if rsForum.eof or rsForum.bof then
		Response.Write "<tr><td colspan=5>&nbsp;</td></tr>"
	 else
		do until rsForum.Eof
		  Response.Write "<tr onmouseover=""this.bgColor='" & CellColor2 & "';"" onmouseout=""this.bgColor='" & CellColor1 & "';"" bgcolor='" & CellColor1 & "'>" & vbcrlf
		  Response.Write "<td align='center'><a href='forum.asp?forum_id=" & rsForum("Forum_ID") & "&forum_title=" & server.URLEncode(rsForum("F_name")) & "' title='用新窗口打开' target=_blank><img src='" & "images/forumicon.gif" & "' border=0></img></a></td>"& vbcrlf
		  Response.Write "<td><a href='forum.asp?forum_id=" & rsForum("Forum_ID") & "&forum_title=" & server.URLEncode(rsForum("F_name")) & "'>"
		  Response.Write rsForum("F_name") & "</a><br>" & vbcrlf
		  Response.Write rsForum("F_Description") & "</td>" & vbcrlf
		  Response.Write "<td align='center'>" & rsForum("F_Count") & "</td>" & vbcrlf
		  ReplyStr = rsForum("F_Last_Reply")
		  if Len(ReplyStr)>10 then
		   ReplyStr = Left(Replystr, 8) + "..."
		   ReplyStr = server.htmlencode(ReplyStr)
		  end if
		  Response.Write "<td valign='top'><img src='" & "images/lasticon.gif" & "'></img>主题:<a href='topic.asp?topic_id=" & rsForum("F_Last_ID") & "&forum_id=" & rsForum("Forum_ID") & "&forum_title=" & rsForum("F_Name") & "&topic_title=" & rsForum("F_Last_Reply") & "' title=" & rsForum("F_Last_Reply") & ">" & ReplyStr & "</a><br>&nbsp;&nbsp;作者:" & "<a href='viewuser.asp?name=" & rsForum("F_Last_Member") & "' target=_blank>" & rsForum("F_Last_Member") & "</a><br>&nbsp;&nbsp;时间:" & rsForum("F_Last_Post") & "</td>" & vbcrlf
		  Response.Write "<td align='center'>"
		  strsql = "SELECT Admin.Admin_Name from Admin where Admin.Forum_ID = " & rsForum("Forum_ID")
		  set rsAdmin = my_conn.Execute (strsql)
		  if rsAdmin.eof or rsAdmin.bof then
		    Response.Write "版主空缺"
		  else
		    do until rsAdmin.eof
		      Response.Write "&nbsp;<a href='viewuser.asp?name=" & rsAdmin("Admin_Name") & "' target=_blank>" & rsAdmin("Admin_Name") & "</a>"
		      rsAdmin.movenext
		    loop
		  end if
		  Response.Write "</td>"
	      Response.Write "</tr>" & vbcrlf
	      rsForum.movenext
	      
		loop
	 End If
	rs.MoveNext
	loop
End If
%>
</table>
<br>
<table bgcolor=<%=TableColor%> border="0" align="center" width=<%=TableWidth%> cellspacing="1" cellpadding="3" class="sft">
<tr><td bgcolor=<%=HeadColor%> class="sfh">用户信息</td></tr>
<tr><td bgcolor=<%=CellColor1%>>
<%
 if Request.Cookies("User")("Name")<>"" then
 strsql="select * from messages where To = '" & Request.Cookies("User")("Name") & "' and New = true"
 set rs = server.CreateObject("ADODB.RecordSet")
 rs.Open strSql, my_conn, 1, 1
 if rs.Eof or rs.Bof then
   Response.Write "您没有新的短消息"
 else
   Response.Write "您有" & rs.RecordCount & "条新的短消息尚未阅读&nbsp;<a href='message.asp' title='查看短消息' target=_blank><img src='images/newmsg.gif' width=14 height=11 border=0></a>"
 end if
 Response.Write "<br>"
end if
%>
<%=Request.ServerVariables("HTTP_USER_AGENT")%></td></tr></table>
<br>
<table bgcolor=<%=TableColor%> border="0" align="center" width=<%=TableWidth%> cellspacing="1" cellpadding="3" class="sft">
<tr><td bgcolor=<%=HeadColor%> colspan=2 class="sfh">链接</td></tr>
<!--#INCLUDE FILE="link.asp" -->
</table>
<br>
<!--#INCLUDE FILE="online.asp" -->
<table bgcolor=<%=TableColor%> border="0" align="center" width=<%=TableWidth%> cellspacing="1" cellpadding="3" class="sft">
<tr><td bgcolor=<%=HeadColor%> class="sfh">在线统计(您的IP:<%=ip%>)</td></tr>
<tr><td bgcolor=<%=CellColor1%>>
<%
strsql="select Online_Name from online"
set rs = my_conn.Execute (strsql)
if rs.eof or rs.bof then
  Response.Write "无用户"
else
  do until rs.Eof
    if rs("Online_Name") <> "游客" then
     Response.Write "&nbsp;<a href='viewuser.asp?name=" & rs("Online_Name") & "' target=_blank>" & rs("Online_Name") & "</a>"
    else
     guest = guest +1
    end if
  rs.movenext
  loop
end if
if guest>0 then Response.Write "<br>游客:"& guest &"人"
strsql = "update online set online_forum = 0 where online_ip = '" & ip & "'"
my_conn.Execute (strsql)
%>
</td></tr></table>

<!--#INCLUDE FILE="copyright.asp" -->
</body></html>
<%
my_conn.Close
set my_conn = nothing

set rs = nothing
set rsForum = nothing
set rsAdmin = nothing
set size = nothing

%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -