<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="ARTICLE @ XOOPS powered by FeedCreator" -->
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://www.xoopsitalia.org//modules/article/xml.php">
        <title>Xoops Italia :: Articolo</title>
        <description>Articolo XML</description>
        <link>http://www.xoopsitalia.org/modules/article/view.article.php/70/c16</link>
        <image rdf:resource="http://www.xoopsitalia.org/modules/article/images/logo.png" />
       <dc:date>2008-05-16T06:09:45+02:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://www.xoopsitalia.org/modules/article/view.article.php/70/c16"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://www.xoopsitalia.org/modules/article/images/logo.png">
        <title>Xoops Italia :: Articolo</title>
        <link>http://www.xoopsitalia.org/modules/article/</link>
        <url>http://www.xoopsitalia.org/modules/article/images/logo.png</url>
    </image>
    <item rdf:about="http://www.xoopsitalia.org/modules/article/view.article.php/70/c16">
        <dc:format>text/html</dc:format>
        <dc:date>2008-04-06T12:34:11+02:00</dc:date>
        <dc:source>http://www.xoopsitalia.org/modules/article/</dc:source>
        <dc:creator>slyss</dc:creator>
        <title>Semplice funzione per le Google Maps!</title>
        <link>http://www.xoopsitalia.org/modules/article/view.article.php/70/c16</link>
        <description>Categoria: Sviluppo e Hack&lt;br /&gt;Sommario: Ho scritto una funzione per poter semplicemente creare un link alle Google maps in modo da rendere i campi dei nostri moduli o profili più completi.Con questo tutorial vado a spiegare una funzione che ho creato per poter far si che, in ogni punto del nostro sito Xoops, vi sia la possibilità in caso di un indirizzo, città o nazione, di inserire un semplice link che ci permetta di vedere il luogo specificato nelle Google Maps.&lt;br /&gt;&lt;br /&gt;INIZIAMO: &lt;br /&gt;&lt;br /&gt;apriamo il file &lt;strong&gt;root/include/functions.php&lt;/strong&gt; ed alla fine di questo file, prime del tag di chiusura di php, inseriamo:&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;xoopsCode&quot;&gt;&lt;code&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;
&lt;span style=&quot;color: #0000BB&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;xoopsgmaps&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$zip&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$address&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$city&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$country&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$zip&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;==&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;''&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$zip&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;''&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$address&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;==&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;''&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$address&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;''&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$country&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;==&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;''&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$country&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;''&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$location&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;'&amp;lt;a&amp;nbsp;href=&quot;http://maps.google.com/?q='&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$zip&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;'&amp;nbsp;'&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$address&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;'&amp;nbsp;'&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$city&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;'&amp;nbsp;'&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$country&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;'&quot;&amp;nbsp;target=&quot;_blank&quot;&amp;gt;&amp;lt;img&amp;nbsp;src=&quot;'&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;XOOPS_URL&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;'/images/map.gif&quot;&amp;nbsp;border=&quot;0&quot;&amp;nbsp;align=&quot;absmiddle&quot;&amp;gt;&amp;lt;/a&amp;gt;'&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;}&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/code&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;A questo punto creiamoci una GIF dal nome &lt;strong&gt;map.gif&lt;/strong&gt; ed inseriamola in root/images/. Per esempio la mia gif è &lt;a href=&quot;http://www.stefanosilvestrini.com/lab/images/map.gif&quot; target=&quot;_blank&quot;&gt;questa&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;A questo punto il più è stato fatto.&lt;br /&gt;&lt;br /&gt;Ora ci rimane da utilizzare la suddetta funzione in ogni punto del sito che noi desideriamo. Qualora noi utilizzassimo moduli che visualizzano indirizzi o città noi dovremmo richiamare semplicemente la funzione in questo modo:&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;xoopsCode&quot;&gt;&lt;code&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;
&lt;span style=&quot;color: #0000BB&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;xoopsgmaps&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$zip&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$address&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$city&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$country&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/code&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;dove &lt;strong&gt;$zip, $address, $city, $country&lt;/strong&gt; sono le variabili che noi ricaviamo dalle varie query che generano la nostra pagina.&lt;br /&gt;&lt;br /&gt;Il risultato sarà una gif cliccabile che aprirà la pagina di GoogleMaps con il punto esatto del luogo.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://maps.google.com/?q=%20%20Verona%20Italia&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://www.stefanosilvestrini.com/lab/images/googlemaps.gif&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Spero che questa funzione sia utile.&lt;br /&gt;&lt;br /&gt;A presto... sly&lt;br /&gt;</description>
    </item>
</rdf:RDF>
