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

📄 loading.asp

📁 秘密网源代码 传闻拉了 100W风投
💻 ASP
字号:
<!-- #include file="conn.asp" -->
<%
if Request.ServerVariables("Request_method") <> "POST" then Response.End

select case Request("menu")
	case "ForumTree"
		GroupID=RequestInt("GroupID")
		ParentID=RequestInt("ParentID")
		QueryStr="ParentID="&ParentID&""
		if GroupID>0 then QueryStr="GroupID="&GroupID&" and ParentID=0"
		sql="Select * From [Wo_Forums] where "&QueryStr&" and IsActive=1 and  SortOrder>0 order by SortOrder"
		Set Rs=Conn.Execute(sql)
		do while not rs.eof
			alltree=""&alltree&"<div class=menuitems><a href=ShowForum.asp?ForumID="&rs("ForumID")&">"&rs("ForumName")&"</a></div>"
			rs.Movenext
		loop
		Set Rs = Nothing
		if GroupID>0 then
%>
<a onmouseover="showmenu(event,'<%=alltree%>')" href=Default.asp?GroupID=<%=GroupID%>><%=Conn.Execute("Select GroupName From [Wo_Groups] where GroupID="&GroupID&"")(0)%></a><%else%>
<a onmouseover="showmenu(event,'<%=alltree%>')" href=ShowForum.asp?ForumID=<%=ParentID%>><%=Conn.Execute("Select ForumName From [Wo_Forums] where ForumID="&ParentID&"")(0)%></a><%
		end if

	case "ForumList"
		ii=0
		ForumsList="<select name='ParentID'><option value='0'>--</option>"
		GroupID=RequestInt("GroupID")
		ForumListLoad GroupID,0
		ForumsList=ForumsList&"</select>"
		response.write(ForumsList)

	case "UsersOnline"
		ForumID=RequestInt("ForumID")
		if ForumID=0 then
			sql="select * from [Wo_UserOnline] where IsInvisible<>1"
		else
			sql="select * from [Wo_UserOnline] where ForumID="&ForumID&" and IsInvisible<>1"
		end if
		Set Rs=Conn.Execute(sql)
		content="<table width=""100%""><tr>"
		do while not Rs.eof
		if Rs("UserName")<>"" then
			onlinerole=Conn.Execute("Select UserRoleID From [Wo_Users] where UserName='"&Rs("UserName")&"' ")(0)
		if onlinerole=1 then
			Usefacephoto="<img src=images/UserRoleID/1.gif>"
		elseif onlinerole=2 then
			Usefacephoto="<img src=images/UserRoleID/2.gif>"
		elseif onlinerole=4 then
			Usefacephoto="<img src=images/UserRoleID/3.gif>"
		elseif onlinerole=6 then
			Usefacephoto="<img src=images/UserRoleID/4.gif>"
		elseif onlinerole=3 then
			Usefacephoto="<img src=images/UserRoleID/5.gif>"
		else
			Usefacephoto="<img src=images/UserRoleID/6.gif>"
		end if
		else
			Usefacephoto="<img src=images/UserRoleID/6.gif>"
		end if

		if NO_count < 4 then
		NO_count=NO_count+1
		else
		NO_count=1
		end if

		if Rs("UserName")<>"" then
		
		content=""&content&"<td width=""10%"" style=word-break:break-all>"&Usefacephoto&"<a title=所在位置:"&Rs("ForumName")&" href=Profile.asp?UserName="&Rs("UserName")&">"&Rs("UserName")&"</a></td>"
		else
		content=""&content&"<td width=""10%"" style=word-break:break-all>"&Usefacephoto&"<a title=所在位置:"&Rs("ForumName")&">游客</a></td>"
		end if

		if NO_count = 4 then content=""&content&"</tr><tr>"

		Rs.Movenext
		loop
		Rs.close
		response.write content&"</table>"
	case "ThreadStatus"
		ThreadID=RequestInt("ThreadID")
		ThreadStatus=RequestInt("ThreadStatus")
		Conn.execute("update [Wo_Threads] set ThreadStatus="&ThreadStatus&" where ThreadID="&ThreadID&"")
	case "Subscription"
		ThreadID=RequestInt("ThreadID")
		sql="select * from [Wo_Subscriptions] where UserName='"&CookieUserName&"' and ThreadID="&ThreadID&""
		Rs.open sql,conn,1,3
		if Rs.eof then
			Rs.addnew
			Rs("UserName")=CookieUserName
			Rs("ThreadID")=ThreadID
			Rs("Email")=CookieEmail
			Rs.update
			BgImage="tracktopic-on.gif"
			ButtonText="取消订阅"
		else
			Conn.execute("Delete from [Wo_Subscriptions] where UserName='"&CookieUserName&"' and ThreadID="&ThreadID&"")
			BgImage="tracktopic.gif"
			ButtonText="订阅主题"
		end if
		Rs.close
%>
<a class="CommonImageTextButton" style="BACKGROUND-IMAGE: url(images/<%=BgImage%>)" href="javascript:Ajax_CallBack(false,'ThreadSubscription','Loading.asp?Menu=Subscription&amp;ThreadID=<%=ThreadID%>')"><%=ButtonText%></a><%
	case "Style"
		
		XMLDOM.load(Server.MapPath("skin/skin.xml"))
		Set XMLRoot=XMLDOM.documentElement
		i=0
		for each child in XMLRoot.childNodes
			set childsearch=XMLRoot.childnodes(i)
			StyleMenu=StyleMenu&"<div class=menuitems><a href=cookies.asp?menu=skin&style="&childsearch.getAttributeNode("name").nodeValue&">"&childsearch.text&"</a></div>"
			i=i+1
		next
		set XMLRoot=nothing
		Set XMLDOM=nothing
%><a onmouseover="showmenu(event,'<div class=menuitems><a href=cookies.asp?menu=skin>默认风格</a></div><%=StyleMenu%>')" style='cursor:default'>风格</a><%
	case "Threadstar"
		VoteValue=0
		ThreadID=RequestInt("ThreadID")
		VoteValue=RequestInt("Rate")
		
		if VoteValue>0 and CookieUserName<>"" then
			sql="select * From [Wo_PostRating] where UserName='"&CookieUserName&"' and ThreadID="&ThreadID&""
			Rs.Open SQL,Conn,1,3
			if Rs.eof then Rs.addNew
				Rs("ThreadID")=ThreadID
				Rs("Rating")=VoteValue
				Rs("UserName")=CookieUserName
				Rs("DateCreated")=Now()
			Rs.update
			Rs.close
		end if

		RatingSum=conn.execute("Select sum(Rating) from [Wo_PostRating] where ThreadID="&ThreadID&"")(0)
		TotalRatings=conn.execute("Select count(Rating) from [Wo_PostRating] where ThreadID="&ThreadID&"")(0)
		sql="select * from [Wo_Threads] where ThreadID="&ThreadID&""
		Rs.Open SQL,Conn,1,3
			Rs("RatingSum")=RatingSum
			Rs("TotalRatings")=TotalRatings
		Rs.update
		Threadstar=Rs("RatingSum")/Rs("TotalRatings")
		Rs.close
		Response.write(Threadstar)

	case "CheckUserName"
		UserName=HTMLEncode(Request.QueryString("UserName"))
		UserNameLength=RequestInt("UserNameLength")
		if len(UserName)<>UserNameLength then
			Response.write("<img src='images/check_error.gif' />&nbsp;您输入的窝友名“"&UserName&"”含有URL所不能传送的字符")
			Response.end
		end if
		if Conn.Execute("Select UserID From [Wo_Users] where UserName='"&UserName&"'" ).eof Then
			Response.write("<img src='images/check_right.gif' />")
		else
			Response.write("<img src='images/check_error.gif' align=absmiddle />&nbsp;"&UserName&" 已经有人使用,请另选一个!")
		end if
	case "CheckMail"
		UserEmail=HTMLEncode(Request.QueryString("Mail"))
		If Conn.Execute("Select UserID From [Wo_Users] where UserEmail='"&UserEmail&"'" ).eof Then
			Response.write("<img src='images/check_right.gif' />")
		else
			Response.write("<img src='images/check_error.gif' />&nbsp;"&UserEmail&" 已经有人使用,请另选一个。")
		end if
	case "CheckVerifyCode"
		VerifyCode=Request.QueryString("VerifyCode")
		If VerifyCode=Session("VerifyCode") Then
			Response.write("<img src='images/check_right.gif' />")
		else
			Response.write("<img src='images/check_error.gif' />&nbsp;您的验证码输入错误,请重新输入或点击刷新验证码图片")
		end if
	case "IsObjInstalled"
		strClassString=Request.QueryString("Object")
		On Error Resume Next
		IsInstalled = "<img src='images/check_error.gif' /> 您的服务器不支持 "&Request.QueryString("Object")&" 组件"
		Set xTestObj = Server.CreateObject(strClassString)
		If 0 = Err Then IsInstalled = "<img src='images/check_right.gif' />"
		Set xTestObj = Nothing
		On Error GoTo 0
		Response.write(IsInstalled)
	case "Preview"
		Subject=unescape(Request.Form("Subject")&Request.Form("PostSubject"))
		Body=unescape(Request.Form("Body"))
%>
<table id=CommonListArea cellspacing="1" cellpadding="5" width="100%" align="center" border="0">
	<tr id=CommonListTitle><td><div style="float:left">预览</div><div style="float:right"><a href="javascript:ToggleMenuOnOff('Preview')">关闭</a></div></td></tr>
	<tr id="CommonListHeader"><td><div style="float:left"><b><%=HTMLEncode(Subject)%></b></div><div style="float:right"><%=now()%></div></td></tr>
	<tr id=CommonListCell><td><%=YbbEncode(BodyEncode(Body))%></td></tr>
	<tr id="CommonListCell"><td align="right"><input type="Button" value=" 发表 " onclick="javascript:document.form.EditSubmit.click()"></td></tr>
</table>
<%

case "LoadComment"
  UserName=HTMLEncode(Request("UserName"))
  Body=BodyEncode(Request("Body"))
  CalendarID=RequestInt("CalendarID")

  sql="select * from [Wo_Calendars] where ParentID="&CalendarID&" order by CalendarID Desc"
  Set Rs=Conn.Execute(sql)
  'if Rs.eof then response.end
  TotalCount=conn.Execute("Select count(CalendarID) From [Wo_Calendars] where ParentID="&CalendarID&"")(0) '获取数据数量
  PageSetup=10 '设定每页的显示数量
  TotalPage=Abs(Int(TotalCount/PageSetup*(-1))) '总页数
  PageCount = RequestInt("PageIndex") '获取当前页
  if PageCount <1 then PageCount = 1
  if PageCount > TotalPage then PageCount = TotalPage
  if TotalPage>1 then RS.Move (PageCount-1) * pagesetup

  if PageCount<2 then
   PagePrevious="上一页"
  else
   PagePrevious="<a href=javascript:Ajax_CallBack('','follow"&CalendarID&"','Loading.asp?menu=LoadComment&CalendarID="&CalendarID&"&PageIndex="&PageCount-1&"');>上一页</a>"
  end if

  if PageCount=TotalPage  then
   PageNext="下一页"
  else
   PageNext="<a href=javascript:Ajax_CallBack('','follow"&CalendarID&"','Loading.asp?menu=LoadComment&CalendarID="&CalendarID&"&PageIndex="&PageCount+1&"');>下一页</a>"
  end if

  i=0
  Do While Not RS.EOF and i<pagesetup
   i=i+1
 
   if PostAuthor=CookieUserName then IsDelReplie="<a href=?UserName="&UserName&"&menu=Del&CalendarID="&Rs("CalendarID")&">删除</a>"

   comment=comment&"<tr id=CommonListCell><td>"&Rs("Body")&"<br><br><table border=0 width=100% ><tr><td>发布者:<a href=?Menu=Show&UserName="&Rs("PostAuthor")&">"&Rs("PostAuthor")&"</a> - "&Rs("DateCreated")&"</td><td align=right>"&IsDelReplie&"</td></tr></table></td></tr>"
   Rs.MoveNext
  loop

  Set Rs = Nothing

 

  if CookieUserName<>empty then comment=comment&"<tr id=CommonListCell><td colspan=2><form name=CommentForm method=POST onsubmit='return PostComment("&CalendarID&")'><input type=hidden name=CalendarID value="&CalendarID&"><textarea name=Body style=width:100% rows=6 onkeyup=ValidateTextboxAdd(this,'btnadd"&CalendarID&"') onpropertychange=ValidateTextboxAdd(this,'btnadd"&CalendarID&"')></textarea><input id='btnadd"&CalendarID&"' disabled type=submit value='发布评论'> <input onclick='loadCalendarFollow("&CalendarID&");' type=button value='取消'></td></form></tr>"
  comment="<table cellspacing=1 cellpadding=5 width=100% border=0 id=CommonListArea><tr id=CommonListHeader><td><table cellspacing=0 cellpadding=0 width=100% border=0><tr><td><b>评论</b></td><td align=right>"&PagePrevious&" | "&PageNext&" | <a href='javascript:loadCalendarFollow("&CalendarID&");'>关闭</a></td></tr></table></td></tr>"&comment&"</table>"
  response.write comment
 case "PostComment"
  UserName=unescape(HTMLEncode(Request("UserName")))
  Body=unescape(BodyEncode(Request("Body")))
  CalendarID=RequestInt("CalendarID")
  if Body<>empty then
   sql="insert into [Wo_Calendars](ParentID,PostAuthor,Body,IPAddress) values ('"&CalendarID&"','"&CookieUserName&"','"&Body&"','"&Request.ServerVariables("REMOTE_ADDR")&"')"
   conn.Execute(SQL)
  end if

end select

Sub ForumListLoad(GroupID,ParentID)
	sql="select * From [Wo_Forums] where GroupID="&GroupID&" and ParentID="&ParentID&" and IsActive=1 order by SortOrder"
	Set Rs1=Conn.Execute(sql)
	do while not rs1.eof
		ForumsList=ForumsList&"<option value='"&rs1("ForumID")&"'>"&string(ii," ")&"&gt; "&rs1("ForumName")&"</option>"
		ii=ii+1
		ForumListLoad GroupID,rs1("ForumID")
		ii=ii-1
		rs1.Movenext
	loop
	Set Rs1 = Nothing
End Sub
%>

⌨️ 快捷键说明

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