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

📄 diary_index.asp

📁 不错的ASP整站源代码。在IIS环境下运行都没有问题
💻 ASP
字号:
<div align="center">

 <table border="0" cellpadding="0" cellspacing="0" width="100%" background="images/bg2.gif">
    <tr> 
      <td height="1" bgcolor="#E32D3F"></td>
    </tr>
  <tr>
    <td height="30" align="center">
        <table width="100%" border="0" cellspacing="3" cellpadding="0">
          <tr> 
            <td><font color=red class=titletext><%=NickName%> 的心情日记</font></td>
            <%if cint(request("AccountID"))=cint(session("u_id")) then%>
            <td width="80" align="right">&nbsp; </td>
            <td width="80" align="right"> 
            <a href=H_Diary_Edit.asp?Mod=Add&AccountID=<%=AccountID%>>新添日记</a>
            </td>
            <%end if%>
          </tr>
        </table>
    </td>
  </tr>
  <tr> 
      <td height="1" background="images/hline.gif"></td>
    </tr>
  <tr>
    <td align=center>




<!----------------主体部分开始------------------------------------->



<table border="0" cellpadding="4" width="100%" cellspacing="4">
        <%
                If WhoCanSee = 0 And cint(Session("u_id")) <> cint(Request("AccountID")) Then 
			Response.Write "关闭了日记本"
		ElseIf WhoCanSee = 2 And Not IsMember() Then
			Response.Write "您还没登录,不能看到日记 "
		ElseIf WhoCanSee = 1 And Not IsFriend(Request("AccountID")) And  cint(Session("u_id")) <> cint(Request("AccountID")) Then
			Response.Write "只有" & NickName & "的好友才能看到日记"
		Else
        %>
<!--#include file="../conn.asp"-->
<%		
        AccountID=request("AccountID")
        Set Rs = Server.CreateObject("ADODB.Recordset")
	SQLStr	=	"Select Top 1 ID,Topic,Body From Diary Where AccountID = " & AccountID & " Order By ID Desc"
	Rs.Open SQLStr,conn,1,1
	If Not Rs.Eof Then
		Dim DiaryBody
		DiaryBody=Left(Rs("Body"),50)
		DiaryBody=replace(DiaryBody,"<br>"," ")
		DiaryBody=replace(DiaryBody,"<p>"," ")
		DiaryBody=replace(DiaryBody,"&nbsp;"," ")
		SQLStr = "<a href=H_Diary_Show.asp?AccountID=" & AccountID & "&ID=" & Rs("ID") & ">" & Rs("Topic") & "</a>"
		SQLStr = SQLStr & "<p>" & "<a href=H_Diary_Show.asp?AccountID=" & AccountID & "&ID=" & Rs("ID") & ">" & DiaryBody & "……</a>"
	Else
		SQLStr = "心情日记<p>" & NickName & " 还没有任何日记。"
	End If
	Rs.Close()
%>

		  <tr>
		    <td colspan="3"><img border="0" src="images/diary.gif" align="left" width="60" height="60" hspace="10" border="1"> 
              <%=SQLStr%> </td>
		  </tr>
<%
	Dim PageSize,AllCount,MaxPage,PageNo
	PageNO		=	Request.QueryString("PageNO")
	SQLStr	=	"Select ID,Topic,UpdateTime,Hit From Diary Where AccountID="& AccountID &" Order By UpdateTime Desc"
	PageSize	=	10
	Rs.PageSize =	PageSize
	Rs.Open SQLStr,conn,1,3
	AllCount	=	Rs.RecordCount
	MaxPage		=	Rs.PageCount 
	If Rs.RecordCount > 0 Then
	Rs.MoveFirst 
	If PageNO = "" Then PageNO=1
	If PageNO+1 < 1 Then PageNO=1
	If PageNO+1 > MaxPage+1 Then PageNO = MaxPage
	Rs.AbsolutePage = PageNO
	End If
	i=0
	DO While Not Rs.EOF and		i	<	PageSize
		i=i+1
%>    

		  <tr>
		    <td><a href="H_Diary_Show.asp?AccountID=<%=AccountID%>&ID=<%=Rs("ID")%>"><%=Server.HTMLEncode(Rs("Topic"))%></a></td>
		    <td width=80><%=Year(Rs("UpdateTime"))%>年<%=Month(Rs("UpdateTime"))%>月<%=Day(Rs("UpdateTime"))%>日</td>
		    <td width=50>点击:<%=Rs("Hit")%></td>
		  </tr>
<%
		Rs.MoveNext
	Loop
	Rs.Close()
%>

		  </table>
<br>		  
	<table border="0" cellpadding="0" cellspacing="0" width="100%" height="25"> 
          <tr> 
          <td align="right">     
&nbsp;页次: <font color=red><b><%=PageNO%></b></font> / <b><%=MaxPage%></b> 页 
<%if PageNO-1>0 then %> 
<A href=list_diary.asp?AccountID=<%=AccountID%>&pageNO=1>首页</a> <A href=list_diary.asp?AccountID=<%=AccountID%>&pageNO=<%=pageNO-1%>>上一页</a>
<% 
else    
%>首页 上一页<% 
end if %> 
<% 
	if PageNo+1<=MaxPage then  
%> 
<A href=list_diary.asp?AccountID=<%=AccountID%>&pageNO=<%=pageNO+1%>>下一页</a> <A href=list_diary.asp?AccountID=<%=AccountID%>&pageNO=<%=MaxPage%>>末页</a> 
<% 
	else    
%> 
下一页 末页 
<% 
	end if 
%> 
          </td>   
        </tr>   
      </table>   
<%
	End IF
%>
<!----------------主体部分结束-------------------------------------->
    </td>
  </tr>
    <tr> 
      <td height="1" background="images/hline.gif"></td>
    </tr>
</table>

</div>

⌨️ 快捷键说明

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