?? serch.asp
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--#include file="connsf.asp" -->
<!--#include file="md5.inc" -->
<!--#include file="checkstr.asp" -->
<!--#include file="config.asp" -->
<%'檢驗用戶
user=checkstr(session("user"))
pass1=ucase(md5(session("pass")))
str="select 姓名,能否發送 from user_teacher where 用戶名='"&user&"' and 密碼='"&pass1&"'"
set rs=conn.execute(str)
if rs.eof then
response.redirect("user_login.asp")
else
user_name=rs("姓名")
sendyesno=rs("能否發送")
end if
rs.close
%>
<%doing=Trim(Request.QueryString("doing"))%>
<%'清除信息
if doing="clear" then
clear_id=cint(Request.QueryString("clear_id"))
str="select 已清除者 from woa where id="&clear_id&""
set rs=conn.execute(str)
cleared=rs("已清除者")&user_name&"|"
rs.close
str="update woa set 已清除者='"&cleared&"' where id="&clear_id&" and 清除=1"
conn.execute(str)
end if
%>
<%'刪除信息
if doing="delete" then
dele_id=cint(Request.QueryString("dele_id"))
str="select 跟貼數,附件數,附件 from woa where id="&dele_id&" and 主題=1"
set rs=conn.execute(str)
if rs("跟貼數")>0 then '先刪除該信息下的留言
str="select 附件數,附件 from woa where 跟貼主題="&dele_id&""
set rs1=conn.execute(str)
do while not rs1.eof
if rs1("附件數")>0 then
fj_file=rs1("附件")
do while len(fj_file)>1
del_file=mid(fj_file,1,instr(fj_file,"|")-1)
fj_file=mid(fj_file,instr(fj_file,"|")+1)
del_file=Server.MapPath(del_file)
Set fs=Server.CreateObject("Scripting.FileSystemObject")
if fs.FileExists(del_file) then
fs.DeleteFile del_file,True
end if
loop
end if
rs1.movenext
loop
rs1.close
str="delete from woa where 跟貼主題="&dele_id&""
conn.execute(str)
end if
if rs("附件數")>0 then '刪除主題下的附件
fj_file=rs("附件")
do while len(fj_file)>1
del_file=mid(fj_file,1,instr(fj_file,"|")-1)
fj_file=mid(fj_file,instr(fj_file,"|")+1)
del_file=Server.MapPath(del_file)
Set fs=Server.CreateObject("Scripting.FileSystemObject")
if fs.FileExists(del_file) then
fs.DeleteFile del_file,True
end if
loop
end if
rs.close
str="delete from woa where id="&dele_id&" and 發文者='"&user_name&"' and 主題=1"
conn.execute(str)
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>無標題文檔</title>
<!--#include file="css.css" -->
</head>
<%
keyword=Trim(Request("keyword"))
sclass=Trim(Request("sclass"))
looked=Trim(Request("looked"))
%>
<body topmargin="1" oncontextmenu="return false">
<div align="center">
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tabletblg">
<tr>
<td><!--#include file="top.asp" --></td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td height="30" bgcolor="#6699FF">
<!--#include file="menu.asp" -->
</td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td height="30" bgcolor="#6699FF" class="fontsize14"> <%=user_name%>,你好!歡迎使用留溪網上傳文系統。 以下是你搜索得到的結果。</td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td bgcolor="#6699FF">
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="fontsize10"> </td>
</tr>
</table>
<table width="740" border="1" align="center" cellpadding="2" cellspacing="0" borderColorLight="#000000" borderColorDark="#ffffff">
<tr class="fontsize12">
<td bgcolor="#99CCFF"> <div align="center"><strong>狀態</strong></div></td>
<td height="30" bgcolor="#99CCFF">
<div align="center"><strong>主 題 </strong>(點擊主題文字可瀏覽信息內容)</div></td>
<td bgcolor="#99CCFF">
<div align="center"><strong>發送人</strong></div></td>
<td bgcolor="#99CCFF">
<div align="center"><strong>日期</strong></div></td>
<td bgcolor="#99CCFF">
<div align="center"><strong>時間</strong></div></td>
<td bgcolor="#99CCFF">
<div align="center"><strong>點擊</strong></div></td>
<td bgcolor="#99CCFF">
<div align="center"><strong>回復</strong></div></td>
<td bgcolor="#99CCFF">
<div align="center"><strong>操作</strong></div></td>
</tr>
<%'確定顯示的信息
user_name1="|"&user_name&"|"
if looked="no" then
str="select * from woa where 主題=1 and (發文者='"&user_name&"' or (所有人='1' or 接收者 like '%"&user_name1&"%') and 已清除者 not like '%"&user_name1&"%') and 已看者 not like '%"&keyword&"%' and 發文者<>'"&user_name&"' order by 置頂 desc,發文日期 desc,發文時間 desc"
else
str="select * from woa where 主題=1 and (發文者='"&user_name&"' or (所有人='1' or 接收者 like '%"&user_name1&"%') and 已清除者 not like '%"&user_name1&"%') and "&sclass&" like '%"&keyword&"%' order by 置頂 desc,發文日期 desc,發文時間 desc"
end if
rs.open str,conn,3,2
rs.pagesize=msgpagesize
%>
<% '確定顯示的頁碼
pageno=request("pageno")
if isnumeric(pageno)=false then pageno=1 end if
pageno=cint(pageno)
if pageno="" or pageno<=0 then
pageno=1
end if
if pageno>rs.pagecount then
pageno=rs.pagecount
end if
%>
<%if rs.eof then%>
<tr class="fontsize12">
<td height="30" colspan="8" bgcolor="#99CCFF"><div align="center" class="fontsize14"><font color="#FF0000">沒有任何信息。</font></div></td>
</tr>
<%else%>
<%rs.absolutepage=pageno
for n=1 to rs.pagesize%>
<tr class="fontsize12">
<td width="26" bgcolor="#99CCFF">
<div align="center">
<%if rs("置頂")=1 then%>
<img src="images/locktop.gif">
<%else%>
<%if rs("發文者")=user_name then%>
<img src="images/file1.gif">
<%else%>
<%if instr(rs("已看者"),"|"&user_name&"(")>0 then%>
<img src="images/file2.gif">
<%else%>
<img src="images/file3.gif">
<%end if%>
<%end if%>
<%end if%>
</div></td>
<td width="440" height="26" bgcolor="#99CCFF">
<%if rs("跟貼數")>0 then%> <img src="images/cat.gif"> <%else%> <img src="images/cat1.gif"> <%end if%> <a href=disp.asp?disp_id=<%=rs("id")%>&pageno=<%=pageno%> class="fontsize12wu" onMouseOver="window.status='';return true"><%=left(rs("標題"),30)%>
<%if len(rs("標題"))>30 then response.write "……"%>
</a> <%if rs("附件數")>0 then%> <img src="images/fujian.gif"> <%end if%>
</td>
<td width="50" bgcolor="#99CCFF">
<div align="center"><a href=serch.asp?keyword=<%=rs("發文者")%>&sclass=發文者 class="fontsize12wu" onMouseOver="window.status='';return true"><%=rs("發文者")%></a></div></td>
<td width="60" bgcolor="#99CCFF">
<div align="center"><a href=serch.asp?keyword=<%=rs("發文日期")%>&sclass=發文日期 class="fontsize12wu" onMouseOver="window.status='';return true"><%=rs("發文日期")%></a></div></td>
<td width="48" bgcolor="#99CCFF">
<div align="center"><%=rs("發文時間")%></div></td>
<td width="28" bgcolor="#99CCFF">
<div align="center"><%=rs("點擊數")%></div></td>
<td width="28" bgcolor="#99CCFF">
<div align="center"><%=rs("跟貼數")%></div></td>
<td width="28" bgcolor="#99CCFF">
<div align="center">
<%if rs("發文者")=user_name then%>
<a href=serch.asp?doing=delete&dele_id=<%=rs("id")%>&pageno=<%=pageno%>&keyword=<%=keyword%>&sclass=<%=sclass%> class="fontsize12wu" onMouseOver="window.status='';return true">刪除</a>
<%else%>
<a href=serch.asp?doing=clear&clear_id=<%=rs("id")%>&pageno=<%=pageno%>&keyword=<%=keyword%>&looked=no class="fontsize12wu" onMouseOver="window.status='';return true">清除</a>
<%end if%>
</div></td>
</tr>
<%rs.movenext
if rs.eof then exit for
next%>
<%end if%>
<tr class="fontsize12">
<td height="30" colspan="8" bgcolor="#99CCFF"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="85%" class="fontsize12"><div align="center"> <a href="serch.asp?pageno=1&keyword=<%=keyword%>&sclass=<%=sclass%>" class="fontsize12wu" onMouseOver="window.status='';return true">首頁</a>
<a href="serch.asp?pageno=<%=pageno-5%>&keyword=<%=keyword%>&sclass=<%=sclass%>" class="fontsize12wu" onMouseOver="window.status='';return true">前5頁</a>
<a href="serch.asp?pageno=<%=pageno-1%>&keyword=<%=keyword%>&sclass=<%=sclass%>" class="fontsize12wu" onMouseOver="window.status='';return true">前頁</a>
第<font color="#FF0000"><strong><%=pageno%></strong></font>頁 <a href="serch.asp?pageno=<%=pageno+1%>&keyword=<%=keyword%>&sclass=<%=sclass%>" class="fontsize12wu" onMouseOver="window.status='';return true">后頁</a>
<a href="serch.asp?pageno=<%=pageno+5%>&keyword=<%=keyword%>&sclass=<%=sclass%>" class="fontsize12wu" onMouseOver="window.status='';return true">后5頁</a>
<a href="serch.asp?pageno=<%=rs.pagecount%>&keyword=<%=keyword%>&sclass=<%=sclass%>" class="fontsize12wu" onMouseOver="window.status='';return true">尾頁</a> 共<font color="#FF0000"><strong><%=rs.recordcount%></strong></font> 每頁<font color="#FF0000"><strong><%=msgpagesize%></strong></font> 共<font color="#FF0000"><strong><%=rs.pagecount%></strong></font>頁</div></td><td width="15%">
<form action="serch.asp?keyword=<%=keyword%>&sclass=<%=sclass%>" method="post" name="form1" class="fontsize12wu">
<div align="center">第
<input name="pageno" type="text" class="inputtext" id="pageno" size="3">
頁
<input name="Submit" type="submit" class="inputbox" value="Go">
</div></td>
</form>
</tr>
</table></td>
</tr>
<tr class="fontsize12">
<td height="40" colspan="8" bgcolor="#99CCFF">圖例說明:<img src="images/locktop.gif">
被置頂的信息;<img src="images/file1.gif"> <a href="serch.asp?keyword=<%=user_name%>&sclass=發文者" class="fontsize12wu" onMouseOver="window.status='';return true">自己發送的信息</a>;<img src="images/file2.gif">
<a href="serch.asp?keyword=<%=user_name%>&sclass=已看者" class="fontsize12wu" onMouseOver="window.status='';return true">已看過的信息;</a><img src="images/file3.gif">
<a href="serch.asp?keyword=<%=user_name%>&looked=no" class="fontsize12wu" onMouseOver="window.status='';return true">未看的信息;</a><img src="images/cat.gif">
有回復的信息;<img src="images/cat1.gif"> 無回復的信息。</td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="fontsize10"> </td>
</tr>
</table></td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td height="40" bgcolor="#6699FF"><table width="740" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form action="serch.asp" method="post" name="form2" class="fontsize14wu">
<div align="center">搜索 關鍵詞:
<input name="keyword" type="text" class="inputtext" id="keyword">
類別:
<select name="sclass" class="inputtext" id="sclass">
<option value="標題">主 題</option>
<option value="內容">內 容</option>
<option value="發文者">發送者</option>
</select>
<input name="Submit2" type="submit" class="inputbox" value=" 搜索結果 ">
</div>
</form></td>
</tr>
</table></td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelr">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><!--#include file="bottom.asp" --></td>
</tr>
</table>
</div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -