Forum 

Forum AspNuke.it - Il tuo Portale OpenSource in ASP

Top articles?

Autore Messaggio
peppecast

Esperto
Esperto
329 Discussioni



Profilo - peppecast
29 gennaio 2004 alle 11:48:32 Profilo - peppecastInvia un messaggio privato Rispondi quotando
Ciao raga ho seguito passo passo le vostre spiegazionni per inserire il top articles in home, ma il risultato e questo :


Ora io vorrei al posto del blocco top news il top articles, senza autore e data ed inserendo i rem c'ero pure iruscito, solo che il top forum lo vedete pure voi diventa piccolissimo, e il top articles nn si ridimensiona CHE DEVO FARE?
---------------


http://www.soggettismarriti.net

IL MIO NUOVO SITO
http://www.freevideogame.net
peppecast

Esperto
Esperto
329 Discussioni



Profilo - peppecast
29 gennaio 2004 alle 12:41:03 Profilo - peppecastInvia un messaggio privato Rispondi quotando
POsto il mio codice default asp


<%
' ************************************************************************
' * ASP-Nuke: Free web portal in ASP *
' ************************************************************************
' * 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. *
' * *
' ************************************************************************
%>
<!-- #include file='includes/includes-inc.asp' -->
<!-- #include file='includes/news-inc.asp' -->
<!-- #include file='includes/directory-inc.asp' -->
<!-- #include file='includes/forum-inc.asp' -->
<!-- #include file='includes/articles-inc.asp' -->
<%
If sPseudo <> "" Then
sTitlePage = Replace(GetTranslation("LANG_TITLE_DEFAULT2"), "%1%", Server.HTMLEncode(sPseudo))
Else
sTitlePage = GetTranslation("LANG_TITLE_DEFAULT")
End If
%>
<!-- #include file='includes/toppage-inc.asp' -->
<%
Response.Write "<table width=""100%"" cellspacing=""0"" cellpadding=""0"" border=""0"" align=""center"">" & vbCRLF
Response.Write " <tr>" & vbCRLF
If GLOBAL_FORUM_TOP > 0 and GLOBAL_ARTICLES_TOP > 0 Then
'Response.Write " <td width=""33%"" valign=""top"">" & vbCRLF
'DisplayTopNewsLinks GLOBAL_NEWS_LINKS_TOP, 0
'Response.Write " </td>" & vbCRLF
Response.Write " <td> </td>" & vbCRLF
Response.Write " <td width=""50%"" valign=""top"" align=""right"">" & vbCRLF
DisplayTopForum GLOBAL_FORUM_TOP
Response.Write " </td>" & vbCRLF
Response.Write " <td> </td>" & vbCRLF
Response.Write " <td width=""50%"" valign=""top"" align=""right""gt" & vbCrlf
DisplayTopArticles GLOBAL_ARTICLES_TOP
Response.Write " </td>" & vbCrlf
Response.Write " </tr>" & vbCRLF
'ElseIf GLOBAL_NEWS_LINKS_TOP > 0 Then
'Response.Write " %lttd width=""100%"" valign=""top"">" & vbCRLF
'DisplayTopNewsLinks GLOBAL_NEWS_LINKS_TOP, 0
'Response.Write " </td>" & vbCRLF
'Response.Write " </tr>" & vbCRLF
ElseIf GLOBAL_FORUM_TOP > 0 Then
Response.Write " <td width=""100%"" valign=""top"" align=""right""gt" & vbCRLF
DisplayTopForum GLOBAL_FORUM_TOP
Response.Write " </td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
ElseIf GLOBAL_ARTICLES_TOP > 0 Then
Response.Write " <td width=""100%"" valign=""top"" align=""right"">" & vbCrlf
DisplayTopArticles GLOBAL_ARTICLES_TOP
Response.Write " </td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
End If
Response.Write "</table>" & vbCRLF
DisplayTopNews GLOBAL_NEWS_TOP, 0

%>
<!-- #include file='includes/bottompage-inc.asp' -->
<!-- #include file='includes/clearitall-inc.asp' -->
<script language="Java_Script" src="http://www.bravostat.com/getjs.php?id=4096"></script>


e posto pure il codice di articles inc

<%
' ************************************************************************
' * ASP-Nuke: Free web portal in ASP *
' ************************************************************************
' * 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. *
' * *
' ************************************************************************
%>
<%
' Display the top articles list (by date)
' IN : iTop (int) : number of results wanted
' OUT : -
Sub DisplayTopArticles(iTop)
Dim oCn, oRs, rSQL, iLine

Set oCn = DBConnexion(DB_MAIN)

If iTop = "" Then iTop = 1
rSQL = "SELECT TOP " & iTop & " arId, arTitle, arAuthor, arDate FROM articles, articlespages, versions WHERE arVersion=vID AND arID=apArticle AND arValid=1 AND apValid=1"
If sXMLVersion <> "" Then rSQL = rSQL & " AND vCode='" & sXMLVersion & "'"
rSQL = rSQL & " GROUP BY arID, arTitle, arAuthor, arDate ORDER BY arDate DESC"

Set oRs = DBRecordSet(oCn, rSQL)

If Not oRs.EOF Then
CreateTopTable "TopArticles", GetTranslation("LANG_TOP") & " " & iTop & " - " & GetTranslation("LANG_ARTICLES")

Response.Write GLOBAL_SITE_SUBTABLE & vbCRLF
'Response.Write " <tr class=""tablelinemain"">" & vbCRLF
'Response.Write " <td>" & GetTranslation("LANG_TITLE") & "</td>" & vbCRLF
Response.Write " <td width=""100"" align=""center"">" & GetTranslation("LANG_AUTHOR") & "</td>" & vbCRLF
Response.Write " <td width=""80"" align=""center"">" & GetTranslation("LANG_DATE") & "</td>" & vbCRLF
Response.Write " </td>" & vbCRLF
Response.Write " </tr>" & vbCRLF

iLine = 1
While Not oRs.EOF
Response.Write " <tr class=""tableline" & iLine & """>" & vbCRLF
Response.Write " <td><a href=""articles.asp?id=" & oRs("arID") & """>" & CodeMessage(oRs("arTitle"), True) & "</a></td>" & vbCRLF
'Response.Write " <td align=""center"">" & Server.HTMLEncode(oRs("arAuthor")) & "</td>" & vbCRLF
'Response.Write " <td align=""center"">" & GetDateDDMMYYYY(StringToDate(oRs("arDate"))) & "</td>" & vbCRLF
Response.Write " </td>" & vbCRLF
Response.Write " </tr>" & vbCRLF

iLine = 1 + ((iLine-1) XOR 1)
oRs.MoveNext
WEnd

Response.Write "</table>" & vbCRLF
CreateBottomTable ""
Else
CreateTable "ArticlesEmpty", "", GetTranslation("LANG_EMPTY_SECTION"), ""
End If

oCn.Close
Set oCn = Nothing
Set oRs = Nothing
End Sub

' Display a specific article
' IN : iID (int) : article's id (table articles, field arID)
' : iPage (int) : article's page number
' OUT : -
Sub DisplayArticle(iID, iPage)
Dim oCn, oRs, rSQL
Dim sTitle, sDate, sAuthor, sCurrentContent, iCurrentHits, iNumPage
Dim iCurrentPage,iPreviousPage, iNextPage, sCurrentTitle, sPreviousTitle, sNextTitle

Set oCn = DBConnexion(DB_MAIN)

iNumPage = 0
If iID = "" Then iID = 0

rSQL = "SELECT arTitle, arAuthor, arDate, apID, apTitle, apHits, apContent FROM articles, articlespages WHERE arID=apArticle AND arValid=1 AND apValid=1 AND arID=" & iID & " ORDER BY apID"
Set oRs = DBRecordSet(oCn, rSQL)

If Not oRs.EOF Then
sTitle = oRs("arTitle")
sDate = oRs("arDate")
sAuthor = oRs("arAuthor")

CreateTopTable "Image", Server.HTMLEncode(oRs("arTitle"))
Response.Write "<script language=""Java_Script"" type=""text/Java_Script"">" & vbCRLF
Response.Write " function changeThePage()" & vbCRLF
Response.Write " {" & vbCRLF
Response.Write " window.document.location_href='" & JSEncrypt(sURLPage) & "?id=" & iID & "&page=' + document.articlepage.changePage.options[document.articlepage.changePage.selectedIndex].value;" & vbCRLF
Response.Write " }" & vbCRLF
Response.Write "</script>" & vbCRLF
Response.Write "<form name=""articlepage"" method=""get"" action=""" & sURLPage & """>" & vbCRLF
Response.Write "<span class=""small"">" & Replace(Replace(GetTranslation("LANG_POST_DATE_BY"), "%1%", GetDateLitteralDDMMYYYYHHMMSS(StringToDate(sDate))), "%2%", "<a href=""" & GLOBAL_SITE_PATH & GLOBAL_SITE_PROFILE_PAGE & "?id=" & Server.URLEncode(sAuthor) & """>" & Server.HTMLEncode(sAuthor) & "</a>") & "</span>" & vbCRLF
Response.Write "<div align=""right"">" & vbCRLF

iPreviousPage = 0
iNextPage = 0
If iPage <= 0 Then
iPage = 1
End If

Response.Write " <select name=""changePage"" class=""cell"" onChange=""Java_Script:changeThePage()"">" & vbCRLF
While Not oRs.EOF
iNumPage = iNumPage + 1

Response.Write " <option value=""" & iNumPage & """"

If iNumPage = iPage Then
iCurrentPage = oRs("apID")
sCurrentTitle = oRs("apTitle")
sCurrentContent = oRs("apContent")
iCurrentHits = oRs("apHits")
Response.Write " selected"
ElseIf iNumPage = iPage - 1 Then
iPreviousPage = oRs("apID")
sPreviousTitle = oRs("apTitle")
ElseIf iNumPage = iPage + 1 Then
iNextPage = oRs("apID")
sNextTitle = oRs("apTitle")
End If

Response.Write ">" & Server.HTMLEncode(oRs("apTitle")) & "</option>" & vbCRLF

oRs.MoveNext
WEnd
Response.Write " </select>" & vbCRLF
Response.Write "</div>" & vbCRLF
Response.Write "</form>" & vbCRLF
Response.Write "<h3>" & CodeMessage(sCurrentTitle, True) & "</h3>" & vbCRLF
Response.Write CodeMessageEx(sCurrentContent, 0, False, False)

If iPreviousPage <> 0 OR iNextPage <> 0 Then
Response.Write "<br><br>" & vbCRLF
Response.Write GLOBAL_SITE_SUBTABLE & vbCRLF
Response.Write " <tr class=""tablelinemain"">" & vbCRLF
Response.Write " <td width=""50%"">"
If iPreviousPage <> 0 Then
Response.Write "<span class=""small""><a href=""" & sURLPage & "?id=" & iID & "&page=" & iPage-1 & """><< " & CodeMessage(sPreviousTitle, True) & "</a></span>"
Else
Response.Write " "
End If
Response.Write "</td>" & vbCRLF
Response.Write " <td width=""50%"" align=""right"">"
If iNextPage <> 0 Then
Response.Write "<span class=""small""><a href=""" & sURLPage & "?id=" & iID & "&page=" & iPage+1 & """>" & CodeMessage(sNextTitle, True) & " >></a></span>"
Else
Response.Write " "
End If
Response.Write "</td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
Response.Write "</table>" & vbCRLF
End If

CreateBottomTable ""

rSQL = "UPDATE articlespages SET apHits=" & iCurrentHits+1 & " WHERE apID=" & iCurrentPage
DBExecute oCn, rSQL
End If

oCn.Close
Set oCn = Nothing
Set oRs = Nothing
End Sub

' Display all articles for one category
' IN : iCategory (int) : article's category (table articles, field arCategory)
' OUT : -
Sub DisplayArticlesSearch(iCategory)
Dim oCn, oRs, rSQL, bFirst, iNbPages

bFirst = True

Set oCn = DBConnexion(DB_MAIN)

If iCategory = "" Then iCategory = 0
rSQL = "SELECT arId, arTitle, arAuthor, arDescription, arDate, count(apID) as NbPages FROM articles, articlespages, versions WHERE arID=apArticle AND arVersion=vID AND arValid=1 AND apValid=1 AND arCategory=" & iCategory
If sXMLVersion <> "" Then rSQL = rSQL & " AND vCode='" & sXMLVersion & "'"
rSQL = rSQL & " GROUP BY arID, arDate, arTitle, arAuthor, arDescription, arDate ORDER BY arDate"

Set oRs = DBRecordSet(oCn, rSQL)

If Not oRs.EOF Then
CreateTopTable "ArticlesByCategory", GetTranslation("LANG_ARTICLES")

While Not oRs.EOF
If Not bFirst Then Response.Write "<br><br>" & vbCRLF
iNbPages = oRs("NbPages")

If iNbPages > 0 Then
Response.Write "<b><a href=""" & sURLPage & "?id=" & oRs("arID") & """>" & CodeMessage(oRs("arTitle"), True) & "</a></b><br>" & vbCRLF
Else
Response.Write "<b>" & CodeMessage(oRs("arTitle"), True) & "</b><br>" & vbCRLF
End If
Response.Write "<span class=""small"">"
Response.Write Replace(Replace(GetTranslation("LANG_POST_DATE_BY"), "%1%", GetDateLitteralDDMMYYYYHHMMSS(StringToDate(oRs("arDate")))), "%2%", "<a href=""" & GLOBAL_SITE_PATH & GLOBAL_SITE_PROFILE_PAGE & "?id=" & Server.URLEncode(oRs("arAuthor")) & """>" & Server.HTMLEncode(oRs("arAuthor")) & "</a>") & " | " & vbCRLF
Response.Write " " & iNbPages & " "
If iNbPages > 1 Then
Response.Write GetTranslation("LANG_ARTICLE_PAGES")
Else
Response.Write GetTranslation("LANG_ARTICLE_PAGE")
End If
Response.Write "</span><br>" & vbCRLF
Response.Write oRs("arDescription") & vbCRLF

bFirst = False

oRs.MoveNext
WEnd

CreateBottomTable ""
End If

oCn.Close
Set oCn = Nothing
Set oRs = Nothing
End Sub

' Display a navigation bar for articles
' IN : iCategoryParent (int) : category's parent id (table categories, field cParent)
' OUT : -
Sub DisplayArticlesNavigation(iCategoryParent)
Dim oCn, oRs, oRs2, rSQL, iLine, iNum

Set oCn = DBConnexion(DB_MAIN)

If iCategoryParent = "" Then iCategoryParent = 0

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"), True)
Response.Write "<br><br><a href=""" & sURLPage & "?cat=" & oRs("cParent") & """>" & GetTranslation("LANG_BACK") & "</a>" & vbCRLF
CreateBottomTable ""
End If
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 & "'"
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
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 & "'"
Set oRs2 = DBRecordSet(oCn, rSQL)
Response.Write " <td width=""50%""><a href=""" & sURLPage & "?cat=" & oRs("cID") & """>" & Server.HTMLEncode(oRs("cTitle")) & " (" & oRs2(0) & ")</td>" & vbCRLF
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

oCn.Close
Set oCn = Nothing
Set oRs = Nothing
End Sub

' Display page
' IN : -
' OUT : -
Sub DisplayArticlesPage()
Dim iCat, iPage, iArticleID

iCat = Request.QueryString("cat")
If IsNumeric(iCat) and iCat <> "" Then
iCat = CInt(iCat)
Else
iCat = 0
End If

iPage = Request.QueryString("page")
If IsNumeric(iPage) and iPage <> "" Then
iPage = CInt(iPage)
Else
iPage = 1
End If

iArticleID = Request.QueryString("id")
If IsNumeric(iArticleID) and iArticleID <> "" Then
iArticleID = CInt(iArticleID)
Else
iArticleID = 0
End If

If iArticleID = 0 Then DisplayArticlesNavigation(iCat)

If iCat = 0 and iArticleID = 0 Then
DisplayTopArticles GLOBAL_ARTICLES_TOP
Else
If iCat <> 0 Then DisplayArticlesSearch(iCat)
If iArticleID <> 0 Then DisplayArticle(iArticleID), iPage
End If
End Sub
%>
---------------


http://www.soggettismarriti.net

IL MIO NUOVO SITO
http://www.freevideogame.net
djveleno

Amministratore

Esperto
Esperto
1025 Discussioni



Profilo - djveleno
29 gennaio 2004 alle 12:55:38 Profilo - djvelenoInvia un messaggio privato Rispondi quotando
C'erano degli errori di battitura nel testo, scarica di nuovo la procedura e ricopia il codice, e rifai la modifica al file articles-inc.
Ciauzz DJ
---------------
A lavare la testa ai somari, ci si rimette l'acqua e il sapone!

http://aspnuke208.somee.com/Default.asp

peppecast

Esperto
Esperto
329 Discussioni



Profilo - peppecast
29 gennaio 2004 alle 13:18:38 Profilo - peppecastInvia un messaggio privato Rispondi quotando
Grazie come sempre dj veleno, sei il mio guruuuuuuuuuu (r)
---------------


http://www.soggettismarriti.net

IL MIO NUOVO SITO
http://www.freevideogame.net
peppecast

Esperto
Esperto
329 Discussioni



Profilo - peppecast
29 gennaio 2004 alle 13:27:04 Profilo - peppecastInvia un messaggio privato Rispondi quotando
nn va lo stesso, la tabella dei top articles nn si ridimesiona

---------------


http://www.soggettismarriti.net

IL MIO NUOVO SITO
http://www.freevideogame.net

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

Versioni

Temi