Forum 

Forum AspNuke.it - Il tuo Portale OpenSource in ASP

blochi che si espandono per versione 1.2

Autore Messaggio
excess

Eliminato
Eliminato
0 Discussione



Profilo - excess
15 ottobre 2004 alle 15:34:31 Profilo - excessInvia un messaggio privato Rispondi quotando
Modificato il 15 ottobre 2004 alle 15:40:39

ciao ragazzi potete dirmi come è stata cambiata la funzione CreateTopTable (se è stata modificata quella funzione) per far in modo che i blocchi si espandano e si contraggano nella versione 2 e se è fattibile una cosa del genere nella versione 1.2?
grazieeeee ciaoooooooooo
[lo] [lo] [lo]

ps dimenticavo è possibile fare anche in modo che siano contratti di default???

tnx mille
emu

Moderatore

Esperto
Esperto
1714 Discussioni



Profilo - emu
15 ottobre 2004 alle 15:58:52 Profilo - emuInvia un messaggio privato Rispondi quotando
Per essere fattibile, e' fattibile (anche noi siamo partiti dall 1.2), ma forse e' piu' semplice passare alla 2.0.3.
E' anche possibile cambiare il default, una volta capito come funziona.
Le modifiche sono nel display-inc.asp e nel themes-inc.asp (che nella 1.2 non esisteva).
Ciao
---------------
development@aspnuke.it
excess

Eliminato
Eliminato
0 Discussione



Profilo - excess
15 ottobre 2004 alle 16:10:40 Profilo - excessInvia un messaggio privato Rispondi quotando
grazie emu...ma per ora resto alla 1.2 per il vecchio sito...per i prossimi passo sicuramente alla versione 2....
excess

Eliminato
Eliminato
0 Discussione



Profilo - excess
16 ottobre 2004 alle 14:19:24 Profilo - excessInvia un messaggio privato Rispondi quotando
Modificato il 16 ottobre 2004 alle 14:36:56

Blocchi espandibili per la 1.2 come nella versione 2
funzionaaaaaaaa ce l'ho fatta
grazie a emu e zalabard

ho modificato 3 file, uploadato uno nuovo preso dalla versione 2 e ovviamente due immagini gif nella cartella imgs
opzione uno...blocchi espandibili solo per le news come in http://www.portalearianese.it

passo 1: file display-inc.asp nella cartella includes

aggiungere


' Create the top part of a box table
' IN : sTabName (string) : table's name (can be empty)
' : sHeader (string) : title displayed
' OUT : -
Sub CreateBoxTopTable(sTabName, sHeader)
Response.Write "<div id=""div_" & sTabName & """ style=""display:" & sCollapsed & ";"">" & vbCrLf
Dim sCollapsed


If Request.Cookies("div_" & sTabName) <> "" Then
sCollapsed = Request.Cookies("div_" & sTabName)
Else
sCollapsed = "none"
End If
Response.Write " <table id=""" & sTabName & """ width=""100%"" align=""center"" cellspacing=""0"" cellpadding=""0"" class=""myTable"">" & vbCRLF
If sHeader <> "" Then
Response.Write " <tr>" & vbCRLF
Response.Write " <td class=""myTitle"" width=""100%"">"
Response.Write "<img name=""img_" & sTabName & """ border=""0"" style=""cursor:pointer;"" src=""" & iif(sCollapsed = "none", GLOBAL_SITE_IMAGES_PATH & "maximize.gif", GLOBAL_SITE_IMAGES_PATH & "minimize.gif")
Response.Write """ onClick=""Java_Script:ToggleBlock('div_" & sTabName & "');ToggleImage('" & sTabName & "', '" & GLOBAL_SITE_IMAGES_PATH & "minimize.gif', '" & GLOBAL_SITE_IMAGES_PATH & "maximize.gif');"">"
Response.Write sHeader & "</td>" & vbCrLf
Response.Write " </tr>" & vbCRLF
End If
Response.Write " <tr>" & vbCRLF
Response.Write " <td class=""myTD"" width=""100%"">" & vbCRLF
Response.Write "<div id=""div_" & sTabName & """ style=""display:" & sCollapsed & ";"">" & vbCrLf
End Sub

' Create the bottom part of a box table
' IN : sFooter (string) : footer
' OUT : -
Sub CreateBoxBottomTable(sFooter)
Response.Write "</div>" & vbCrLf
Response.Write " </td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
If sFooter <> "" Then
Response.Write " <tr>" & vbCRLF
Response.Write " <td width=""100%"" align=""center"" class=""myTD""><br><span class=""small"">" & sFooter & "</span></td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
End If
Response.Write " </table>" & vbCRLF
Response.Write "<br>" & vbCRLF
End Sub


passo 2: file news-inc.asp nella cartella include

sostituire la funzione


Sub DisplayNews(iID, bFull, bCountIt)
Dim oCn, oRs, oRs2, rSQL, sURL, tURL, tTemp, iNbWords

Dim printell
printell =" | <a href=""print.asp?print=news&pID=" & iID & """ target=""_blank""><img src=""" & GLOBAL_SITE_IMAGES_PATH & "print.gif"" align=""absbottom"" onclick="""" alt="""&GetTranslation("LANG_PRINT_NEWS")&""" border=""0""></a> | <a href=""sendtofriend.asp?link=" & GLOBAL_SITE_PATH & GLOBAL_SITE_NEWS_PAGE & "?id=" & iID & "&why=News Interessante""><img src=""" & GLOBAL_SITE_IMAGES_PATH & "friend.gif"" align=""absbottom"" alt="""&GetTranslation("LANG_SENDTOFRIEND")&""" border=""0""></a>"


Set oCn = DBConnexion(DB_MAIN)

rSQL = "SELECT nID, nTitle, nAuthor, nDate, nHeader, nText, nImage, nURL, nRead, nCategory, cTitle, vCode FROM news, categories, versions WHERE nCategory=cID AND nVersion=vID AND nValid=True AND nID=" & iID

Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
Response.Write " <a name=""news_" & oRs("nID") & """></a>" & vbCRLF
CreateTopTable "news_" & oRs("nID"), CodeMessage(oRs("nTitle"), False)
Response.Write "<span class=""small"">" & Replace(Replace(GetTranslation("LANG_POST_DATE_BY"), "%1%", GetDateLitteralDDMMYYYYHHMMSS(StringToDate(oRs("nDate")))), "%2%", "<a href=""" & GLOBAL_SITE_PATH & GLOBAL_SITE_PROFILE_PAGE & "?id=" & Server.URLEncode(oRs("nAuthor")) & """>" & Server.HTMLEncode(oRs("nAuthor")) & "</a>")
Response.Write " " & Server.HTMLEncode(oRs("vCode")) & " - <a href=""" & GLOBAL_SITE_NEWS_PAGE & "?cat=" & oRs("nCategory") & """>" & Server.HTMLEncode(oRs("cTitle")) & "</a>"
If oRs("nURL") <> "" Then
sURL = Replace(LCase(oRs("nURL")), "http://", "")
rSQL = "SELECT uTitle FROM urls WHERE uURL LIKE '%" & SQLEncrypt(sURL) & "%'"
Set oRs2 = DBRecordSet(oCn, rSQL)
Response.Write "<br>" & GetTranslation("LANG_SOURCE") & " : <a href=""" & GLOBAL_SITE_PATH & GLOBAL_SITE_GOTOURL_PAGE & "?url=http://" & Server.URLEncode(sURL) & """ target=""_blank"">"
If Not oRs2.EOF Then
Response.Write Server.HTMLEncode(oRs2("uTitle"))
Else
tURL = Split(sURL, "/")
Response.Write Server.HTMLEncode(tURL(0))
End If
Response.Write "</a>" & vbCRLF
End If
Response.Write "</span><br><br>" & vbCRLF

If oRs("nImage") <> "" Then
Response.Write "<img src="""
If Left(LCase(oRs("nImage")), 7) <> "http://" Then Response.Write GLOBAL_SITE_IMAGES_NEWS_PATH
Response.Write oRs("nImage") & """ align=""left"" border=""0"">" & vbCRLF
End If

Response.Write CodeMessage(oRs("nHeader"), False) & vbCRLF
If bFull Then
Response.Write "<br><br>" & vbCRLF
Response.Write CodeMessage(oRs("nText"), False) & vbCRLF

If bCountIt Then
rSQL = "UPDATE news SET nRead=" & oRs("nRead")+1 & " WHERE nID=" & iID
DBExecute oCn, rSQL
End If
End If

If bFull Then
If bCountIt then
CreateBottomTable GetTranslation("LANG_READ") & " : " & oRs("nRead")+1 & " | <a href=""" & GLOBAL_SITE_PATH & "Default.asp"">" & GetTranslation("LANG_BACK") & "</a>" & printell & vbCRLF
Else
CreateboxBottomTable GetTranslation("LANG_READ") & " : " & oRs("nRead") & " | <a href=""" & GLOBAL_SITE_PATH & "Default.asp"">" & GetTranslation("LANG_BACK") & "</a>" & printell & vbCRLF
End If
Else
rSQL = "SELECT Count(cID) FROM Comments WHERE cItem=" & iID & " AND cType=" & CATEGORY_TYPE_NEWS & " AND cValid=True"
Set oRs2 = DBRecordSet(oCn, rSQL)

tTemp = Split(oRs("nText"))
If IsArray(tTemp) Then
iNbWords = Ubound(tTemp) + 1
Else
iNbWords = 0
End If
CreateboxBottomTable "<a href=""" & GLOBAL_SITE_NEWS_PAGE & "?id=" & iID & """>" & GetTranslation("LANG_COMMENTS") & " : " & oRs2(0) & "</a> | " & GetTranslation("LANG_READ") & " : " & oRs("nRead") & " | <a href=""" & GLOBAL_SITE_PATH & GLOBAL_SITE_NEWS_PAGE & "?id=" & iID & """>" & GetTranslation("LANG_READ_MORE") & "</a> (" & Replace(GetTranslation("LANG_READ_MORE_WORDS"), "%1%", iNbWords) & ")" & printell & vbCRLF
End If
End If

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

con
Sub DisplayNews(iID, bFull, bCountIt)
Dim oCn, oRs, oRs2, rSQL, sURL, tURL, tTemp, iNbWords

Dim printell
printell =" | <a href=""print.asp?print=news&pID=" & iID & """ target=""_blank""><img src=""" & GLOBAL_SITE_IMAGES_PATH & "print.gif"" align=""absbottom"" onclick="""" alt="""&GetTranslation("LANG_PRINT_NEWS")&""" border=""0""></a> | <a href=""sendtofriend.asp?link=" & GLOBAL_SITE_PATH & GLOBAL_SITE_NEWS_PAGE & "?id=" & iID & "&why=News Interessante""><img src=""" & GLOBAL_SITE_IMAGES_PATH & "friend.gif"" align=""absbottom"" alt="""&GetTranslation("LANG_SENDTOFRIEND")&""" border=""0""></a>"


Set oCn = DBConnexion(DB_MAIN)

rSQL = "SELECT nID, nTitle, nAuthor, nDate, nHeader, nText, nImage, nURL, nRead, nCategory, cTitle, vCode FROM news, categories, versions WHERE nCategory=cID AND nVersion=vID AND nValid=True AND nID=" & iID

Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
Response.Write " <a name=""news_" & oRs("nID") & """></a>" & vbCRLF
CreateBoxtopTable "news_" & oRs("nID"), CodeMessage(oRs("nTitle"), False)
Response.Write "<span class=""small"">" & Replace(Replace(GetTranslation("LANG_POST_DATE_BY"), "%1%", GetDateLitteralDDMMYYYYHHMMSS(StringToDate(oRs("nDate")))), "%2%", "<a href=""" & GLOBAL_SITE_PATH & GLOBAL_SITE_PROFILE_PAGE & "?id=" & Server.URLEncode(oRs("nAuthor")) & """>" & Server.HTMLEncode(oRs("nAuthor")) & "</a>")
Response.Write " " & Server.HTMLEncode(oRs("vCode")) & " - <a href=""" & GLOBAL_SITE_NEWS_PAGE & "?cat=" & oRs("nCategory") & """>" & Server.HTMLEncode(oRs("cTitle")) & "</a>"
If oRs("nURL") <> "" Then
sURL = Replace(LCase(oRs("nURL")), "http://", "")
rSQL = "SELECT uTitle FROM urls WHERE uURL LIKE '%" & SQLEncrypt(sURL) & "%'"
Set oRs2 = DBRecordSet(oCn, rSQL)
Response.Write "<br>" & GetTranslation("LANG_SOURCE") & " : <a href=""" & GLOBAL_SITE_PATH & GLOBAL_SITE_GOTOURL_PAGE & "?url=http://" & Server.URLEncode(sURL) & """ target=""_blank"">"
If Not oRs2.EOF Then
Response.Write Server.HTMLEncode(oRs2("uTitle"))
Else
tURL = Split(sURL, "/")
Response.Write Server.HTMLEncode(tURL(0))
End If
Response.Write "</a>" & vbCRLF
End If
Response.Write "</span><br><br>" & vbCRLF

If oRs("nImage") <> "" Then
Response.Write "<img src="""
If Left(LCase(oRs("nImage")), 7) <> "http://" Then Response.Write GLOBAL_SITE_IMAGES_NEWS_PATH
Response.Write oRs("nImage") & """ align=""left"" border=""0"">" & vbCRLF
End If

Response.Write CodeMessage(oRs("nHeader"), False) & vbCRLF
If bFull Then
Response.Write "<br><br>" & vbCRLF
Response.Write CodeMessage(oRs("nText"), False) & vbCRLF

If bCountIt Then
rSQL = "UPDATE news SET nRead=" & oRs("nRead")+1 & " WHERE nID=" & iID
DBExecute oCn, rSQL
End If
End If

If bFull Then
If bCountIt then
CreateboxBottomTable GetTranslation("LANG_READ") & " : " & oRs("nRead")+1 & " | <a href=""" & GLOBAL_SITE_PATH & "Default.asp"">" & GetTranslation("LANG_BACK") & "</a>" & printell & vbCRLF
Else
CreateboxBottomTable GetTranslation("LANG_READ") & " : " & oRs("nRead") & " | <a href=""" & GLOBAL_SITE_PATH & "Default.asp"">" & GetTranslation("LANG_BACK") & "</a>" & printell & vbCRLF
End If
Else
rSQL = "SELECT Count(cID) FROM Comments WHERE cItem=" & iID & " AND cType=" & CATEGORY_TYPE_NEWS & " AND cValid=True"
Set oRs2 = DBRecordSet(oCn, rSQL)

tTemp = Split(oRs("nText"))
If IsArray(tTemp) Then
iNbWords = Ubound(tTemp) + 1
Else
iNbWords = 0
End If
CreateboxBottomTable "<a href=""" & GLOBAL_SITE_NEWS_PAGE & "?id=" & iID & """>" & GetTranslation("LANG_COMMENTS") & " : " & oRs2(0) & "</a> | " & GetTranslation("LANG_READ") & " : " & oRs("nRead") & " | <a href=""" & GLOBAL_SITE_PATH & GLOBAL_SITE_NEWS_PAGE & "?id=" & iID & """>" & GetTranslation("LANG_READ_MORE") & "</a> (" & Replace(GetTranslation("LANG_READ_MORE_WORDS"), "%1%", iNbWords) & ")" & printell & vbCRLF
End If
End If

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


attenzione....le funzioni qui postate sono prese dal file news-inc.asp personalizzato per il mio sito....le vostre funzioni potrebbero differire e comunque basterebbe solo trovare e sostituire il CreateTopTable con CreateBoxTopTable e trovare e sostituire il CreateBottomTable con CreateBoxBottomTable


3 passo : file toppage-inc.asp nella cartella include

aggiungere
<!-- #include file="base_js-inc.asp" -->

all'inizio della pagina.

passo 4

creare nella cartella include un file di nome base_js-inc.asp

e incollare dentro il seguente codice:
<script type="text/Java_Script" language="Java_Script">
////////////////////////////////////////////////////////////////////////////
//' * ASP-Nuke Community 1.4 Copyright © 2004 by Rolf Thomassen *
//' * (mrspock(a)rediff.com) http://www.rot.dk *
////////////////////////////////////////////////////////////////////////////
function getObject(id) {
return document.getElementById(id);
}

function ToggleImage(imgId, img_block, img_none) {
var d = getObject("div_"+imgId);
var i = getObject("img_"+imgId);
if (i != null) {
if (d.style.display != "none")
i.src = img_block;
else
i.src = img_none;
}
}

function ToggleBlock(divId) {
var d = getObject(divId);
if (d != null) {
if (d.style.display != 'none')
d.style.display = 'none';
else
d.style.display = 'block';
}
SetCookie(divId,d.style.display,365);
}


function SetCookie(cookieName, cookieValue, nDays) {
var today = new Date();
var expire = new Date();
if (nDays == null || nDays == 0)
nDays = 1;
expire.setTime(today.getTime() + 3600000*24*nDays);
document.cookie = cookieName + "=" + escape(cookieValue) + ";expires=" + expire.toGMTString();
}

function closeChild() {
if (opened)
myWin.close();
}


</script>



passo 5? (non me lo ricordo +) :p
uploadare le immagini che compariranno nella barra del titolo nella cartella root/imgs
nella versione 2 le due immagini sono un + e un -

fine....

se si vuole che ogni parte del nostro sito abbia la funzione che espande un blocco e lo contrae basta sostituire, nel file display-inc.asp nella cartella include, le due funzioni CreateTopTable e CreateBottomTable

con le due nuove funzioni del passo 1 e sostituire la riga

Sub CreateBoxTopTable(sTabName, sHeader)


con la seguente
Sub CreateBoxTopTable(sTabName, sHeader)


e la riga

Sub CreateBoxBottomTable(sFooter)


con la riga

Sub CreateBoxBottomTable(sFooter)



speriamo di essere stato chiaro...ma sapete com'è dopo pranzo di sabato a casa e dopo 3 o 4 bicchieri di buon vino.....vi lascio immaginare


ciaooooooooooooo

ps fate un backup dei file che andate a modificare....


[lo] [lo] [lo]

ps2

le immagini da uploadare si chiamano minimize.gif
e maximize.gif

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

Versioni

Temi