📄 home.asp
字号:
<table cellspacing=0 cellpadding=0 width=120 border=0>
<tbody>
<tr>
<td height="24" valign="bottom">
<table cellspacing=0 cellpadding=0 width=100% border=0 height="19">
<tbody>
<tr>
<td width="25"><img src="../images/gripblue.gif" width="25" height="19"></td>
<td align=center class="ccopen"><b>文章分类</b></td>
<td width="25"><img src="../images/chevronUp.gif" width="25" height="19"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td height="1" bgcolor="#FF99CC"></td>
</tr>
<tr>
<td align="center" class="box1">
<table width="100" border="0" cellspacing="3" cellpadding="1">
<tbody>
<tr>
<td height="2"></td>
</tr>
<%
dim rst
set rst=server.CreateObject("ADODB.RecordSet")
rst.open "select * from type",conn,1
if rst.EOF then
response.write "<tr><td>还没有任何文章</td></tr>"
else
%>
<tr>
<td align="center" onMouseOver="this.className='menuover';" onMouseOut="this.className='menuout';"><a href="index.asp?typeid=0" class="a02">全部文章</a></td>
</tr>
<%do while NOT rst.EOF%>
<tr>
<td background="../images/hline.gif" height="1"></td>
</tr>
<tr>
<td align="center" onMouseOver="this.className='menuover';" onMouseOut="this.className='menuout';"><a href="index.asp?typeid=<%=rst("typeid")%>" class="a02"><%=rst("type")%></a></td>
</tr>
<%
rst.MoveNext
loop
end if
rst.close
%>
<tr>
<td height="2"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br>
<!--------Top--------->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="center" bgcolor="#FF99CC" height="1"></td>
</tr>
<tr>
<td align="center" height="22" bgcolor="#FFD9EC"><font color="#ff0099" class="fontshadow">热门文章排行</font></td>
</tr>
<tr>
<td align="center" bgcolor="#FF99CC" height="1"></td>
</tr>
</tbody>
</table>
<table cellpadding="1" cellspacing="0" border="0" width="90%">
<tr><td height="6"></td></tr>
<tbody>
<%
if typeid="" or IsEmpty(typeid) or typeid=0 then
sql="select top 10 articleid,title from learning order by hits desc"
else
sql="select top 10 articleid,title from learning where typeid=" & typeid & " order by hits desc"
end if
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write "<tr><td>还没有文章</td></tr>"
else
do while not rs.eof
%>
<tr><td>
<font color="#FF0099">·</font><a href="javascript:popwin2(<%=rs("articleid")%>)" title="<%=rs("title")%>" class="a06"><%=strvalue(rs("title"),19)%></a>
</td></tr>
<%
rs.movenext
loop
end if
rs.close
%>
<tr><td height="6"></td></tr>
</tbody>
</table>
<%
function strlen(str)
dim p_len,xx
p_len=0
strlen=0
if trim(str)<>"" then
p_len=len(trim(str))
for xx=1 to p_len
if asc(mid(str,xx,1))<0 then
strlen=int(strlen) + 2
else
strlen=int(strlen) + 1
end if
next
end if
end function
function strvalue(str,lennum)
dim p_num,x
dim i
if strlen(str)<=lennum then
strvalue=str
else
p_num=0
x=0
do while not p_num > lennum-2
x=x+1
if asc(mid(str,x,1))<0 then
p_num=int(p_num) + 2
else
p_num=int(p_num) + 1
end if
strvalue=left(trim(str),x)&".."
loop
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -