15 ottobre 2004 alle 15:34:31 Modificato il 15 ottobre 2004 alle 15:40:39ciao 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
ps dimenticavo è possibile fare anche in modo che siano contratti di default???
15 ottobre 2004 alle 15:58:52 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
0 Discussione
15 ottobre 2004 alle 16:10:40 grazie emu...ma per ora resto alla 1.2 per il vecchio sito...per i prossimi passo sicuramente alla versione 2....
excess Eliminato
0 Discussione
16 ottobre 2004 alle 14:19:24 Modificato il 16 ottobre 2004 alle 14:36:56Blocchi 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
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)
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)
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
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 +) 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....
ps2
le immagini da uploadare si chiamano minimize.gif e maximize.gif
Log in
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
Anna
Iscritti
Utenti: 18940
Ultimo iscritto : glauco Lista iscritti Messaggi privati: 3373Commenti: 2210Immagini: 39Downloads: 144Articoli: 49Pagine: 101Siti web: 558Notizie: 180Sondaggi: 11Preferiti: 5684683Post sui forum: 51195Libro degli ospiti: 4Eventi: 7