www.gusucode.com > 网站优化(SEO)新闻系统 2008源码程序 > manage/type.asp

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn_news.asp" -->
<!--#include file="config.asp" -->
<!--#include file="chklogin.asp" -->
<% chk_user_login(3) %>
<!--#include file="chkerror.asp" -->

<% function mm_menu (mm_id) %>
<%
If (mm_id <> "") Then 
  rst__mmid = mm_id
End If
%>
<%
Dim rst
Dim rst_numRows

Set rst = Server.CreateObject("ADODB.Recordset")
rst.ActiveConnection = MM_conn_news_STRING
rst.Source = "SELECT *  FROM t_type  WHERE t_pid = " + Replace(rst__mmid, "'", "''") + " order by t_pid ,t_sort"
rst.CursorType = 0
rst.CursorLocation = 2
rst.LockType = 1
rst.Open()

rst_numRows = 0

%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rst_numRows = rst_numRows + Repeat1__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim rst_total
Dim rst_first
Dim rst_last

' set the record count
rst_total = rst.RecordCount

' set the number of rows displayed on this page
If (rst_numRows < 0) Then
  rst_numRows = rst_total
Elseif (rst_numRows = 0) Then
  rst_numRows = 1
End If

' set the first and last displayed record
rst_first = 1
rst_last  = rst_first + rst_numRows - 1

' if we have the correct record count, check the other stats
If (rst_total <> -1) Then
  If (rst_first > rst_total) Then
    rst_first = rst_total
  End If
  If (rst_last > rst_total) Then
    rst_last = rst_total
  End If
  If (rst_numRows > rst_total) Then
    rst_numRows = rst_total
  End If
End If
%>

<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (rst_total = -1) Then

  ' count the total records by iterating through the recordset
  rst_total=0
  While (Not rst.EOF)
    rst_total = rst_total + 1
    rst.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (rst.CursorType > 0) Then
    rst.MoveFirst
  Else
    rst.Requery
  End If

  ' set the number of rows displayed on this page
  If (rst_numRows < 0 Or rst_numRows > rst_total) Then
    rst_numRows = rst_total
  End If

  ' set the first and last displayed record
  rst_first = 1
  rst_last = rst_first + rst_numRows - 1
  
  If (rst_first > rst_total) Then
    rst_first = rst_total
  End If
  If (rst_last > rst_total) Then
    rst_last = rst_total
  End If

End If
%>
<%
dim mm_mt
dim mm_lt
dim mm_omu
%><table border="0" cellspacing="0" cellpadding="0">
<% 
While ((Repeat1__numRows <> 0) AND (NOT rst.EOF)) 
%>
<%
Dim rst_count
Dim rst_count_numRows

Set rst_count = Server.CreateObject("ADODB.Recordset")
rst_count.ActiveConnection = MM_conn_news_STRING
rst_count.Source = "SELECT count(*) as t_count  FROM t_type  WHERE t_pid = " + Replace((rst.Fields.Item("t_id").Value), "'", "''") + ""
rst_count.CursorType = 0
rst_count.CursorLocation = 2
rst_count.LockType = 1
rst_count.Open()

rst_count_numRows = 0

%>
<% if (rst_count.Fields.Item("t_count").Value) >0  then %>
<%
 if Repeat1__index+1 = rst_total then 
 mm_mt = "menu4"
 mm_lt ="list1"
 mm_omu = "change1('a"&(rst.Fields.Item("t_id").Value)&"','b"&(rst.Fields.Item("t_id").Value)&"')"
 else
 mm_mt = "menu2"
 mm_lt = "list"
 mm_omu = "change2('a"&(rst.Fields.Item("t_id").Value)&"','b"&(rst.Fields.Item("t_id").Value)&"')"
 end if
 %> 
<% else %>
 <%
 if Repeat1__index+1 = rst_total then 
 mm_mt = "menu4"
 mm_lt ="list1"
 mm_omu = ""
 else
 mm_mt = "menu2"
 mm_lt = "list"
 mm_omu = ""
 end if
 %>
 <% end if %>
<tr>
  <td id="b<%=(rst.Fields.Item("t_id").Value)%>" class="<%=mm_mt%>" valign="bottom" onMouseUp="<%=mm_omu%>">
  <%=(rst.Fields.Item("t_name").Value)%> <a href="file_list.asp?t_id=<%=(rst.Fields.Item("t_id").Value)%>" title="生成该类列表文件">生成</a> <a href="type_add.asp?t_id=<%=(rst.Fields.Item("t_id").Value)%>" title="在该类别下添加一个分类">添加</a> <a href="type_edit.asp?t_id=<%=(rst.Fields.Item("t_id").Value)%>" target="main">编辑</a> <a href="type_del.asp?t_id=<%=(rst.Fields.Item("t_id").Value)%>" onClick="javascript:return confirm('请确认删除操作 ?')">删除</a>
  </td>
</tr>

<% if (rst_count.Fields.Item("t_count").Value) >0  then %>
<tr id="a<%=(rst.Fields.Item("t_id").Value)%>" >
  <td valign="bottom" class="<%=mm_lt%>"><% mm_menu ((rst.Fields.Item("t_id").Value))%></td>
</tr>
<% end if %>

<% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rst.MoveNext()
Wend
%></table>
<%
rst.Close()
Set rst = Nothing
%>
<%
rst_count.Close()
Set rst_count = Nothing
%>
<% end function %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" src="style/function.js" type="text/JavaScript"></script>
<title>网站优化(SEO)新闻系统</title>
<link href="style/css.css" rel="stylesheet" type="text/css">
<link href="style/js_css.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="94%" border="1" cellpadding="4" cellspacing="0" bordercolor="#FFCC00" class="table-line">
  <tr> 
    <td bgcolor="#FFFFCC"> <font color="#333333"><strong class="lh"><img src="images/bulb.gif" width="20" height="17" align="absmiddle">操作提示:</strong><br>
      <ul>
        <li>当不存在任何类别时如果系统运行不正常,不必理会错误信息,直接添加一个类别即可.</li>
		<li>如果删除了某个分类,请及时更新调用.</li>
        <li>单击某一个分类前的小图标可以展开或收缩所属类别.</li>
		<li>删除某个分类将删除所属该分类的所有新闻,及所属这些新闻的图片和评论,请谨慎操作.</li>
      </ul>
      </font></td>
  </tr>
</table>
<p></p>
<table border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td><img src="images/pc.gif" width="19" height="17" align="absmiddle"> <a href="type_add.asp?t_id=0" title="添加一个顶级分类">添加</a> 
    </td>
  </tr>
  <tr> 
    <td style="padding-left:5px"> 
      <% mm_menu(0) %>
    </td>
  </tr>
</table>
</body>
</html>