25 aprile 2007 alle 17:11:22 Possibile e' possibile.
il solito problema e' trovare qlc che abbia il tempo per farlo !!
cmq puoi semplicemente richiamare nvolte all'interno della hp DisplayTopNew GLOBAL_NEWS_TOP, 1 DisplayTopNew GLOBAL_NEWS_TOP, 3 DisplayTopNew GLOBAL_NEWS_TOP, 4
dove 1,3,5 sono gli id delle categorie news che vuoi mostrare
o ti crei una procedura che fa una query sql sulle categorie che hanno ctype=1 e poi fai un ciclo while richiamando all'interno del ciclo DisplayTopNews GLOBAL_NEWS_TOP, Ors("cID") o DisplayTopNewsLinks GLOBAL_NEWS_TOP, Ors("cID")
05 settembre 2007 alle 12:43:34 ciao. in riferimento al blocco news. io ho fatto in questo modo: DisplayTopNewsLinks GLOBAL_NEWS_LINKS_TOP, 456 DisplayTopNewsLinks GLOBAL_NEWS_LINKS_TOP, 457 DisplayTopNewsLinks GLOBAL_NEWS_LINKS_TOP, 428
pero mi viene fuori un blocco per ogni cat. è possibile fare uscire piu cat in un unico blocco. mi spiego meglio: io ho le news dei campionati regionali e quindi ogni regione ha una sua cat. vorrei che le news uscissero tutte in un blocco.casomai le ultime 15. è possibile?
piosky_to2003 Esperto
2291 Discussioni
07 settembre 2007 alle 15:51:49 Modificato il 07 settembre 2007 alle 15:54:20puoi provare a duplicare la funzione cambiandola di nome Es. DisplayTopNewsLinksNEW , togliendo il CreateTopTable e CreateBottomTable e mettendolo esternamente
07 settembre 2007 alle 16:50:57 si così lo so che funziona pero mi crea sempre una cartella separata per ogni categoria. io invece vorrei che mettesse una notizia sotto l'altra di quelle categorie e non inserirle in table diverse...
piosky_to2003 Esperto
2291 Discussioni
07 settembre 2007 alle 16:52:18 mai hai tolto il il createtoptable e createbottmtable nella nuova funzione DisplayTopNewsLinksNEW
--------------- Silvio Andrighetti Formaggini (Piosky)
07 settembre 2007 alle 18:04:58 ho messo quel codice come mi hai detto tu. pero mi da errore il NEW.DisplayTopNewsLinksNEW
piosky_to2003 Esperto
2291 Discussioni
08 settembre 2007 alle 08:47:56 Hai duplicato tutta la funzione DisplayTopNewsLinks? poi hai cambiato il nome di una delle due funzioni DisplayTopNewsLinks in DisplayTopNewsLinksNew? Dopo di che in DisplayTopNewsLinksNew hai eliminato le righe CreateTopTable ... r CreateBottomTable ""
e richamato la DisplayTopNewsLinksNew in home page come scritto nel post precedente?
08 settembre 2007 alle 10:22:46 si, ho duplicato in news-inc.asp:
' Display the top news list (links to news) aggiunta da me ' IN : iTop (int) : number of results wanted ' : iCategory (int) : news' category (table news, field nCategory) ' OUT : - Sub DisplayTopNewsLinksNEW(iTop, iCategory) Dim oCn, oRs, rSQL Dim titreNews, texteNews, dateNews, sCategory, sTitleCat, iLoop
Set oCn = DBConnexion(DB_MAIN)
If iCategory <> "" and iCategory <> 0 Then sCategory = "?cat=" & iCategory rSQL = "SELECT cTitle FROM categories WHERE cID=" & iCategory Set oRs = DBRecordSet(oCn, rSQL) If Not oRs.EOF Then sTitleCat = " - " & Server.HTMLEncode(oRs(0)) end if oRs.Close Set oRs = Nothing End If
rSQL = "SELECT nID, nDate, nTitle FROM news, versions WHERE nVersion=vID AND nDate < '" & DateTimeToString(Now()) & "' AND nValid=1" If sXMLVersion <> "" Then rSQL = rSQL & " AND vCode='" & sXMLVersion & "'" end if If sCategory <> "" Then rSQL = rSQL & " AND nCategory=" & iCategory end if rSQL = rSQL & " ORDER BY nDate DESC"
Set oRs = DBRecordSet(oCn, rSQL)
CreateTopTable "TopNewsLinksNEW", GetTranslation("LANG_TOP") & " " & iTop & " - " & GetTranslation("LANG_NEWS") & sTitleCat If Not oRs.EOF Then iLoop = 0 While Not oRs.EOF And iLoop < iTop If iLoop < GLOBAL_NEWS_TOP Then Response.Write "<a href=""" & GLOBAL_SITE_NEWS_PAGE & sCategory & "#news_" & Left(oRs("nID"),8) & """>" & CodeMessage(oRs("nTitle"), False) & "</a> <span class=""small"">" & GetDateLitteralDDMMYYYY(StringToDate(oRs("nDate"))) & "</span><br>" & vbCRLF Else Response.Write "<a href=""" & GLOBAL_SITE_NEWS_PAGE & "?id=" & Left(oRs("nID"),8) & """>" & CodeMessage(oRs("nTitle"), False) & "</a> <span class=""small"">" & GetDateLitteralDDMMYYYY(StringToDate(oRs("nDate"))) & "</span><br>" & vbCRLF End If oRs.MoveNext iLoop = iLoop + 1 WEnd Else Response.Write GetTranslation("LANG_EMPTY_SECTION") End If CreateBottomTable ""
oRs.Close Set oRs = Nothing oCn.Close Set oCn = Nothing End Sub
pero mi visualizza sempre ogni categoria separata, che sto sbagliando??
piosky_to2003 Esperto
2291 Discussioni
09 settembre 2007 alle 11:37:59 Se la duplichi ma non cambi nulla , ovvio che il risultato e' uguale come detto nei post precedenti devi togliere in questa nuova funzione il createtoptable e createbottomtable (le linee in neretto)
' Display the top news list (links to news) aggiunta da me ' IN : iTop (int) : number of results wanted ' : iCategory (int) : news' category (table news, field nCategory) ' OUT : - Sub DisplayTopNewsLinksNEW(iTop, iCategory) Dim oCn, oRs, rSQL Dim titreNews, texteNews, dateNews, sCategory, sTitleCat, iLoop
Set oCn = DBConnexion(DB_MAIN)
If iCategory <> "" and iCategory <> 0 Then sCategory = "?cat=" & iCategory rSQL = "SELECT cTitle FROM categories WHERE cID=" & iCategory Set oRs = DBRecordSet(oCn, rSQL) If Not oRs.EOF Then sTitleCat = " - " & Server.HTMLEncode(oRs(0)) end if oRs.Close Set oRs = Nothing End If
rSQL = "SELECT nID, nDate, nTitle FROM news, versions WHERE nVersion=vID AND nDate < '" & DateTimeToString(Now()) & "' AND nValid=1" If sXMLVersion <> "" Then rSQL = rSQL & " AND vCode='" & sXMLVersion & "'" end if If sCategory <> "" Then rSQL = rSQL & " AND nCategory=" & iCategory end if rSQL = rSQL & " ORDER BY nDate DESC"
Set oRs = DBRecordSet(oCn, rSQL)
'QUESTA CreateTopTable "TopNewsLinksNEW", GetTranslation("LANG_TOP") & " " & iTop & " - " & GetTranslation("LANG_NEWS") & sTitleCat If Not oRs.EOF Then iLoop = 0 While Not oRs.EOF And iLoop < iTop If iLoop < GLOBAL_NEWS_TOP Then Response.Write "<a href=""" & GLOBAL_SITE_NEWS_PAGE & sCategory & "#news_" & Left(oRs("nID"),8) & """>" & CodeMessage(oRs("nTitle"), False) & "</a> <span class=""small"">" & GetDateLitteralDDMMYYYY(StringToDate(oRs("nDate"))) & "</span><br>" & vbCRLF Else Response.Write "<a href=""" & GLOBAL_SITE_NEWS_PAGE & "?id=" & Left(oRs("nID"),8) & """>" & CodeMessage(oRs("nTitle"), False) & "</a> <span class=""small"">" & GetDateLitteralDDMMYYYY(StringToDate(oRs("nDate"))) & "</span><br>" & vbCRLF End If oRs.MoveNext iLoop = iLoop + 1 WEnd Else Response.Write GetTranslation("LANG_EMPTY_SECTION") End If 'QUESTA CreateBottomTable ""
oRs.Close Set oRs = Nothing oCn.Close Set oCn = Nothing End Sub
--------------- Silvio Andrighetti Formaggini (Piosky)