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

📄 user_blog.asp

📁 博客模块:Blog是继Email、BBS、ICQ后的第四种网络交流方式
💻 ASP
📖 第 1 页 / 共 3 页
字号:
         	   	rs.move  (currentPage-1)*MaxPerPage
         		dim bookmark
           		bookmark=rs.bookmark
            	showContent
            	showpage strFileName,totalput,MaxPerPage,true,true,"个日志"
        	else
	        	currentPage=1
           		showContent
           		showpage strFileName,totalput,MaxPerPage,true,true,"个日志"
	    	end if
		end if
	end if
	rs.Close
	set rs=Nothing
	call ShowSearch()
end sub

sub showContent()
   	dim i,rssubject
    i=0
%>
<table width='100%' border="0" cellpadding="0" cellspacing="0">
  <tr>
  <form name="myform" method="Post" action="User_blog.asp" onsubmit="return confirm('确定要执行选定的操作吗?');">
     <td>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border">
          <tr class="title"> 
            <td width="38" align="center"><font color="#FFFFFF">选中</font></td>
            <td width="82" align="center"><font color="#FFFFFF">专题</font></td>
            <td width="57" height="22" align="center"><span class="style1">发表人</span> </td>
            <td width="205" height="22" align="center"><font color="#FFFFFF">文章标题</font></td>
            <td width="93" align="center"><font color="#FFFFFF">发表时间</font></td>
            <td width="35" height="22" align="center"><font color="#FFFFFF">推荐</font></td>
            <td width="38" height="22" align="center"><font color="#FFFFFF"> 状态</font></td>
            <td width="179" height="22" align="center"><font color="#FFFFFF"> 
              操作</font></td>
          </tr>
          <%do while not rs.EOF %>
          <tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'"> 
            <td align="center"><input name='ID' type='checkbox' onclick="unselectall()" id="ID" value='<%=cstr(rs("ID"))%>'>
            <input name='uname' type="hidden"  id="uname" value='<%=trim(rs("username"))%>'></td>
            <td  align="center"><%
			set rssubject=conn.execute("select subjectname from subject where id="&rs("subjectid"))
			if not rssubject.eof then
				response.Write(rssubject(0))
			end if
			%></td>
            <td align="center"><%if rs("author")<>"" then response.Write(htmlencode(rs("author"))) else response.Write(rs("username"))%>
		    </td>
            <td align="center"> <a href=more.asp?name=<%=rs("username")%>&id=<%=rs("id")%> target=_blank><%=htmlencode(rs("topic"))%>  </a> </td>
            <td align="center"> <%
	if rs("addtime")<>"" then
		response.write rs("addtime")
	else
		response.write "&nbsp;"
	end if
	%> </td>
            <td align="center"> <%
	 if rs("isbest")="true" then
	  	response.write "<font color=red>推荐</font>"
	  else
	  	response.write " "
	  end if
			%> </td>
            <td align="center"><%
	  if rs("passcheck")="false" then
	  	response.write "<font color=red>未审</font>"
	  else
	  	response.write "已审"
	  end if
	  %></td>
            <td align="center"> 
              <%
		response.write "<a href='User_blog.asp?Action=Modify&ID=" & rs("ID") & "'>修改</a>&nbsp;"
		if userlevel=9 then
			if rs("passcheck")="true" then
				response.write "<a href='User_blog.asp?Action=Lock&ID=" & rs("ID") & "'>设为未审</a>&nbsp;"
			else
    	        response.write "<a href='User_blog.asp?Action=UnLock&ID=" & rs("ID") & "'>通过审核</a>&nbsp;"
			end if
		end if
		if userlevel=9 then
			if rs("isbest")="true" then
				response.write "<a href='User_blog.asp?Action=unisbest&ID=" & rs("ID") & "'>取消推荐</a>&nbsp;"
			else
				response.write "<a href='User_blog.asp?Action=isbest&ID=" & rs("ID") & "'>设为推荐</a>&nbsp;"
			end if
		end if
        response.write "<a href='User_blog.asp?Action=Del&ID=" & rs("ID") & "&username="&rs("username")&"' onClick='return confirm(""确定要删除此日志吗?"");'>删除</a>"
		%> </td>
          </tr>
          <%
	i=i+1
	if i>=MaxPerPage then exit do
	rs.movenext
loop
%>
        </table>  
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="200" height="30"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
              选中本页显示的所有日志</td>
            <td> <strong>操作:</strong> 
              <input name="Action" type="radio" value="Del" checked onClick="document.myform.subject.disabled=true">删除&nbsp;&nbsp;&nbsp;&nbsp;
			                <input name="Action" type="radio" value="Move" onClick="document.myform.subject.disabled=false">移动到
              <select name="subject" id="subject" disabled>
			  <%
			  set srs=conn.execute("select id,subjectname from subject where username='"&username&"'")
			  while not srs.eof
			  response.Write "<option value="&srs(0)&">"&srs(1)&"</option>"
			  srs.movenext
			  wend
			  set srs=nothing
			  %>
              </select>&nbsp;&nbsp;&nbsp;&nbsp;
              <% if userlevel=9 then %>
			  <input name="Action" type="radio" value="Lock" onClick="document.myform.UserLevel.disabled=true"> 
              设为未审核&nbsp;&nbsp;&nbsp;
              <input name="Action" type="radio" value="UnLock" onClick="document.myform.UserLevel.disabled=true">              
              通过审核&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <%end if%>
              <input type="submit" name="Submit" value=" 执 行 "></td>
  </tr>
</table>
</td>
</form></tr></table>
<%
set rssubject=nothing
end sub

sub ShowSearch()
%>
<form name="theForm" method="post" action="User_blog.asp">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr class="tdbg">
    <td width="120"><strong>日志高级查询:</strong></td>
    <td width="300">
      <select name="Field" id="Field">
        <option value="ID">日志ID</option>
        <option value="topic" selected>日志标题</option>
      </select>
      <input name="Keyword" type="text" id="Keyword" size="20" maxlength="30">
      <input type="submit" name="Submit2" value=" 查 询 ">
      <input name="UserSearch" type="hidden" id="UserSearch" value="10">
	</td>
    <td>若为空,则查询所有日志</td>
  </tr>
</table>
</form>
<%
end sub

sub Modify()
	dim ID
	dim rsblog,sqlblog
	ID=trim(request("ID"))
	if ID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>参数不足!</li>"
		exit sub
	else
		ID=Clng(ID)
	end if
	Set rsblog=Server.CreateObject("Adodb.RecordSet")
	if userlevel=9 then
		sqlblog="select * from [blog] where ID=" & ID
	else
		sqlblog="select * from [blog] where ID=" & ID&" and (username='"&username&"' or author='"&username&"')"
	end if
	rsblog.Open sqlblog,Conn,1,3
	if rsblog.bof and rsblog.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>找不到指定的日志!</li>"
		rsUser.close
		set rsUser=nothing
		exit sub
	end if
	call getteam()


%>
<FORM action="user_blog.asp?action=SaveModify" method="post" name="theForm" onSubmit="return VerifySubmit()">
  <table width="98%" border="0" align=center cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border">
    <tr align="center"> 
      <td height=25 colspan=5 class="topbg"><strong>修 改 日 志</strong> 
    <tr> 
      <td width="11%"  class="tdbg" height=23>日志标题:</td>
      <td width="89%" colspan="4" class="tdbg"><input name="topic" type=text class="cont" id="topic" value="<%=rsblog("topic")%>" size="50" maxlength="50"> 
        <font color="#FF0000"> *</font></td>
    </tr>
    <tr> 
      <td width="11%" class="tdbg" height=23>日志心情:</td>
      <td colspan="4" class="tdbg"> <input type="radio" name="face" value="0" <%if rsblog("face")=0 then response.Write("checked")%>>
        <input type="radio" name="face" value="1" <%if rsblog("face")=1 then response.Write("checked")%>> <img src="images/face/1.gif" width="20" height="20"> <input type="radio" name="face" value="2" <%if rsblog("face")=2 then response.Write("checked")%>> <img src="images/face/2.gif" width="20" height="20"> 
        <input type="radio" name="face" value="3" <%if rsblog("face")=3 then response.Write("checked")%>> <img src="images/face/3.gif" width="20" height="20"> <input type="radio" name="face" value="4" <%if rsblog("face")=4 then response.Write("checked")%>> <img src="images/face/4.gif" width="20" height="20"> 
        <input type="radio" name="face" value="5" <%if rsblog("face")=5 then response.Write("checked")%>> <img src="images/face/5.gif" width="20" height="20"> <input type="radio" name="face" value="6" <%if rsblog("face")=6 then response.Write("checked")%>> <img src="images/face/6.gif" width="18" height="20"> 
        <input type="radio" name="face" value="7" <%if rsblog("face")=7 then response.Write("checked")%>> <img src="images/face/7.gif" width="20" height="20"> <input type="radio" name="face" value="8" <%if rsblog("face")=8 then response.Write("checked")%>> <img src="images/face/8.gif" width="20" height="20"> 
        <input type="radio" name="face" value="9" <%if rsblog("face")=9 then response.Write("checked")%>> <img src="images/face/9.gif" width="20" height="20"> </FONT></td>
    </tr>
    <tr> 
      <td height=23 colspan="5" class="tdbg">系统分类: 
        <select name="classid" id="classid">
          <option value="<%=rsblog("classid")%>" selected>
          <%
	  set rs=conn.execute("select classname from classname where id="&rsblog("classid"))
	  if not rs.eof then
	  response.Write rs(0)
	  else
	  response.Write "  "
	  end if
		
	  %>
          </option>
          <%
		set rs=conn.execute("select id,classname from classname")
		do while not rs.eof  %>
          <option value=<%=rs(0)%>><%=rs(1)%></option>
          <%
			rs.movenext
		loop
		set rs=nothing  
	    %>
        </select>
           我的专题(分类): 
        <select name="subjectid" id="subjectid">
          <option value="<%=rsblog("subjectid")%>" selected>
          <%
	  set rs=conn.execute("select subjectname from subject where id="&rsblog("subjectid"))
	  if not rs.eof then
	  response.Write rs(0)
	  else
	  response.Write "  "
	  end if
		
	  %>
          </option>
          <%
		set rs=conn.execute("select id,subjectname from subject where username='"&rsblog("username")&"'")
		do while not rs.eof  %>
          <option value=<%=rs(0)%>><%=rs(1)%></option>
          <%
			rs.movenext
		loop
		set rs=nothing  
	    %>
        </select>
           是否隐藏这篇日志: 
        <select name="ishide" id="ishide">
          <option value="true" <%if rsblog("ishide")="true" then response.Write "selected"%>>是</option>
          <option value="false" <%if rsblog("ishide")<>"true" then response.Write "selected"%>>否</option>
        </select></td>
    </tr>
    <tr> 
      <td height=23 colspan="5" class="tdbg">日志密码: 
        <input name="ispassword" type="password" id="ispassword" size="10" maxlength="10" value="<%=rsblog("ispassword")%>">
        (无密码请留空 )  部分显示字数: 
        <input name="showword" type="text" id="showword" value="<%=rsblog("showword")%>" size="10" maxlength="10">
        (全部显示请留空或为零)</td>
    </tr>
    <tr> 
      <td height=23 colspan="5" class="tdbg"><INPUT type="hidden" name="edit" id="edit" value="<%
				if rsblog("logtext")<>"" then
					response.Write Server.HtmlEncode(rsblog("logtext"))
				else
					response.Write ""
				end if
				%>""> <!--#include file="edit.asp"--> </td>
    </tr>
    <tr>
      <td colspan="5" class="tdbg">团队博客: 
        <select name="blogteam" id="s1" onChange="setSort(this,this.form.s2);">
          <option value="<%=username%>">我的BLOG</option>
          <%
		set rs=conn.execute("select blogteam.mainuser,[user].blogname,blogteam.id from blogteam,[user] where blogteam.otheruser='"&username&"' and blogteam.mainuser=[user].username")
		do while not rs.eof  %>
          <option value=<%=rs(0)%><%if trim(rs(0))=trim(rsblog("username")) then response.Write(" selected")%>><%=rs(1)%> </option>
          <%
		  	response.Write("rs0"&trim(rs(0)))
			response.Write("rsblog"&trim(rsblog("username")))
			rs.movenext
		loop
	    %>
        </select>
        (选择日志发表在哪个BLOG)  团队博客专题: 
        <select name="blogteamsubject" id="s2">
          
		  <%if username<>rsblog("username") then 
		  set rs=conn.execute("select id,subjectname from subject where username='"&rsblog("username")&"'")
		  while not rs.eof
		  %>
		  <option value=<%=rs(0)%> <%if clng(rsblog("subjectid"))=clng(rs(0)) then response.Write(" selected")%>><%=htmlencode(rs(1))%></option>
		  <%
		  rs.movenext
		  wend
		  else
		  %>
		  <option value="0" selected>我的专题</option>
		  <%
		  end if
		  set rs=nothing
		  %>
        </select></td>
    </tr>
    <tr> 
      <td colspan="5" class="tdbg">设置发表时间: 
        <select name="selecty" id="selecty">
          <%
	  dim y
	  y=2000
	  while y<=2008
	  	if year(rsblog("addtime"))=y then
		  	response.Write "<option value="&y&" selected>"&y&"</option>"
		else
		  	response.Write "<option value="&y&">"&y&"</option>"
		end if
		y=y+1
	  wend
		%>
        </select>
        <select name="selectm" id="selectm">
          <%
	  dim m
	  m=1
	  while m<=12
	  	if month(rsblog("addtime"))=m then
		  	response.Write "<option value="&m&" selected>"&m&"</option>"
		else
		  	response.Write "<option value="&m&">"&m&"</option>"
		end if
		m=m+1
	  wend
		%>
        </select>
        <select name="selectd" id="selectd">
          <%
	  dim d
	  d=1
	  while d<=31
	  	if day(rsblog("addtime"))=d then
		  	response.Write "<option value="&d&" selected>"&d&"</option>"
		else
		  	response.Write "<option value="&d&">"&d&"</option>"
		end if
		d=d+1
	  wend
		%>
        </select>
        <select name="selecth" id="selecth">
          <%
	  dim h
	  h=0	  
	  while h<=23
	  	if hour(rsblog("addtime"))=h then
		  	response.Write "<option value="&h&" selected>"&h&"</option>"
		else
		  	response.Write "<option value="&h&">"&h&"</option>"
		end if
		h=h+1
	  wend
		%>
        </select>
        <select name="selectmi" id="selectmi">
          <%

⌨️ 快捷键说明

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