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

📄 func_guest.asp

📁 该软件是帮助大学生更好的生活
💻 ASP
📖 第 1 页 / 共 3 页
字号:
<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true	
'强制浏览器重新访问服务器下载页面,而不是从缓存读取页面
Response.Buffer = True 
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = 0 
Response.CacheControl = "no-cache" 
%>
<!--#include file="conn.asp"-->
<!--#include file="Conn_User.asp"-->
<!--#include file="config.asp"-->
<!--#include file="ubbcode.asp"-->
<!--#include file="func.asp"-->
<!--#include file="ad_code_guest.asp"-->
<!--#include file="md5.asp"-->
<%
dim strChannel,sqlChannel,rsChannel,ChannelUrl,ChannelName
dim strFileName,MaxPerPage,totalPut,CurrentPage,TotalPages
dim BeginTime,EndTime,founderr, errmsg,i
dim rs,sql,rsGuest,sqlGuest
dim PageTitle,strPath,strPageTitle
dim SkinID,ClassID,AnnounceCount
dim UserGuestName,UserType,UserSex,UserEmail,UserHomepage,UserOicq,UserIcq,UserMsn
dim WriteName,WriteType,WriteSex,WriteEmail,WriteOicq,WriteIcq,WriteMsn,WriteHomepage
dim WriteFace,WriteImages,WriteTitle,WriteContent,SaveEdit,SaveEditId
dim GuestType,LoginName,AdminReplyContent
dim Action,SubmitType,GuestPath,TitleName,keyword
Set rsGuest= Server.CreateObject("ADODB.Recordset")

'***********************************************************************************************
strPath= "&nbsp;您现在的位置:&nbsp;<a href='" & SiteUrl & "'>" & SiteName & "</a>"
strPageTitle= SiteTitle
if ShowSiteChannel="Yes" then
	strChannel= "<table border=0 cellSpacing=0 style='CURSOR: hand; width:1%; height:25; align:right; letter-spacing: 2px; background-image: url(images/menu_bg3.gif)'><tr>"
	sqlChannel="select * from Channel order by OrderID"
	set rsChannel=server.CreateObject("adodb.recordset")
	rsChannel.open sqlChannel,conn,1,1
	do while not rsChannel.eof
		if rsChannel("ChannelID")=ChannelID then
			ChannelUrl=rsChannel("LinkUrl")
			ChannelName=rsChannel("ChannelName")
			strChannel=strChannel & "<td background='images/menu_bg4.gif'></td><a href='" & ChannelUrl & "'><td nowrap class='menu_bg1' onmouseover='this.className=""menu_bg2""' onmouseout='this.className=""menu_bg1""'>" & ChannelName & "</td></a>"
		else
			strChannel=strChannel & "<td background='images/menu_bg4.gif'></td><a href='" & rsChannel("LinkUrl") & "'><td nowrap class='menu_bg' onmouseover='this.className=""menu_bg2""' onmouseout='this.className=""menu_bg""'>" & rsChannel("ChannelName") & "</td></a>"
		end if
		rsChannel.movenext
	loop
	rsChannel.close
	set rsChannel=nothing
	strPath=strPath & "&nbsp;&gt;&gt;&nbsp;<a href='" & ChannelUrl & "'>" & ChannelName & "</a>"
	strPageTitle=strPageTitle & " >> " & ChannelName
end if
BeginTime=Timer
ClassID=0
'*********************************************************************************************

strFileName="GuestBook.asp"
GuestPath="images/guestbook/"
MaxPerPage=10
SaveEdit=0							
if request("page")<>"" then
    currentPage=cint(request("page"))
else
	currentPage=1
end if
TitleName=ChannelName
Action=request("Action")
select case Action
	case "write"
		PageTitle="添加留言"
	case "savewrite"
		PageTitle="保存留言"
	case "reply"
		PageTitle="回复留言"
	case "edit"
		PageTitle="编辑留言"
	case "del"
		PageTitle="删除留言"
	case else
		PageTitle="网站留言"
end select

GuestType=0
if CheckUserLogined()=true then
	GuestType=1
	LoginName=Trim(Request.Cookies("luyeweb")("UserName"))
end if

keyword=trim(request("keyword"))
if keyword<>"" then 
	keyword=ReplaceBadChar(keyword)
	keyword=Replace(keyword,"[","")
	keyword=Replace(keyword,"]","")
end if
if keyword<>"" then TitleName="搜索含有 <font color=red>"&keyword&"</font> 的留言"


'=================================================
'过程名:GuestBook_Left()
'作  用:显示左侧留言功能
'参  数:无
'=================================================
sub GuestBook_Left()
	set rsGuest=conn.execute("select count(*) from Guest where GuestIsPassed=False")
	if GuestType=1 then
		response.write "" & vbcrlf
	else
		response.write "" & vbcrlf
	end if
	if EnableGuestCheck="Yes" then
		response.write "<br>留言需管理员审核后才能显示!" & vbcrlf
		response.write "待审留言:<font color=red>"&rsGuest(0)&"</font> 条" & vbcrlf
	else
		response.write "" & vbcrlf
	end if

	if GuestType=1 then
		response.write ""
	end if
	response.write "" & vbcrlf
	response.write "" & vbcrlf
end sub
%>

<%
'=================================================
'过程名:GuestBook_Search()
'作  用:显示留言搜索
'参  数:无
'=================================================
sub GuestBook_Search()
	response.write "<table border='0' cellpadding='0' cellspacing='0'>"
	response.write "<form method=""post"" name='SearchForm' action='" & strFileName & "'>"
	response.write "<tr><td height='40' >"
	response.write "&nbsp;&nbsp;<input type='text' name='keyword'  size='15' value='关键字' maxlength='50' onFocus='this.select();'>&nbsp;"
	response.write "<input type='submit' name='Submit'  value='搜索'>"
	response.write "</td></tr></form></table>"
end sub
%>

<%

'=================================================
'过程名:GuestBook()
'作  用:留言本功能调用
'参  数:无
'=================================================
sub GuestBook()
	select case Action
		case "write"
			call WriteGuest()
		case "savewrite"
			call SaveWriteGuest()
		case "reply"
			call ReplyGuest()
		case "edit"
			call EditGuest()
		case "del"
			call DelGuest()
		case "user"
			call ShowAllGuest(3)
		case else
			call GuestMain()
	end select
end sub

'=================================================
'过程名:GuestMain()
'作  用:留言主函数
'参  数:无
'=================================================
sub GuestMain()
	if GuestType=1 then
		ShowAllGuest(1)
	else
		ShowAllGuest(2)
	end if
end sub

'=================================================
'过程名:ShowAllGuest()
'作  用:分页显示所有留言
'参  数:ShowType-----  0为显示所有
'						1为显示已通过审核及用户自己发表的留言
'						2为显示已通过审核的留言(用于游客显示)
'						3为显示用户自己发表的留言
'=================================================
sub ShowAllGuest(ShowType)
	if ShowType=1 then
		sqlGuest="select * from Guest where (GuestIsPassed=True or GuestName='"&LoginName&"')"
	elseif ShowType=2 then
		sqlGuest="select * from Guest where GuestIsPassed=True"
	elseif ShowType=3 then
		sqlGuest="select * from Guest where GuestName='"&LoginName&"'"
	elseif ShowType=4 then
		sqlGuest="select * from Guest where GuestIsPassed=False"
	else
		if keyword<>"" then
			sqlGuest="select * from Guest where 1"
		else
			sqlGuest="select * from Guest"
		end if
	end if
	if keyword<>"" then
		sqlGuest=sqlGuest & " and (GuestTitle like '%" & keyword & "%' or GuestContent like '%" & keyword & "%' or GuestName like '%" & keyword & "%' or GuestReply like '%" & keyword & "%') "
	end if

	sqlGuest=sqlGuest&" order by GuestMaxId desc"
	set rsGuest=server.createobject("adodb.recordset")
	rsGuest.open sqlGuest,conn,1,1
	if rsGuest.bof and rsGuest.eof then
		totalput=0
		response.write "<br><img src='skin/1/xiao.gif'>没有任何留言"
	else
		totalput=rsGuest.recordcount
		if currentPage=1 then
			call ShowGuestList()
		else
			if (currentPage-1)*MaxPerPage<totalPut then
         	   	rsGuest.move  (currentPage-1)*MaxPerPage
         		dim bookmark
           		bookmark=rsGuest.bookmark
            	call ShowGuestList()
        	else
	        	currentPage=1
           		call ShowGuestList()
	    	end if
		end if
	end if
	rsGuest.close
	set rsGuest=nothing
end sub

'=================================================
'过程名:ShowGuestList()
'作  用:显示留言
'参  数:无
'=================================================
sub ShowGuestList()
	dim i,GuestTip,TipName,TipSex,TipEmail,TipOicq,TipHomepage,isdelUser,AdminPurview
	i=0
	do while not rsGuest.eof
		isdelUser=0
		if rsGuest("GuestType")=1 then
			sql="select * from " & db_User_Table & " where " & db_User_Name & "='" & rsGuest("GuestName")&"'"
			set rs=server.createobject("adodb.recordset")
			rs.open sql,Conn_User,1,1
			if not rs.bof and not rs.eof then
				UserGuestName=rs(db_User_Name)
				UserSex=rs(db_User_Sex)
				UserEmail=rs(db_User_Email)
				UserOicq=rs(db_User_QQ)
				UserIcq=rs(db_User_Icq)
				UserMsn=rs(db_User_Msn)
				UserHomepage=rs(db_User_Homepage)
			else
				isdelUser=1
			end if
		end if
		if rsGuest("GuestType")<>1 or isdelUser=1 then
			UserGuestName=rsGuest("GuestName")
			UserSex=rsGuest("GuestSex")
			UserEmail=rsGuest("GuestEmail")
			UserOicq=rsGuest("GuestOicq")
			UserIcq=rsGuest("GuestIcq")
			UserMsn=rsGuest("GuestMsn")
			UserHomepage=rsGuest("GuestHomepage")
		end if
		TipName=UserGuestName
		if isdelUser=1 then TipName=TipName&"(已删除)"
		if UserEmail="" or isnull(UserEmail) then
			TipEmail="未填"
		else
			TipEmail=UserEmail
		end if
		if UserOicq="" or isnull(UserOicq) then
			TipOicq="未填"
		else
			TipOicq=UserOicq
		end if
		if UserHomepage="" or isnull(UserHomepage) then
			TipHomepage="未填"
		else
			TipHomepage=UserHomepage
		end if
		if UserIcq="" or isnull(UserIcq) then UserIcq="未填"
		if UserMsn="" or isnull(UserMsn) then UserMsn="未填"
		if UserSex=1 then
			TipSex="(酷哥)"
		elseif UserSex=0 then
			TipSex="(靓妹)"
		else
			TipSex=""
		end if
		GuestTip="&nbsp;姓名:"&TipName&" "&TipSex&"<br>&nbsp;主页:"&TipHomepage&"<br>&nbsp;OICQ:"&TipOicq&"<br>&nbsp;信箱:"&TipEmail&"<br>&nbsp;地址:"&rsGuest("GuestIP")&"<br>&nbsp;时间:"&rsGuest("GuestDatetime")
		%>
<table width="100%"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1%" rowspan="2" align="center" valign="top" style="padding:5px,25px,5px,30px "><img src="<%=GuestPath%><%=rsGuest("GuestImages")%>.gif" width="80" height="90" onMouseOut=toolTip() onMouseOver="toolTip('<%=GuestTip%>')"><br>
    <%
		if rsGuest("GuestType")=1 then
			response.write "<font color=""#006633"">【用户】<br>"&KeywordReplace(UserGuestName)&"</font>"
		else
			response.write "【游客】<br>"&KeywordReplace(UserGuestName)
		end if
		%></td>
    <td valign="top"><table width="100%" height="100%"  border="0" cellpadding="3" cellspacing="0">
      <tr>
        <td><font color=green>主题:</font>&nbsp;<b><%=KeywordReplace(rsGuest("GuestTitle"))%></b></td>
        </tr>
    </table>
      <table width="100%" height="100%"  border="0" cellpadding="3" cellspacing="0">
      <tr>
        <td width="20" valign="top"><img src="<%=GuestPath%>face<%=rsGuest("GuestFace")%>.gif" width="19" height="19"></td>
        <td><%
	  if rsGuest("GuestIsPrivate")=true and rsGuest("GuestName")<>LoginName then
		response.write "<br><font color=green>"

⌨️ 快捷键说明

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