<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="ARTICLE @ XOOPS powered by FeedCreator" -->
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xml:lang="it">
    <title>Xoops Italia :: Articolo</title>
    <tagline>Articolo XML</tagline>
    <link rel="alternate" type="text/html" href="http://www.xoopsitalia.org/modules/article/view.article.php/70/c16"/>
    <id>http://www.xoopsitalia.org/modules/article/view.article.php/70/c16</id>
    <modified>2008-05-16T06:02:13+02:00</modified>
    <author>
        <name>defkon1 at gmail dot com</name>
    </author>
    <generator>ARTICLE @ XOOPS powered by FeedCreator</generator>
    <entry>
        <title>Semplice funzione per le Google Maps!</title>
        <link rel="alternate" type="text/html" href="http://www.xoopsitalia.org/modules/article/view.article.php/70/c16"/>
        <created>2008-04-06T12:34:11+02:00</created>
        <issued>2008-04-06T12:34:11+02:00</issued>
        <modified>2008-04-06T12:34:11+02:00</modified>
        <id>http://www.xoopsitalia.org/modules/article/view.article.php/70/c16</id>
        <author>
            <name>slyss</name>
        </author>
        <summary>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;</summary>
    </entry>
</feed>
