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

📄 view_blog.asp

📁 网络办公系统源码
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../../config.asp"-->
<!--#include file="../checklogin.asp"-->
<!--#include file="../../inc/navigate.asp"-->
<%
dim iRecordCount,iMaxPageCount,iPageCount,iCurrentPageIndex,i,sTMP  '分页
iMaxPageCount=10 '一页多少行记录
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="../img/css1.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	line-height:150%
}
.style2 {
	color: #FFFFFF;
	font-weight: bold;
}
-->
</style>
</head>
<%
act=request.QueryString("act")
id=replace(request.QueryString("id"),"'","")
conn.execute("update oa_blog set hits=hits+1 where id="&id)
sql="select * from oa_blog where id="&id
set rs=conn.execute(sql)
if not rs.eof then
	title=rs("oa_blogtitle")
	content=rs("oa_blogcontent")
	addtime=rs("addtime")
	uname=rs("uname")
	uid=rs("uid")
end if
rs.close
set rs=nothing
'---------------------------------------------------
delid=request.QueryString("delid")
delsql="delete from oa_replyblog where id="&delid
if act="del" then
 if session("adminid")<>uid then
		call Message("只有作者本人才可以删除","view_blog.asp?id="&id&"")
		call endexit()
 end if
	conn.execute(delsql)
		call Message("删除成功","view_blog.asp?id="&id&"")
		call endexit()
end if

'---------回复处理---------------------------------

rcontent=HTMLEncode(trim(request.Form("rcontent")))
bid=request.Form("bid")
runame=session("truename")
rtime=now()
sqls="insert into oa_replyblog(blogid,rcontent,runame,rtime) " & _
"values("&bid&",'"&rcontent&"','"&runame&"','"&rtime&"')"
if act="rep" then
	if rcontent="" then
		call Message("请选输入回复内容","back")
		call endexit()
	end if
	conn.execute(sqls)
		call Message("回复成功","view_blog.asp?id="&id&"")
		call endexit()
end if		
'-------------------------------------------------------------------------------
%>
<body>

<table width="99%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F2F2F2" class="tabel1">
  <tr align="left" bgcolor="#CC0000">
    <td height="25" colspan="2"><span class="style2"><font style="font-size:15px ">【<%=addtime%>】<%=title%>
    <input name="Submit2" type="button" class="bon" id="Submit3" value="发布新日记" onClick="window.location.href='add_newblog.asp'">
    <font style="font-size:15px ">
    <input name="Submit3" type="button" class="bon" value="返回上页" onClick="window.history.go(-1)">
    </font> </font></span></td>
  </tr>
    <tr bgcolor="#cccccc">
    <td height="5"  colspan="2"></td>
    </tr>
  <tr bgcolor="#F9F9F9">
    <td width="20%" height="25" align="center"><%=uname%></td>
    <td width="80%" height="25" align="left"><%=content%></td>
  </tr>
    <tr bgcolor="#FF3300">
    <td height="5"  colspan="2"></td>
    </tr>

  <%
  '显示回复内容
  				Sql="select * from oa_replyblog where blogid="&id
  			  Call GetCurrentPageIndex()  '取得当前页码
				set my_rs=server.CreateObject("adodb.recordset")
				my_rs.open Sql,conn,1,3
				my_rs.PageSize=iMaxPageCount
				my_rs.CacheSize =iMaxPageCount
				if my_rs.recordCount <>   0   then   my_rs.Absolutepage=iCurrentPageIndex
				iRecordCount=my_rs.RecordCount  '所有查询出来的记录数
				iPageCount=my_rs.PageCount  '最终多少页
				if iCurrentPageIndex>iPageCount then iCurrentPageIndex=iPageCount  '控制当前页不得超出范围
				sPageNavigate=GetNavigate("view_blog.asp?id="&id&"",iRecordCount,iMaxPageCount,iCurrentPageIndex,true,true,"项")  '取得分页表格
				if Not my_rs.Eof then
				For i = 1 to iMaxPageCount '利用for next 循环依次读出当前页的记录 
			  if my_rs.EOF then  Exit For
			  	bgColor="#F8F8F8"
				if i mod 2=0 then bgColor="#DFEFFF"

  %>
  <tr bgcolor="<%=bgColor%>">
    <td align="center"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="20" align="center">回复人:<%=my_rs("runame")%></td>
      </tr>
      <tr>
        <td height="20" align="center"><p><%=my_rs("rtime")%></p>          </td>
      </tr>
      <tr>
        <td height="20" align="center">【<a href="?delid=<%=my_rs("id")%>&act=del&id=<%=id%>"><img src="../img/delete.gif" width="16" height="16" border="0">删除</a>】</td>
      </tr>
    </table>      <p>&nbsp;</p>    </td>
    <td height="25" align="left" valign="top">&nbsp;<%=my_rs("rcontent")%></td>
  </tr>
              <%
						my_rs.MoveNext()
				       Next
                     End if
                  my_rs.close
                 set my_rs=nothing
				%>
  <tr bgcolor="#F9F9F9">
    <td height="25" colspan="2" align="center" bgcolor="#CCCCCC"><%=sPageNavigate%></td>
  </tr>
  <form name="form1" method="post" action="view_blog.asp?act=rep&id=<%=id%>">
  <tr bgcolor="#F9F9F9">
    <td height="25" align="center">回复主题</td>
    <td height="25" align="left"><input name="textfield" type="text" class="tabel1" value="<%=title%>" size="70" readonly="true"></td>
  </tr>
  <tr bgcolor="#F9F9F9">
    <td height="25" align="center">回复内容</td>
    <td height="25" align="left"><textarea name="rcontent" cols="70" rows="10" class="tabel1"></textarea></td>
  </tr>
  <tr bgcolor="#F9F9F9">
    <td height="25" align="center">&nbsp;</td>
    <td height="35" align="left"><input name="Submit" type="submit" class="tabel1" value="回复">
      <input name="Submit" type="reset" class="tabel1" id="Submit" value="重置">      
      <span class="style2"><font style="font-size:15px "><font style="font-size:15px ">
      <input name="Submit32" type="button" class="tabel1" value="返回" onClick="window.history.go(-1)">
      </font></font></span>
      <input name="bid" type="hidden" id="bid" value="<%=id%>">
      </td>
  </tr>
  </form>
</table>

</body>
</html>

⌨️ 快捷键说明

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