29 ottobre 2004 alle 15:09:27 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