<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="ARTICLE @ XOOPS powered by FeedCreator" -->
<rss version="0.91">
    <channel>
        <title>Xoops Italia :: Articolo</title>
        <description><![CDATA[Articolo XML]]></description>
        <link>http://www.xoopsitalia.org/modules/article/view.article.php/67/c20</link>
        <lastBuildDate>Tue, 13 May 2008 02:17:55 +0200</lastBuildDate>
        <generator>ARTICLE @ XOOPS powered by FeedCreator</generator>
        <image>
            <url>http://www.xoopsitalia.org/modules/article/images/logo.png</url>
            <title>Xoops Italia :: Articolo</title>
            <link>http://www.xoopsitalia.org/modules/article/</link>
            <width>80</width>
            <height>15</height>
            <description>Articolo XML</description>
        </image>
        <language>it</language>
        <managingEditor>defkon1 at gmail dot com</managingEditor>
        <webMaster>defkon1 at gmail dot com</webMaster>
        <category>Tutorial Avanzati</category>
        <item>
            <title>Myalbum con effetto lightbox!</title>
            <link>http://www.xoopsitalia.org/modules/article/view.article.php/67/c20</link>
            <description><![CDATA[Categoria: Hack Moduli<br />Sommario: Modificate il vostro myalbum con il sistema di visualizzazione lightbox!E' ormai più di un annetto che io uso lightbox con myalbum ma purtroppo non ho mai avuto tempo<br />di scrivere un bel tutorial.<br /><br />Finalmente questo tempo l'ho trovato (grazie alle vacanze pasquali <img src="http://www.xoopsitalia.org/uploads/smil44ec2347b7c85.gif" alt="" />) e quindi eccovi il<br />tutorial per trasformare il vostro myalbum in un myalbum-lightbox.<br /><br />Per chi si chiedesse che cosa è lighbox può vedere una preview cliccando qui:<br /><br /><a href="http://www.stefanosilvestrini.com/lab/" title="http://www.stefanosilvestrini.com/lab/" target="_blank">http://www.stefanosilvestrini.com/lab/</a><br /><br /><br />INIZIAMO!!!<br /><br />Scaricatevi e scompattate il seguente pack:<br /><br /><a href="http://www.huddletogether.com/projects/lightbox2/releases/lightbox2.04.zip" title="http://www.huddletogether.com/projects/lightbox2/releases/lightbox2.04.zip" target="_blank">http://www.huddletogether.com/project ... releases/lightbox2.04.zip</a><br /><br /><br /><br />Andiamo via FTP ed apriamo la cartellina <strong>themes</strong> presente nella root del nostro sito Xoops.<br />Entriamo nella cartellina del nostro tema in uso ed editiamo il file <strong>theme.html</strong>:<br /><br />prima della chiusura del tag<br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">head</span><span style="color: #007700">&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br />inserite questo codice:<br /><br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">script&nbsp;type</span><span style="color: #007700">=</span><span style="color: #DD0000">"text/javascript"&nbsp;</span><span style="color: #0000BB">src</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{$xoops_url}&gt;/js/prototype.js"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&lt;/script&gt;<br /></span>&lt;script&nbsp;type="text/javascript"&nbsp;src="&lt;{$xoops_url}&gt;/js/scriptaculous.js?load=effects,builder"&gt;&lt;/script&gt;<br />&lt;script&nbsp;type="text/javascript"&nbsp;src="&lt;{$xoops_url}&gt;/js/lightbox.js"&gt;&lt;/script&gt;<br />&lt;link&nbsp;rel="stylesheet"&nbsp;href="&lt;{$xoops_url}&gt;/css/lightbox.css"&nbsp;type="text/css"&nbsp;media="screen"&nbsp;/&gt;</span>
</code></code></div><br /><br />ora salvate e chiudete.<br /><br />Ora fate upload delle direcotry css, js e images presenti nel pack <strong>lightbox 2.04</strong> facendo attenzione<br />di non sovrascrivere la cartellina images (già presente nella vostra root), ma copiando i file della<br />lightbox/images/ ed incollandoli nella root/images/ del vostro sito Xoops.<br /><br />A questo punto siamo pronti a modificare il codice.<br /><br /><strong>ATTENZIONE: utilizzerò il nuovo sistema di <a href="http://www.xoopsitalia.org/modules/article/view.article.php/c1/63" target="_blank">TEMPLATE OVERRIDE</a> usando come esempio la visualizzazione a TABELLA di myalbum.</strong><br />(se vorrete potrete cambiare tipo di visualizzazione dalle preferenze di myalbum, ricordando di modificare il codice del template relativo)<br /><br /><br /><br /><br />Andiamo via ftp in:<br /><br /><strong>root_del_sito/modules/myalbum/templates</strong><br /><br />e copiamo sul nostro desktop (o dove vorrete) il file <strong>myalbum_viewcat_table.html</strong><br /><br />A questo punto apriamo il file ed editiamolo in questo modo:<br /><br />alla riga 65 troviamo la riga:<br /><br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">a&nbsp;href</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$mod_url}&gt;/photo.php?lid=&lt;{$photo.lid}&gt;'</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.imgsrc_thumb}&gt;'&nbsp;</span><span style="color: #007700">&lt;{</span><span style="color: #0000BB">$photo</span><span style="color: #007700">.</span><span style="color: #0000BB">width_spec</span><span style="color: #007700">}&gt;&nbsp;</span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.title}&gt;'&nbsp;</span><span style="color: #0000BB">title</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.title}&gt;'&nbsp;</span><span style="color: #0000BB">border</span><span style="color: #007700">=</span><span style="color: #DD0000">'0'&nbsp;</span><span style="color: #007700">/&gt;&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br /><br />e la modifichiamo in questo modo: <br /><br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">a&nbsp;href</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.imgsrc_photo}&gt;'&nbsp;</span><span style="color: #0000BB">rel</span><span style="color: #007700">=</span><span style="color: #DD0000">'lightbox[]'</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.imgsrc_thumb}&gt;'&nbsp;</span><span style="color: #007700">&lt;{</span><span style="color: #0000BB">$photo</span><span style="color: #007700">.</span><span style="color: #0000BB">width_spec</span><span style="color: #007700">}&gt;&nbsp;</span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.title}&gt;'&nbsp;</span><span style="color: #0000BB">title</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.title}&gt;'&nbsp;</span><span style="color: #0000BB">border</span><span style="color: #007700">=</span><span style="color: #DD0000">'0'&nbsp;</span><span style="color: #007700">/&gt;&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br /><br />Ora salviamo il file e chiudiamo.<br /><br /><br /><br /><br /><br />Eseguiamo la stessa procedura con questo file: <strong>myalbum_photo_in_list.html</strong> ed<br /><br />alla riga 11 troviamo questo codice:<br /><br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">a&nbsp;href</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$mod_url}&gt;/photo.php?lid=&lt;{$photo.lid}&gt;'</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.imgsrc_thumb}&gt;'&nbsp;</span><span style="color: #007700">&lt;{</span><span style="color: #0000BB">$photo</span><span style="color: #007700">.</span><span style="color: #0000BB">width_spec</span><span style="color: #007700">}&gt;&nbsp;</span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.title}&gt;'&nbsp;</span><span style="color: #0000BB">title</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.title}&gt;'&nbsp;</span><span style="color: #007700">/&gt;&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br /><br />e la modifichiamo in questa maniera:<br /><br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">a&nbsp;href</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.imgsrc_photo}&gt;'&nbsp;</span><span style="color: #0000BB">rel</span><span style="color: #007700">=</span><span style="color: #DD0000">'lightbox[]'</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.imgsrc_thumb}&gt;'&nbsp;</span><span style="color: #007700">&lt;{</span><span style="color: #0000BB">$photo</span><span style="color: #007700">.</span><span style="color: #0000BB">width_spec</span><span style="color: #007700">}&gt;&nbsp;</span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.title}&gt;'&nbsp;</span><span style="color: #0000BB">title</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.title}&gt;'&nbsp;</span><span style="color: #007700">/&gt;&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br /><br />ed alla riga 16 troviamo:<br /><br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">a&nbsp;href</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.ahref_photo}&gt;'&nbsp;</span><span style="color: #0000BB">target</span><span style="color: #007700">=</span><span style="color: #DD0000">'_blank'</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.imgsrc_thumb}&gt;'&nbsp;</span><span style="color: #007700">&lt;{</span><span style="color: #0000BB">$photo</span><span style="color: #007700">.</span><span style="color: #0000BB">width_spec</span><span style="color: #007700">}&gt;&nbsp;</span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.title}&gt;'&nbsp;</span><span style="color: #0000BB">title</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.title}&gt;'&nbsp;</span><span style="color: #007700">/&gt;&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br /><br />e la modifichiamo:<br /><br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">a&nbsp;href</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.imgsrc_photo}&gt;'&nbsp;</span><span style="color: #0000BB">rel</span><span style="color: #007700">=</span><span style="color: #DD0000">'lightbox[]'</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.imgsrc_thumb}&gt;'&nbsp;</span><span style="color: #007700">&lt;{</span><span style="color: #0000BB">$photo</span><span style="color: #007700">.</span><span style="color: #0000BB">width_spec</span><span style="color: #007700">}&gt;&nbsp;</span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.title}&gt;'&nbsp;</span><span style="color: #0000BB">title</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.title}&gt;'&nbsp;</span><span style="color: #007700">/&gt;&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br /><br />Ora salviamo il file e chiudiamo.<br /><br /><br /><br /><br /><br />Eseguiamo la stessa procedura con questo file: <strong>myalbum_photo.html</strong> ed<br /><br />alla riga 28 troviamo questo codice:<br /><br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">a&nbsp;href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{$photo.ahref_photo}&gt;"&nbsp;</span><span style="color: #0000BB">target</span><span style="color: #007700">=</span><span style="color: #DD0000">"_blank"&nbsp;</span><span style="color: #0000BB">onClick</span><span style="color: #007700">=</span><span style="color: #DD0000">"window.open('&lt;{$photo.ahref_photo}&gt;','','width=&lt;{$photo.window_x}&gt;,height=&lt;{$photo.window_y}&gt;');return(false);"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{$photo.imgsrc_photo}&gt;"&nbsp;</span><span style="color: #0000BB">border</span><span style="color: #007700">=</span><span style="color: #DD0000">"0"&nbsp;</span><span style="color: #0000BB">align</span><span style="color: #007700">=</span><span style="color: #DD0000">"center"&nbsp;</span><span style="color: #0000BB">vspace</span><span style="color: #007700">=</span><span style="color: #DD0000">"3"&nbsp;</span><span style="color: #0000BB">hspace</span><span style="color: #007700">=</span><span style="color: #DD0000">"7"&nbsp;</span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{$photo.title}&gt;"&nbsp;</span><span style="color: #0000BB">title</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{$photo.title}&gt;"&nbsp;</span><span style="color: #007700">&lt;{</span><span style="color: #0000BB">$photo</span><span style="color: #007700">.</span><span style="color: #0000BB">width_height</span><span style="color: #007700">}&gt;&nbsp;/&gt;&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br /><br />e la modifichiamo in questa maniera:<br /><br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">a&nbsp;href</span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;{$photo.imgsrc_photo}&gt;'&nbsp;</span><span style="color: #0000BB">rel</span><span style="color: #007700">=</span><span style="color: #DD0000">'lightbox[]'</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{$photo.imgsrc_photo}&gt;"&nbsp;</span><span style="color: #0000BB">border</span><span style="color: #007700">=</span><span style="color: #DD0000">"0"&nbsp;</span><span style="color: #0000BB">align</span><span style="color: #007700">=</span><span style="color: #DD0000">"center"&nbsp;</span><span style="color: #0000BB">vspace</span><span style="color: #007700">=</span><span style="color: #DD0000">"3"&nbsp;</span><span style="color: #0000BB">hspace</span><span style="color: #007700">=</span><span style="color: #DD0000">"7"&nbsp;</span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{$photo.title}&gt;"&nbsp;</span><span style="color: #0000BB">title</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;{$photo.title}&gt;"&nbsp;</span><span style="color: #007700">&lt;{</span><span style="color: #0000BB">$photo</span><span style="color: #007700">.</span><span style="color: #0000BB">width_height</span><span style="color: #007700">}&gt;&nbsp;/&gt;&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br /><br />Ora salviamo il file e chiudiamo.<br /><br /><br /><br /><br /><br /><br />A questo punto usiamo il template override e quindi andiamo via ftp in:<br /><br />root_del_sito/themes/il_tema_in_uso/ creiamo una cartellina <strong>modules</strong> (se non è già presente)<br />ed al suo interno creiamo una cartellina <strong>myalbum</strong>. All'interno di questa cartellina myalbum inseriamo i file appena creati.<br /><br />Ora per sicurezza andiamo via ftp a svuotare la cartellina <strong>template_c</strong> presente nella root del nostro sito.<br /><br /><br /><br />Ora aprite il file <strong>js/lightbox.js</strong> e modificate le righe 49 e 50 in questo modo:<br /><br /><div class="xoopsCode"><code><code><span style="color: #000000">
<span style="color: #0000BB"><br />fileLoadingImage</span><span style="color: #007700">:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'http://www.stefanosilvestrini.com/lab/images/loading.gif'</span><span style="color: #007700">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">fileBottomNavCloseImage</span><span style="color: #007700">:&nbsp;</span><span style="color: #DD0000">'http://www.stefanosilvestrini.com/lab/images/closelabel.gif'</span><span style="color: #007700">,</span><span style="color: #0000BB"></span>
</span>
</code></code></div><br /><br />inserendo quindi il path completo relativo al vostro sito.<br /><br /><br /><br /><strong>IL TUTORIAL E' FINITO. Ora avrete il vostro myalbum con la visualizzazione lightbox!</strong><br /><br />Vi ricordo che con il sistema lightbox non avrete il conteggio dei click e delle visualizzazioni delle vostre foto,<br />ma avrete un effetto visivo veramente eccellente.<br /><br />Happy Xoops! <img src="http://www.xoopsitalia.org/uploads/smil44ec20d9c5bb0.gif" alt="" /><br /><br />ciao Stefano<br />]]></description>
            <author>slyss</author>
            <pubDate>Sun, 23 Mar 2008 19:42:55 +0200</pubDate>
        </item>
    </channel>
</rss>
