📄 index.asp
字号:
<!--#include file=blogdata.asp-->
<!--#include file=Function.asp-->
<!--#include file=top.asp-->
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from config "
rs.open sql,conn,1,1
%>
<HTML>
<HEAD>
<TITLE><%=rs("blogname")%></TITLE>
<META http-equiv=content-type content="text/html; charset=gb2312">
<META
content="<%=rs("blogname")%>'s blog,blog,<%=rs("blogname")%>" name=keywords>
<LINK href="images/lx.css" type=text/css rel=stylesheet>
</HEAD>
<TABLE class=columns width="99%">
<TBODY>
<TR>
<TD class=left>
<DIV class=box>
<H5> 博客日历</H5>
<DIV class=body>
<TABLE class="content odd" width="99%">
<TBODY>
<td style="letter-spacing:2px;line-height:20px; font-family:Tahoma; font-size:9pt" valign="top">
<table width="179" cellpadding="0" cellspacing="1" bgcolor="#DEE7EC" id="table2">
<%
If Trim(Request("ReqDate"))="" or ( not IsDate(Trim(Request("ReqDate"))) ) then
CurrentDate=Date
else
CurrentDate=Trim(Request("ReqDate"))
end if
PreviousMonthDate=DateAdd("m",-1,CurrentDate)
NextMonthDate=DateAdd("m",1,CurrentDate)
%>
<tr align="LEFT" bgcolor="#CCCCCC">
<td width="10%" height="19" bgcolor="#FFFFFF" class="style2">
<p align="center">日</td>
<td width="11%" bgcolor="#FFFFFF" style="font-family: Tahoma; font-size: 9pt">
<p align="center" class="style2">一</td>
<td width="11%" bgcolor="#FFFFFF" style="font-family: Tahoma; font-size: 9pt">
<p align="center" class="style2">二</td>
<td width="10%" bgcolor="#FFFFFF" style="font-family: Tahoma; font-size: 9pt">
<p align="center" class="style2">三</td>
<td width="11%" bgcolor="#FFFFFF" style="font-family: Tahoma; font-size: 9pt">
<p align="center" class="style2">四</td>
<td width="11%" bgcolor="#FFFFFF" style="font-family: Tahoma; font-size: 9pt">
<p align="center" class="style2">五</td>
<td width="13%" bgcolor="#FFFFFF" style="font-family: Tahoma; font-size: 9pt">
<p align="center" class="style2">六</td>
</tr>
<%
ym=year(CurrentDate)&"-"&month(CurrentDate)&"-"
i=1
do while i<33
j=1
response.write("<tr bgcolor=ffffff height=19>")
do while j<8
If IsDate(ym&i) then
CurrentWeekDay=weekday(ym&i)
if j=CurrentWeekDay then
If Datediff("d",ym&i,now)>-1 then
LinkText="<a href=index.asp>"&i&"</a>"
else
LinkText=i
end if
if i<>Day(now) then
response.write("<td> "&LinkText&"</td>")
else
response.write("<td bgcolor=#DEE7EC> "&LinkText&"</td>")
end if
i=i+1
else
response.write("<td></td>")
end if
else
response.write("<td></td>")
i=i+1
'exit do
end if
j=j+1
loop
response.write("</tr>")
loop
%>
</table></font></a></td>
</tr>
</TR>
</TBODY></TABLE></DIV></DIV>
<DIV class=box>
<H5> 日志分类 </H5>
<DIV class=body>
<TABLE class="content odd" width="99%" id="table1">
<TBODY>
<%set rs=server.createobject("adodb.recordset")
rs.open "select * from class" ,conn,1,1
if rs.eof and rs.bof then
response.write"暂无分类"
end if
do while not rs.eof
%>
<TR>
<td style="letter-spacing:2px;line-height:20px; font-family:Tahoma; font-size:9pt" valign="top"><img src="images/document_icon.gif"><a href="class.asp?id=<%=rs("id")%>"><%=rs("class")%></a></font></a></td>
</tr>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</TBODY></TABLE></DIV></DIV>
<DIV class=box>
<H5> 最新日志</H5>
<DIV class=body>
<TABLE class="content odd" width="99%">
<TBODY>
<%
set rs=server.createobject("adodb.recordset")
rs.open "select top 10 * from article" ,conn,1,1
if rs.eof and rs.bof then
response.write"暂无日志"
end if
do while not rs.eof
%>
<TR>
<TD><img src="images/document_icon.gif"><a href="article.asp?id=<%=rs("id")%>"><%
dim text
text=rs("title")
response.write left(text,15)
%>...</a></TD></TR>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</TBODY></TABLE></DIV></DIV>
<DIV class=box>
<H5> 最新留言</H5>
<DIV class=body>
<TABLE class="content odd" width="99%">
<TBODY>
<%
set rs=server.createobject("adodb.recordset")
rs.open "select top 10 * from message" ,conn,1,1
if rs.eof and rs.bof then
response.write"暂无留言"
end if
do while not rs.eof
%>
<TR>
<TD><img src="images/document_icon.gif"><a href="message.asp"><%
dim message
message=rs("cont")
response.write left(message,15)
%>...</a></TD></TR>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</TBODY></TABLE></DIV></DIV>
<DIV class=box>
<H5> 友情连接</H5>
<DIV class=body>
<TABLE class="content odd" width="99%">
<TBODY>
<%set rs=server.createobject("adodb.recordset")
rs.open "select * from link" ,conn,1,1
if rs.eof and rs.bof then
response.write"暂无连接"
end if
do while not rs.eof
%>
<TR>
<TD><img src="images/document_icon.gif"><a href="<%=rs("url")%>"><%=rs("name")%></a></TD></TR>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</TBODY></TABLE></DIV></DIV>
<DIV class=box>
</DIV></TD>
<TD class=main vAlign=top><BR>
<div align="center">
<TABLE
style="border:1px solid #8CACBB; border-collapse:collapse"
width="93%" border=0 id="table70">
<TBODY>
<TR>
<TD>
<CENTER><font size="2" color="#336699"><b>公告</b></font></CENTER>
<%set rs=server.createobject("adodb.recordset")
rs.open "select * from bloggg" ,conn,1,1
if rs.eof and rs.bof then
response.write"公告"
end if
do while not rs.eof
%>
<DIV
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; BACKGROUND: #edf3fe; PADDING-BOTTOM: 10px; PADDING-TOP: 10px" align=left> <%=rs("cont")%></DIV>
</TD>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</TR>
</TBODY></TABLE>
</div>
<BR>
<%
Const MaxPerPage=10
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request.QueryString("page")) then
currentPage=Cint(request.QueryString("page"))
else
currentPage=1
end if
Set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from article order by id desc"
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
response.Write("暂无日志!")
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"index.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"index.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"index.asp"
end if
end if
end if
sub showContent
dim i
i=0
%>
<%do while not rs.eof%>
<table cellpadding="0" width="734" style="border-collapse: collapse" border="1" bordercolor="#8CACBB" id="table68">
<tr>
<td height="15" bgcolor="#DEE7EC"> <%=rs("title")%></td>
</tr>
</table>
<table width="734" border="1" cellpadding="0" id="table69" height="49" style="border-collapse: collapse" bordercolor="#DEE7EC">
<tr>
<td style="letter-spacing:2px;line-height:20px" valign="top">
<%
dim listtext
listtext=rs("cont")
response.write left(listtext,300)
%> ... <b> <a href="article.asp?id=<%=rs("id")%>">
<font color="#336699">Read More</font></a></b></td>
</tr>
</table>
<hr color="#DEE7EC" size="0">
<%
rs.movenext
loop
rs.close
set rs=nothing%>
</TD></TR></TBODY></TABLE>
<%
End Sub
Function showpage(totalnumber,maxperpage,filename)
Dim n
If totalnumber Mod maxperpage=0 Then
n= totalnumber \ maxperpage
Else
n= totalnumber \ maxperpage+1
End If
Response.Write "<p align='center' class='style11'> "
If CurrentPage<2 Then
Response.Write "<font class='style11'><font color=#333333> 首 页 上一页</font> "
Else
Response.Write "<a href="&filename&"?page=1 class='style11'><font color=#333333> 首 页</a> "
Response.Write "<a href="&filename&"?page="&CurrentPage-1&" class='style11'><font color=#333333> 上一页</a> "
End If
If n-currentpage<1 Then
Response.Write "<font class='style11'>下一页 末 页</font>"
Else
Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&" class='style11'>"
Response.Write "<font color=#333333> 下一页</font> </a> <a href="&filename&"?page="&n&" class='style11'><font color=#333333> 尾 页</font> </a>"
End If
Response.Write "<font color=#333333> 页次:</font><font color=#333333> "&CurrentPage&"</font><font color=#333333> /"&n&"页</font> "
Response.Write "<font color=#333333> 共有"&totalnumber&"篇日志 "
End Function
%>
<!--#include file=Bottom.asp-->
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -