Forum 

Forum AspNuke.it - Il tuo Portale OpenSource in ASP

Top commenti

Autore Messaggio
rosmarc

Utente
Utente
55 Discussioni



Profilo - rosmarc
19 marzo 2005 alle 16:01:40 Profilo - rosmarcInvia un messaggio privato Rispondi quotando
Modificato il 19 marzo 2005 alle 16:04:43

Ciao a tutti, ho pensato che non sarebbe stato male avere la possibilita di avere il "top commenti" in home page, per dare subito a tutti la possibilità di leggere e rispondere ad un eventuale commento lasciato in una qualsiasi sezione.
Per chi sente questa necessità, vi dico come ho fatto:

1) Creare pagina top commenti-inc.asp da inserire nella cartella include.

<%
' ************************************************************************
' * ASPNUKE: Free web portal in ASP *
' ************************************************************************
' * ASP-Nuke 2.0 Copyright (c) 2004 by Aspnuke.it Staff *
' * (staff@aspnuke.it) http://www.aspnuke.it *
' * *
' * Re-design by Anna Santonicola (c) 2004 (webmaster@aspnuke.it) *
' * Re-design by Frank Zalabard (c) 2004 (fsarzana@hotmail.com) *
' * Re-design by Enrico Musante (c) 2004 (emu@libero.it) *
' * *
' * ASP-Nuke 1.0, 1.1, 1.2 Copyright (c) 2002-2003 by Gaetan Bouveret *
' * (webmaster@asp-nuke.com) http://www.asp-nuke.com *
' * *
' * This program is free software. You can redistribute it and/or modify *
' * it under the terms of the GNU General Public License as published by *
' * the Free Software Foundation; either version 2 of the License, or *
' * (at your option) any later version. *
' * *
' ************************************************************************
%>
<%

Sub Topcom
Dim oCn, oRs, rSQL, iLoop, icom
icom = GLOBAL_COMMENTI_LINKS_TOP

Set oCn = DBConnexion(DB_MAIN)

rSQL = "SELECT cID, cItem, cAuthor, cText, cDate, cType, cValid FROM comments ORDER BY cDate DESC"
Set oRs = DBRecordSet(oCn, rSQL)

CreateTopTable "Commenti", GetTranslation("LANG_TOP") & " " & icom & " - " & GetTranslation("LANG_TITLE_COMMENTS")
If Not oRs.EOF Then
iLoop = 0
While Not oRs.EOF And iLoop < icom
Response.Write " <span class=""small"">" & Server.HTMLEncode(oRs("cAuthor")) & " - " & GetDateDDMMYYHHMMSS(StringToDate(oRs("cDate"))) & "</span><br>" & vbCRLF
if oRs("cType") = 1 then
Response.Write " <a href=""" & GLOBAL_SITE_PATH &"news.asp?id=" & oRs("cItem")
end if
if oRs("cType") = 3 then
Response.Write " <a href=""" & GLOBAL_SITE_PATH &"downloads.asp?id=" & oRs("cItem")
end if
if oRs("cType") = 4 then
Response.Write " <a href=""" & GLOBAL_SITE_PATH &"images.asp?id=" & oRs("cItem")
end if
if oRs("cType") = 5 then
Response.Write " <a href=""" & GLOBAL_SITE_PATH &"articles.asp?id=" & oRs("cItem")
end if


Response.Write """>"
If bWYSIWYGeditor=0 Then
Response.Write CodeMessageEx(oRs("cText"), 40, True, oRs("PostSmileys").Value) & "</a>" & vbCRLF
Else
Response.Write CodeMessageForum(oRs("cText"), 40) & "</a>" & vbCRLF
End if
Response.Write "<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
%>


2)inserire nuova traduzione:

GLOBAL_COMMENTI_LINKS_TOP
Numero ultimi commenti


3) inserire nel file configuration.xml:

<translation name="GLOBAL_COMMENTI_LINKS_TOP">5</translation>


4) inserire nel file variables-inc.asp la dichiarazione della variabile:

Dim GLOBAL_COMMENTI_LINKS_TOP


5) inserire nel file defaultX-inc.asp che usate come default, sotto gli include già presenti:
<!-- #include file="top commenti-inc.asp" -->


6) inserire nel file manager-inc.asp all'interno della sub ReadApplicationFromXML
GLOBAL_COMMENTI_LINKS_TOP = Clng(Trim(GetNewTranslation("GLOBAL_COMMENTI_LINKS_TOP", oAppXML, "5")))


7) Inserite nella pagina defaultx.asp, nel punto in cui volete che esca la tabella, il richiamo alla sub:

Topcom


------------------------------------------------
Finito! Spero di non essermi dimenticato nulla.
la modifica è visibile all'indirizzo http://www.arciericesanoboscone.it

Cosa dite? può essere utile?
Marco
[lo]
---------------
http://www.vinciteallotto.it
http://www.arciericesanoboscone.it
rosmarc

Utente
Utente
55 Discussioni



Profilo - rosmarc
25 marzo 2005 alle 16:01:44 Profilo - rosmarcInvia un messaggio privato Rispondi quotando
Solo per curiosità......vi è servito?

Esiste un modo più semplice, che non conosco, per realizzare queste "anteprime"
Ciauz
Marco
---------------
http://www.vinciteallotto.it
http://www.arciericesanoboscone.it
rosmarc

Utente
Utente
55 Discussioni



Profilo - rosmarc
16 giugno 2005 alle 00:19:35 Profilo - rosmarcInvia un messaggio privato Rispondi quotando
Non mi aspettavo tutto questo entusiasmo :)
neanche un commento in... (non mi ricordo) mesi
Va bè
[lo]
Ciauz
Marco
---------------
http://www.vinciteallotto.it
http://www.arciericesanoboscone.it

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

Versioni

Temi