Forum 

Forum AspNuke.it - Il tuo Portale OpenSource in ASP

Modifica al link top news

Autore Messaggio
grami

Principiante
Principiante
4 Discussioni



Profilo - grami
31 agosto 2005 alle 03:15:18 Profilo - gramiInvia un messaggio privato Rispondi quotando
Prima di tutto complimenti e grazie a tutti voi dello staff di aspnuke.it perche avete sviluppato un pacchetto veramente valido.

Sono il webmaster di http://www.cusfirenzerugby.it e la mia idea è di modificare la link top news che ho messo in home page in modo che cliccando sul titolo delle news elencate si acceda al dettaglio della singola notizia e non alla pagina delle news.

Pensando di modificare news-inc.asp (nella porzione di codice originale sottoelencata) ho fatto delle prova ma con scarso risultato. Avete qualche consiglio da darmi?

Grazie Jacopo

' Display the top news list (links to news)
' IN : iTop (int) : number of results wanted
' : iCategory (int) : news' category (table news, field nCategory)
' OUT : -
Sub DisplayTopNewsLinks(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 "TopNewsLinks", GetTranslation("LANG_TOP") & " " & iTop & " - " & GetTranslation("LANG_NEWS") & sTitleCat
If Not oRs.EOF Then
iLoop = 0
While Not oRs.EOF And iLoop < iTop
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
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
grami

Principiante
Principiante
4 Discussioni



Profilo - grami
06 settembre 2005 alle 19:05:21 Profilo - gramiInvia un messaggio privato Rispondi quotando
Problema risolto:
sostituendo nella linea di codice 259 di news-inc.asp
"#news_" con "?id="

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 : 101
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: 5685465 Post sui forum: 51195 Libro degli ospiti: 4 Eventi: 7

Versioni

Temi