bug fixes pour geodesix sur https et internet explorer : il faut aussi reprendre...
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 24 Jul 2006 22:05:47 +0000 (22:05 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 24 Jul 2006 22:05:47 +0000 (22:05 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/branches/platal-0.9.10@632 839d8a87-29fc-0310-9880-83ba4fa771e5

htdocs/geoloc/dynamap.php
htdocs/geoloc/geolocInit.php
htdocs/geoloc/getData.php
htdocs/geoloc/icon.php
htdocs/geoloc/index.php
plugins/function.display_address.php
templates/geoloc/getData.tpl
templates/geoloc/index.tpl

index b2925c4..971b12e 100644 (file)
@@ -24,21 +24,13 @@ require_once('xorg.inc.php');
 
 new_nonhtml_page('', AUTH_COOKIE);
 
-$querystring = "";
-foreach ($_GET as $v => $a)
-       if ($v != 'initfile')
-               $querystring .= '&'.urlencode($v).'='.urlencode($a);
-$initfile = urlencode('geolocInit.php?'.$querystring);
-
-if (urlencode(Env::get('initfile')) != $initfile)
-{
-       header("Location: dynamap.php?initfile=$initfile{$querystring}");
-       die();
-}
-
 header("Content-type: application/x-shockwave-flash");
 
-if ($globals->geoloc->use_map())
-       readfile($globals->geoloc->dynamap_path);
+if (1 || $globals->geoloc->use_map()) {
+    $s = file_get_contents($globals->geoloc->dynamap_path);
+    header("Content-length: ".strlen($s));
+    header("Pragma:");
+    echo $s;
+}
 
 ?>
index 6ecc2ca..c55992a 100644 (file)
@@ -3,6 +3,7 @@ require_once('xorg.inc.php');
 
 header("Content-type: text/xml");
 new_nonhtml_page('geoloc/geolocInit.tpl', AUTH_COOKIE);
+header("Pragma:");
 
 $querystring = "";
 foreach ($_GET as $v => $a)
index d358631..e1b7373 100644 (file)
@@ -28,7 +28,8 @@ if (Env::has('debug'))
 else
 {
        header("Content-type: text/xml");
-       new_nonhtml_page('geoloc/getData.tpl', AUTH_COOKIE);
+        new_nonhtml_page('geoloc/getData.tpl', AUTH_COOKIE);
+        header("Pragma:");
 }
 
 require_once('geoloc.inc.php');
index 07bd17c..fb75e0e 100644 (file)
@@ -25,6 +25,7 @@ require_once('xorg.inc.php');
 new_nonhtml_page('', AUTH_COOKIE);
 
 header("Content-type: application/x-shockwave-flash");
+header("Pragma:");
 
 if ($globals->geoloc->use_map())
        readfile($globals->geoloc->icon_path);
index 8f13d57..9a1b8d5 100644 (file)
 require_once('xorg.inc.php');
 new_skinned_page('geoloc/index.tpl', AUTH_COOKIE);
 
-$res = $globals->xdb->query('SELECT COUNT(DISTINCT uid) FROM adresses WHERE cityid IS NOT NULL');
-$page->assign('localises', $res->fetchOneCell());
-
-       require_once('search.inc.php');
+require_once('search.inc.php');
 $fields = new SFieldGroup(true, advancedSearchFromInput());
 $search = $fields->get_url();
-if (Env::has('only_current') && Env::get('only_current') != 'on') $search .= '&only_current=';
+if (!Env::has('only_current'))
+    $search .= '&only_current=on';
+elseif (Env::get('only_current') != 'on')
+    $search .= '&only_current=';
+// don't limit search to map
 $search = preg_replace('/(^|&amp;)mapid=([0-9]+)(&amp;|$)/','\1\3', $search);
-if ($search)
-       $page->assign('dynamap_vars', $search);
+
+if ($search) $search = '?'.$search;
+$initfile = urlencode('geolocInit.php'.$querystring);
+$page->assign('flashvars', 'initfile='.$initfile);
+
+$page->assign('protocole',substr($globals->baseurl, 0, strpos($globals->baseurl,':')));
+
+if (!$search) {
+    $res = $globals->xdb->query('SELECT COUNT(DISTINCT uid) FROM adresses WHERE cityid IS NOT NULL');
+    $page->assign('localises', $res->fetchOneCell());
+}
 
 $page->assign('use_map', $globals->geoloc->use_map());
 $page->run();
index 1a12d4b..713d5f9 100644 (file)
@@ -31,7 +31,7 @@ function smarty_function_display_address($param, &$smarty) {
 
     $lines = explode("\n",$txtad);
     $txthtml = "";
-    $map = "<a href=\"http://maps.google.com/?q=".urlencode(implode(", ", $lines))."\"><img src=\"".smarty_function_rel()."/images/loupe.gif\" alt=\"Carte\" title=\"Carte\"/></a>";
+    $map = "<a href=\"http://maps.google.fr/?q=".urlencode(implode(", ", $lines))."\"><img src=\"".smarty_function_rel()."/images/loupe.gif\" alt=\"Carte\" title=\"Carte\"/></a>";
     if ($param['titre'])
     {
         if ($param['titre_div'])
index 81a1918..d884cd3 100644 (file)
@@ -29,7 +29,7 @@
       </file>\r
       {if $country.nbPop > 0 or $country.id eq 0}\r
       <map x="{$country.x}" y="{$country.y}" height="{$country.height}" width="{$country.width}" ratio="{$country.rat}"/>\r
-      <icon x="{$country.xPop}" y="{$country.yPop}" nb="{$country.nbPop}" size="{$country.rad}" name="{$country.name|utf8_encode}" yellow="{$country.yellow}"/>\r
+      <icon x="{$country.xPop}" y="{$country.yPop}" nb="{$country.nbPop}" size="{$country.rad}" name="{$country.name|utf8_encode}" green="{if $country.nbPop}{$country.yellow/$country.nbPop}{else}0{/if}" blue="0" alpha="0.7"/>\r
       <moreinfos url="getData.php?{$searchvars}mapid={$country.id}"/>\r
       {/if}\r
     </country>\r
@@ -38,7 +38,7 @@
   <cities>\r
     {foreach from=$cities item="city"}\r
     <city id="{$city.id}" name="{$city.name}">\r
-      <icon x="{$city.x}" y="{$city.y}" nb="{$city.pop}" size="{$city.size}" name="{$city.name}" yellow="{$city.yellow}"/>\r
+      <icon x="{$city.x}" y="{$city.y}" nb="{$city.pop}" size="{$city.size}" name="{$city.name}" green="{if $city.pop}{$city.yellow/$city.pop}{else}0{/if}" blue="0"/>\r
       <moreinfos url="getCityInfos.php?{$searchvars}cityid={$city.id}"/>\r
     </city>\r
     {/foreach}\r
index 00a10c4..cd04939 100644 (file)
@@ -57,20 +57,28 @@ function searchMapId(f)
 {/if}
 
 </script>
-{if !$dynamap_vars and $localises}
+{if $localises}
   <p class="descr">
     Aujourd'hui {$localises} de nos camarades sont localisés grâce à leurs adresses personnelles.
   </p>
 {/if}
 {if $use_map}
   <p class="center">
-    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="600" height="450" id="dynamap" align="middle">
-    <param name="allowScriptAccess" value="sameDomain" />
-    <param name="quality" value="high" />
-    <param name="bgcolor" value="#ffffff" />
-    <param name="movie" value="dynamap{if $dynamap_vars neq 'none'}_{$dynamap_vars|default:"only_current=on"}{/if}.swf" />
-    <embed src="dynamap{if $dynamap_vars neq 'none'}_{$dynamap_vars|default:"only_current=on"}{/if}.swf" quality="high" bgcolor="#ffffff" width="600" height="450" name="dynamap" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
-    </object>
+<embed
+      src="dynamap.swf"
+      quality="high"
+      bgcolor="#ffffff"
+      width="600"
+      height="450"
+      name="dynamap"
+      id="dynamap"
+      align="middle"
+      flashvars="{$flashvars}"
+      type="application/x-shockwave-flash"
+      menu="false"
+      wmode="opaque"
+      salign="tl"
+      pluginspage="{$protocole}://www.macromedia.com/go/getflashplayer" />
   </p>
   <p class="smaller">Carte fournie gracieusement par <a href="http://www.geodesix.com/">Geodesix</a>.</p>
   {if !$no_annu}