index_article_index.asp

来自「基于ASP的教育网站」· ASP 代码 · 共 127 行

ASP
127
字号
<%
Dim RsArticleClass
Dim RsArticleClass_numRows

Set RsArticleClass = Server.CreateObject("ADODB.Recordset")
RsArticleClass.ActiveConnection = MM_connDB_STRING
RsArticleClass.Source = "SELECT * FROM tArticleClass ORDER BY fOrderID ASC"
RsArticleClass.CursorType = 0
RsArticleClass.CursorLocation = 2
RsArticleClass.LockType = 1
RsArticleClass.Open()

RsArticleClass_numRows = 0
%>
<%
'Dim Repeat1__numRows
'Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
RsArticleClass_numRows = RsArticleClass_numRows + Repeat1__numRows
%>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <tr>
    <% 
	Dim num_tr
	num_tr=0
%>
    <% 
While ((Repeat1__numRows <> 0) AND (NOT RsArticleClass.EOF)) 
%>
      <TD vAlign=top><TABLE cellSpacing=0 cellPadding=0 width=280 border=0>
          <TR>
            <TD><IMG height=41 src="images/index1_1.gif" width=16></TD>
            <TD width="155" 
                      height=42 background=images/index1_2.gif><div align="left"><IMG src="images/d5.gif">&nbsp;<%=(RsArticleClass.Fields.Item("fClassName").Value)%></div></TD>
            <TD width="100" background=images/index1_5.gif><div align="left"><IMG 
                        height=41  src="images/index1_4.gif" 
                        width=30></div></TD>
            <TD width=14><IMG height=41  
                        src="images/index1_7.gif" width=14></TD>
          </TR>
          <TR>
            <TD height="180" background=images/index1_8.gif></TD>
            <TD vAlign=top background=images/index1_9.gif colSpan=2><%
Dim RsArticleContent__MMColParam
RsArticleContent__MMColParam = RsArticleClass("fID_ArticleClass")
If (Request("MM_EmptyValue") <> "") Then 
  RsArticleContent__MMColParam = Request("MM_EmptyValue")
End If
%>
              <%
Dim RsArticleContent
Dim RsArticleContent_numRows

Set RsArticleContent = Server.CreateObject("ADODB.Recordset")
RsArticleContent.ActiveConnection = MM_connDB_STRING
RsArticleContent.Source = "SELECT * FROM tArticleContent WHERE fID_ArticleClass = " + Replace(RsArticleContent__MMColParam, "'", "''") + " ORDER BY fID_ArticleContent DESC"
RsArticleContent.CursorType = 0
RsArticleContent.CursorLocation = 2
RsArticleContent.LockType = 1
RsArticleContent.Open()

RsArticleContent_numRows = 0
%>
              <%
Dim Repeat2__numRows
Dim Repeat2__index

Repeat2__numRows = 10
Repeat2__index = 0
RsArticleContent_numRows = RsArticleContent_numRows + Repeat2__numRows
%>
              <TABLE  cellSpacing=0 cellPadding=0 width="100%"  border=0>
                <% While ((Repeat2__numRows <> 0) AND (NOT RsArticleContent.EOF)) %>
                  <TR>
                    <TD height="16" bgcolor="#F2F4FD"><div align="left"> <IMG height=8 src="images/dd.gif" width=8 border=0> <A HREF="index_Article_Content.asp?fID_ArticleContent=<%=RsArticleContent.Fields.Item("fID_ArticleContent").Value %>" title="<%=(RsArticleContent.Fields.Item("fTitle").Value)%>
作者:<%=(RsArticleContent.Fields.Item("fAuthor").Value)%>
时间:<%=(RsArticleContent.Fields.Item("fUpdateTime").Value)%>" target="_blank">
                        <% If len(RsArticleContent.Fields.Item("fTitle").Value)<19 Then %>
                        <%=(RsArticleContent.Fields.Item("fTitle").Value)%>
                        <% Else %>
                        <%=mid((RsArticleContent.Fields.Item("fTitle").Value),1,18)%>…
                        <% End If %>
                        </A> </div></TD>
                  </TR>
                  <% 
  Repeat2__index=Repeat2__index+1
  Repeat2__numRows=Repeat2__numRows-1
  RsArticleContent.MoveNext()
Wend
%>
                <tr>
                  <TD><div align=right><A HREF="index_Article_Class.asp?fID_ArticleClass=<%= RsArticleClass("fID_ArticleClass") %>" target="_blank"><IMG height=17  src="images/more.gif" width=35  border=0></A>&nbsp;</div></TD>
                </tr>
              </TABLE>
              <%
RsArticleContent.Close()
Set RsArticleContent = Nothing
%></TD>
            <TD background=images/index1_10.gif></TD>
          </TR>
          <TR>
            <TD><IMG height=18  src="images/index1_11.gif" width=16></TD>
            <TD background=images/index1_12.gif colSpan=2></TD>
            <TD width=14><IMG height=18  src="images/index1_13.gif" width=14></TD>
          </TR>
        </TABLE></TD>
      <% 
num_tr=num_tr+1
 If num_tr mod 2=0 Then 
 response.write "</tr><tr>" 
	End If
%>
      <% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  RsArticleClass.MoveNext()
Wend
%>
</TABLE>
<%
RsArticleClass.Close()
Set RsArticleClass = Nothing
%>

⌨️ 快捷键说明

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