📄 default.asp
字号:
<%@ LANGUAGE="VBSCRIPT"%>
<%
if request("fenlei")="" then
fenlei=1
else
fenlei=request("fenlei")
end if
'set conn=server.createobject("adodb.connection")
'conn.open Application("DBCon_ConnectionString")
set conn=server.createObject("ADODB.Connection")
dbpath=server.mappath("lovelife.mdb")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq="&dbpath
select case fenlei
case 1
aa="人生感悟"
case 2
aa="情感天地"
case 3
aa="故事天空"
case 4
aa="生活体验"
case 5
aa="消费心得"
case 6
aa="道听途说"
case else
aa="人生感悟"
end select
%>
<html>
<head>
<title>我爱生活</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="/html/3508.css">
<style type="text/css">
<!--
.red { color: #990066; font-size: 12px; line-height: 14pt}
.green { color: #006600}
a:active { }
-->
</style>
</head>
<body bgcolor="#FFFFF8">
<span class="red"></span>
<table width="740" border="0" cellspacing="0" cellpadding="0" align="center" height="58">
<tr>
<td width="88" height="39" align="center" valign="bottom"> </td>
<td width="214" valign="bottom" height="39" align="right">投稿中心</td>
<td width="355" valign="bottom" height="39" align="right"><a href="fabiaowz0.asp" target="_blank">我要发表文章</a>
</td>
<td width="83" valign="bottom" height="39" align="right"><a href="tgrevise.htm" target="_blank">修改文章</a></td>
</tr>
<tr>
<td colspan="4" height="1" bgcolor="006600"></td>
</tr>
<tr valign="bottom">
<td colspan="4" height="16">
<table width="437" border="1" cellpadding="0" cellspacing="0" align="right" bordercolorlight="#FFFFFF" bordercolordark="#006600">
<tr>
<td width="65" align="center" nowrap><a href=default.asp?fenlei=1>人生感悟</a></td>
<td width="76" align="center" nowrap><a href=default.asp?fenlei=2>情感天地</a></td>
<td width="66" align="center" nowrap><a href=default.asp?fenlei=3>故事天空</a></td>
<td width="65" align="center" nowrap><a href=default.asp?fenlei=4>生活体验</a></td>
<td width="65" align="center" nowrap><a href=default.asp?fenlei=5>消费心得</a></td>
<td width="80" align="center" nowrap><a href=default.asp?fenlei=6>道听途说</a></td>
</tr>
</table>
</td>
</tr>
</table>
<table width="740" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="139" valign="top"> </td>
<td width="601" valign="top"> </td>
</tr>
<tr>
<td width="139" valign="top">
<%
set rs=server.createobject("adodb.recordset")
sqlstr="select top 18 bm ,count(bm) as s1 from loveshenghuo where bm not like '' group by bm order by count(bm) desc"
rs.open sqlstr,conn,1
if rs.eof then
response.write "没有文章"
response.end
else
%>
<table cellpadding="0" cellspacing="0" border="1" bordercolorlight="#FFFFFF" bordercolordark="#CC9933" width="110" align="center">
<tr bgcolor="#CCCCFF" align="center">
<td width="70">作者</td>
<td width="34">文章数量</td>
</tr>
<%
while not rs.eof
%>
<tr bgcolor="#CCFFCC">
<td width="70" align="center" class="red"><%=rs("bm")%></td>
<td width="34" align="center"><%=rs("s1")%></td>
</tr>
<%
if not rs.eof then
rs.movenext
end if
wend
end if
rs.close
set rs=nothing
%>
</table>
</td>
<td width="601" valign="top">
<table width="90%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="100%" nowrap >〖<%=aa%>〗</td>
</tr>
<tr>
<td height="1" bgcolor="FF0000"></td>
</tr>
<tr>
<td> <%
set rs=server.createobject("adodb.recordset")
sqltext="select top 21 id, biaoti,bm,fbriqi ,cishu from loveshenghuo where biaoti not like '' and fenlei="& fenlei &" order by fbriqi desc"
rs.open sqltext,conn,3
if not(rs.eof and rs.bof) then
rs.pagesize=1
rs.AbsolutePage=1
if rs.pagecount>1 then yjpage=true
%>
<table width="90%" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#FFFFFF" bordercolordark="#009999" align="center" vspace="16" >
<tr>
<td align="center" bgcolor="#FEDFA7" width="288">文章标题</td>
<td align="center" bgcolor="#FEDFA7" width="114">作者</td>
<td align="center" bgcolor="#FEDFA7" width="114">发表时间</td>
<td align="center" bgcolor="#FEDFA7" width="85"> 浏览次数</td>
</tr>
<%
i=1
while not rs.eof and i<=18
%>
<tr colspan="4">
<td width="288" nowrap height="20"> ◆<a href="wenzhangxs.asp?id=<%=rs("id")%>" target="_blank"><%=rs("biaoti")%></a></td>
<td width="114" nowrap height="20" align="center"> <%
if rs("bm")="" then
response.write "无名氏"
else
response.write rs("bm")
end if
%></td>
<td width="114" nowrap height="20" align="center"><%=formatdatetime(rs("fbriqi"),1)%></td>
<td width="85" nowrap height="20" align="center"><%=rs("cishu")%></td>
</tr>
<%
i=i+1
rs.movenext
wend
rs.close
set rs=nothing
if yjpage then
%>
<tr align="right">
<td colspan="4"><a href="more.asp?fenlei=<%=fenlei%>&page=1">更多>></a></td>
</tr>
<%
end if
%>
</table>
<%
else
response.write "此栏内容为空!"
end if
%> </td>
</tr>
</table>
</td>
</tr>
</table>
<%
set rs=server.createobject("adodb.recordset")
sqlstr="select top 10 id, biaoti as 标题,bm as 笔名,fbriqi as 发表日期 ,cishu as 阅读次数 from loveshenghuo order by cishu desc"
rs.open sqlstr,conn
if rs.eof then
response.write "没有文章"
response.end
else
%>
<table width="743" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="green" height="34"> </td>
</tr>
<tr>
<td class="green">〖热点文章〗</td>
</tr>
</table>
<table border=1 align=center cellpadding="0" cellspacing="0" width="743" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr>
<td bgcolor="#FFCCFF">标题</td>
<td bgcolor="#FFCCFF">作者</td>
<td bgcolor="#FFCCFF">发表日期</td>
<td bgcolor="#FFCCFF">阅读次数</td>
</tr>
<%
while not rs.eof
%>
<tr>
<td bgcolor="#FFFFCC"><a href=wenzhangxs.asp?id=<%=rs.fields(0).value%> target='_blank'>
<%
if rs.fields(1).value="" then
response.write "无题"
else
response.write rs.fields(1).value
end if
%></a>
</td>
<td bgcolor="#FFFFCC">
<%
if rs.fields(2).value="" then
response.write "无名氏"
else
response.write rs.fields(2).value
end if
%>
</td>
<td bgcolor="#FFFFCC"> <%=formatdatetime(rs.fields(3).value,1)%></td>
<td bgcolor="#FFFFCC"><%=rs.fields(4).value%></td>
</tr>
<%
rs.movenext
wend
end if
rs.close
set rs=nothing
set conn=nothing
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -