19 marzo 2005 alle 16:01:40 Modificato il 19 marzo 2005 alle 16:04:43Ciao 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 %>
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