Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Limitare i record mostrati

    Buongiorno,
    sto cercando di modificare un'applicazione per la gestione delle notizie sul mio sito. L'applicazione prevede che l'amministratore decida se la notizia debba essere attiva o meno. Solo quelle attive verranno mostrate nella pagine pubblica >>>http://www.gemonahomepage.it/newscms/ . Io tuttavia vorrei realizzare una pagina, oltre a quella d'archivio, in cui mi venissero mostrate solo per esempio le prime 5 o 10 notizie . Come posso modificare il codice che di seguito incollo?
    Grazie.


    -----------------------------
    <table width="100%" cellpadding="3" cellspacing="0" border="0">
    <tr>
    <td>

    <%if pageView="" THEN

    ' We display the news article list

    %>
    Archivio delle NEWS.

    Per visualizzarle clicca sul titolo.




    <%

    ' Set the SQL Statement to get the information from the database
    strSQL="SELECT * FROM TBLNews WHERE newsStatus=1 ORDER BY newsDate DESC"
    ' Open the Database
    objRS.Open strSQL, objConn, adOpenKeyset, adLockPessimistic, adCmdText
    IF NOT objRS.EOF THEN
    'objRS.Filter=objRS("newsStatus")=1
    %>
    <table width="100%" cellspacing="0" cellpadding="3" class="mainTable">
    <tr><td width="20%">Data</td><td>Località</td><td>Titolo</td></tr>
    <%
    ' Write out the list of articles but it will
    ' only show the ones that have a status of
    ' 1 which shows they are online
    DO WHILE NOT objRS.EOF%>


    <%if intRowColor = 0 Then
    Response.Write "<TR bgcolor=""#F6EFF9"" onMouseOver=""this.bgColor = '#565656'"" onMouseOut =""this.bgColor = '#F6EFF9'"">"
    intRowColor = 1
    Else
    Response.Write "<TR bgcolor=""#ffffff"" onMouseOver=""this.bgColor = '#565656'"" onMouseOut =""this.bgColor = '#FFFFFF'"">"
    intRowColor = 0
    End if%>
    <td width="20%"><%=FormatDateTime(objRS("newsDate"),2) %></td>
    <td width="20%">[<%=objRS("newsPlace")%>]</td>
    <td>" title="Display The Article" onmouseover="window.status='Display the article'; return true" onmouseout="window.status=''; return true"><%=objRS("newsHeadline")%></td>
    </tr>
    <%
    objRS.MoveNext
    Loop
    objRS.Close
    %>
    </table>
    --------------------------

  2. #2
    Yuppydoooo
    ce l'ho fatta seguendo il post precedente http://forum.html.it/forum/showthrea...hreadid=914553

    Grazie

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.