复件 list.asp

来自「关于网络渗透技术的详细讲解」· ASP 代码 · 共 372 行 · 第 1/2 页

ASP
372
字号
<!--#include file="conn.asp" -->
<!--#include file="Include/Inc.asp" -->
<%
'====================================================================
'=              Copyright (c) 2004,NB联盟 E.P.K开发小组             =
'=                      All rights reserved.                        =
'=------------------------------------------------------------------=
'=                     文件名称:List.asp                           =
'=                     摘    要:前台—栏目列表显示                 =
'=------------------------------------------------------------------=
'=                     最后更新:eason007                           =
'=                     最后日期:2004-12-26                         =
'====================================================================
Dim TopicList,ClassId
Dim PageNo,MPageSize,RCount,Style,PageCount
Dim ColumnInfo
Dim FieldName(1),FieldValue(1)
Dim HotList
Dim i,j

ClassID=SafeRequest("classid",1)
PageNo=SafeRequest("page",1)
Style=SafeRequest("style",1)
If PageNo="" Or CLng(PageNo)<=0 Then PageNo=1
If ClassId="" Or CLng(ClassId)<=0 Then SysErr(20)

MPageSize=SysInfo(10)				'设置每页主题数

'0=已通过审核总数1=栏目名称2=浏览数3=code4=待审核总数5=是否存在外部连接6=外部连接地址7=风格参数
SQL="select CountNum,title,ViewNum,code,mangernum,isout,outurl,StyleId from [NB_Column] where id="&ClassId
'response.write sql
Set Rs=Conn.Execute(SQL)
If rs.eof Or rs.bof Then 
	SysErr(9)
Else
	ColumnInfo=Rs.GetRows()
	If ColumnInfo(5,0) Then
		Response.Redirect ColumnInfo(6,0)
		Response.End
	End If
End If

If SysInfo(18)="0" Then 
	Response.Redirect "ArticleList/Article_"&ClassId&"_AddDate_Desc_1.Htm"
	Response.End
End If

If Style="" Or CInt(Style)<0 Then Style=ColumnInfo(7,0)
'Response.Write style

If (ColumnInfo(0,0) Mod MPageSize)=0 Then
	PageCount= ColumnInfo(0,0) \ MPageSize
Else
	PageCount= (ColumnInfo(0,0) \ MPageSize)+1
End If

If PageCount<=0 Then PageCount=PageNo
If CLng(PageNo)>PageCount And PageCount>0 Then PageNo=PageCount

SQL="UpDate [NB_Column] Set ViewNum=ViewNum+1 Where Id="&ClassId
Conn.Execute(SQL)

If Rs.State=1 Then Rs.Close
'0=id,1=标题颜色,2=标题,3=加入时间,4=评论总数,5=内容,6=最新评论,7=浏览总数,8=是否图片,9=图片地址,10=是否推荐
SQL="select [ID],TColor,Title,AddDate,CommentNum,Summary,lastcomment,viewnum,IsImg,Img,IsTop from [NB_Content] where columnid="&ClassId&" and IsPass=-1 and IsDel=0 order by AddDate desc,id desc"
rs.open sql,conn,1,1
If Not rs.eof And Not rs.bof Then 
	Rs.AbsolutePosition=Rs.AbsolutePosition+((Abs(PageNo)-1)*MPageSize)
	TopicList=Rs.GetRows(MPageSize)
End If

'热门文章
SQL="Select Top 10 [Id],ColumnId,ColumnName,Title,TColor,AddDate,IsImg,IsTop From [NB_Content] Where IsPass=-1 And IsDel=0 And ColumnCode Like '"&ColumnInfo(3,0)&"%' Order By ViewNum Desc,AddDate Desc,id desc"
Set Rs=Conn.Execute(SQL)
If Not rs.eof And Not rs.bof Then HotList=Rs.GetRows()

FieldName(0)="Classid"
FieldValue(0)=ClassId
FieldName(1)="style"
FieldValue(1)=Style
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=SysInfo(0)%>-<%=ColumnInfo(1,0)%></title>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> 
<!--#include file="head.asp"--> 
<script language=javascript>
function check(dd,mystr1,mystr2)
{
var imgwidth;
var imgheight;
imgwidth=mystr1;
imgheight=mystr2;
 if (dd.width>imgwidth && dd.height>imgheight){
    if (dd.width/dd.height>imgwidth/imgheight){
     dd.width=imgwidth;
     }
   else
   {
   dd.height=imgheight
   }
   }
  else if(dd.width>imgwidth){
   dd.width=imgwidth
  }
  else if(dd.height>imgheight){
  dd.height=imgheight
  }
}
</script> 
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0"> 
  <tr> 
    <td height="25">&nbsp;<img src="pic/set.gif" align="absmiddle">&nbsp;<a href="./"><strong><%=SysInfo(0)%></strong></a> -> <%=ColumnInfo(1,0)%></td> 
    <td height="25" align="right"> </td> 
  </tr> 
</table> 
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0"> 
  <tr> 
    <td width="170" rowspan="2" valign="top"><table border="0" cellpadding="0" cellspacing="0" bordercolor="#111111"> 
        <tr> 
          <td width="168" height="33" align="center" background="Images/Left1.gif">栏目导航</td> 
        </tr> 
        <tr> 
          <td width="168" valign="top" background="Images/Leftbg.gif"><%=SiteColumnNav(ClassId,ColumnInfo(3,0))%></td> 
        </tr> 
        <tr> 
          <td width="166"><img border="0" src="Images/Leftbottom.gif"></td> 
        </tr> 
      </table> 
      <!--#include file="userLoginbar.asp" --> 
      <table border="0" cellpadding="0" cellspacing="0" bordercolor="#111111"> 
        <tr> 
          <td width="168" height="33" align="center" background="Images/Left1.gif"> 热门文章</td> 
        </tr> 
        <tr> 
          <td width="168" valign="top" background="Images/Leftbg.gif"> <%If IsArray(HotList) Then
					Response.Write ShowTopicList(HotList,0,0,12)
			  Else
					Response.Write "暂无文章"
			  End If
			  %> </td> 
        </tr> 
        <tr> 
          <td width="166"><img border="0" src="Images/Leftbottom.gif"></td> 
        </tr> 
      </table></td> 
    <td width="1" rowspan="2" valign="top"></td> 
    <td width="1" rowspan="2" valign="top" bgcolor="#CEDFFF"></td> 
    <td width="587" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2"> 
        <tr> 
          <td height="28" background="Images/TitleTop.gif" bgcolor="#3366CC" width="40%">&nbsp;<strong><%=ColumnInfo(1,0)%></strong>&nbsp;&nbsp;&nbsp;文章总数:<%=ColumnInfo(0,0)%>&nbsp;浏览次数:<%=ColumnInfo(2,0)+1%></td> 
          <td height="28" background="Images/TitleTop.gif" bgcolor="#3366CC" align="right">未审核(<%=ColumnInfo(4,0)%>)&nbsp;<a href="rssfeed.asp?cid=<%=ClassId%>" target="_blank"><img src="images/xml.gif" border=0 align="absmiddle"></a>&nbsp;</td> 
        </tr> 
        <%
'--------输出---------
If IsArray(TopicList) Then
	j=0
	For i=0 To UBound(TopicList,2)
		Select Case Style
		Case 0
		'简单列表式
		%> 
        <tr> 
          <td colspan="2"><table width="100%" cellpadding="2" cellspacing="0"> 
              <tr> 
                <td height="22">&nbsp;<%=CheckTitleTypes(TopicList(8,i),TopicList(10,i))%>&nbsp;<a href="Article.asp?ArticleId=<%=TopicList(0,i)%>" target="_blank"><%=TitleAddColor(TopicList(1,i),Replace(TopicList(2,i),"&nbsp;"," "))%></a> <%="<font color=#AAAAAA>"&FormatDateTime(TopicList(3,i),2)&" Browse:"&TopicList(7,i)&" Review:"&TopicList(4,i)&"</font>"%> 
                  <%If FormatDateTime(TopicList(3,i),2)=FormatDateTime(Now,2) Then Response.write "&nbsp;<Img src='pic/new.gif' border=0  align=absmiddle>"%> </td> 
              </tr> 
            </table></td> 
        </tr> 
        <%
        Case 1
        '简介式
        %> 
        <tr> 
          <td colspan="2"><table width="100%" cellpadding="2" cellspacing="0" bgcolor="#FAFAFA" style="word-break: break-all"> 
              <tr bgcolor="ffffff"> 
                <td width="65%" height="22">&nbsp;<%=CheckTitleTypes(TopicList(8,i),TopicList(10,i))%>&nbsp;<a href="Article.asp?ArticleId=<%=TopicList(0,i)%>" target="_blank"><%=TitleAddColor(TopicList(1,i),Replace(TopicList(2,i),"&nbsp;"," "))%></a> 
                  <%If FormatDateTime(TopicList(3,i),2)=FormatDateTime(Now,2) Then Response.write "&nbsp;<Img src='pic/new.gif' border=0  align=absmiddle>"%> </td> 
                <td width="20%"><%="<font color=#AAAAAA>"&FormatDateTime(TopicList(3,i),2)&"</font>"%></td> 
                <td width="15%"><%="<font color=#AAAAAA>Browse:"&TopicList(7,i)&"</font>"%></td> 
              </tr> 
              <tr> 
                <td colspan="3" valign="top" height="40"><%=DealJsText(TopicList(5,i))%></td> 

⌨️ 快捷键说明

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