Forum 

Forum AspNuke.it - Il tuo Portale OpenSource in ASP

Count Articoli

Autore Messaggio
acar

Esperto
Esperto
267 Discussioni



Profilo - acar
29 ottobre 2004 alle 15:09:27 Profilo - acarInvia un messaggio privato Rispondi quotando
ciao ragazzi, ho notato che accanto alle categorie degli articoli non cè tra ( ) il numero di articoli contenuti in essa ma la somma delle pagine!!!

è un buco o è voluto cosi?

mi sembra corretto mettere il num di articolo e non pagine perche un utente del sito non sa che per le news il funzionamento è diverso.

capite cosa intendo????

la sub è questa, vorrei cambiare il count mi date una mano?

Sub DisplayArticlesNavigation(iCategoryParent)
Dim oCn, oRs, oRs2, rSQL, iLine, iNum

Set oCn = DBConnexion(DB_MAIN)

If iCategoryParent = "" Then
iCategoryParent = 0
end if
If iCategoryParent <> 0 Then
rSQL = "SELECT cId, cParent, cTitle, cDescription, cImage FROM categories WHERE cID=" & iCategoryParent

Set oRs = DBRecordSet(oCn, rSQL)

If Not oRs.EOF Then
CreateTopTable "ArticleCategory", CodeMessage(oRs("cTitle"), True)
If oRs("cImage") <> "" Then
Response.Write "<img src=""" & Server.HTMLEncode(oRs("cImage") & "") & """ border=""0"" align=""left"">"
End If
Response.Write CodeMessage(oRs("cDescription"), False)
Response.Write "<br><br><a href=""" & sURLPage & "?cat=" & oRs("cParent") & """>" & GetTranslation("LANG_BACK") & "</a>" & vbCRLF
CreateBottomTable ""
End If
oRs.Close
Set oRs = Nothing
End If

rSQL = "SELECT DISTINCT cId, cTitle FROM categories, articles, versions WHERE arCategory=cID AND arVersion=vID AND cType=" & CATEGORY_TYPE_ARTICLES & " AND cParent=" & iCategoryParent
If sXMLVersion <> "" Then
rSQL = rSQL & " AND vCode='" & sXMLVersion & "'"
end if
rSQL = rSQL & " ORDER BY cTitle"

Set oRs = DBRecordSet(oCn, rSQL)

If Not oRs.EOF Then
If iCategoryParent = 0 Then
CreateTopTable "SearchArticleCategories", GetTranslation("LANG_ARTICLES") & " - " & GetTranslation("LANG_CATEGORIES")
Else
CreateTopTable "SearchArticleCategories", GetTranslation("LANG_ARTICLES") & " - " & GetTranslation("LANG_SUB_CATEGORIES")
End If
Response.Write GLOBAL_SITE_SUBTABLE & vbCRLF
iLine = 1
iNum = 0

While Not oRs.EOF
If iNum mod 2 = 0 Then
Response.Write " <tr class=""tableline" & iLine & """>" & vbCRLF
End if
rSQL = "SELECT Count(arID) FROM articles, versions, articlespages WHERE arVersion=vID AND arID=apArticle AND arValid=1 AND apValid=1 AND arCategory=" & oRs("cID")
If sXMLVersion <> "" Then
rSQL = rSQL & " AND vCode='" & sXMLVersion & "'"
End If
Set oRs2 = DBRecordSet(oCn, rSQL)
Response.Write " <td width=""50%""><a href=""" & sURLPage & "?cat=" & oRs("cID") & """>" & Server.HTMLEncode(oRs("cTitle")) & " (" & oRs2(0) & ")</td>" & vbCRLF
oRs2.Close
Set oRs2 = Nothing

If iNum mod 2 = 1 Then
Response.Write " </tr>" & vbCRLF
iLine = 1 + ((iLine-1) XOR 1)
End If

iNum = iNum + 1
oRs.MoveNext
WEnd
If iNum mod 2 = 1 Then
Response.Write " <td> </td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
End If

Response.Write "</table>" & vbCRLF
CreateBottomTable ""
End If

oRs.Close
Set oRs = Nothing
oCn.close
Set oCn = Nothing
End Sub

---------------
http://www.pc-sapiens.net
acar

Esperto
Esperto
267 Discussioni



Profilo - acar
30 ottobre 2004 alle 20:00:51 Profilo - acarInvia un messaggio privato Rispondi quotando
Qualcuno mi spiega?
---------------
http://www.pc-sapiens.net

Log in

Login
Password
Memorizza i tuoi dati:

Cerca

 

Sostieni AspNuke

Un piccolo gesto per aiutarci a mantenere AspNuke.it online

Promo

MusicWebItalia.it
Video Testi Traduzioni Spot Colonne sonore Accordi e Spartiti gratis.

Visitatori

Visitatori Correnti : 191
Membri : 0 offline Anna

Iscritti

 Utenti: 18940
Ultimo iscritto : glauco
Lista iscritti
Messaggi privati: 3373 Commenti: 2210 Immagini: 39 Downloads: 144 Articoli: 49 Pagine: 101 Siti web: 558 Notizie: 180 Sondaggi: 11 Preferiti: 5688467 Post sui forum: 51195 Libro degli ospiti: 4 Eventi: 7

Versioni

Temi