Typo and charset fixes
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sun, 1 Apr 2007 16:26:04 +0000 (16:26 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sun, 1 Apr 2007 16:26:04 +0000 (16:26 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1646 839d8a87-29fc-0310-9880-83ba4fa771e5

templates/geoloc/city.tpl
templates/geoloc/country.tpl
templates/geoloc/init.tpl
templates/search/quick.tpl
upgrade/0.9.14/geoloc.utf8.php

index 0636647..de51c16 100644 (file)
@@ -22,6 +22,6 @@
 <city id="{$smarty.request.cityid}">\r
   {assign var="beginning" value=true}\r
   {assign var="nb_displayed" value=0}\r
-  {iterate from=$users item="user"}{if !$beginning}<br/>{/if}{if $nb_displayed < 10}<a href="javascript:ficheXorg('{$user.alias}');">{$user.prenom|utf8_encode} {$user.nom|strtolower|ucwords|utf8_encode} - {$user.promo}</a>{else}<a href="javascript:clickOnCity({$smarty.request.cityid})">...</a>{/if}{assign var="nb_displayed" value=$nb_displayed+1}{assign var="beginning" value=false}{/iterate}\r
+  {iterate from=$users item="user"}{if !$beginning}<br/>{/if}{if $nb_displayed < 10}<a href="javascript:ficheXorg('{$user.alias}');">{$user.prenom} {$user.nom|strtolower|ucwords} - {$user.promo}</a>{else}<a href="javascript:clickOnCity({$smarty.request.cityid})">...</a>{/if}{assign var="nb_displayed" value=$nb_displayed+1}{assign var="beginning" value=false}{/iterate}\r
 </city>\r
 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}\r
index 4aa9c2d..1201862 100644 (file)
 <country id="{$smarty.request.mapid}">\r
   <countries>\r
     {foreach from=$countries item="country"}\r
-    <country id="{$country.id}" name="{$country.name|utf8_encode}">\r
+    <country id="{$country.id}" name="{$country.name}">\r
       <file swf="{$country.swf}" scale="{$country.scale}" xclip="{$country.xclip}" yclip="{$country.yclip}">\r
         <color value="{$country.color}"/>\r
       </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}" green="{if $country.nbPop}{$country.yellow/$country.nbPop}{else}0{/if}" blue="0" alpha="0.7"/>\r
+      <icon x="{$country.xPop}" y="{$country.yPop}" nb="{$country.nbPop}" size="{$country.rad}" name="{$country.name}" green="{if $country.nbPop}{$country.yellow/$country.nbPop}{else}0{/if}" blue="0" alpha="0.7"/>\r
       <moreinfos url="country?{$searchvars}mapid={$country.id}"/>\r
       {/if}\r
     </country>\r
index 78d1336..7cb6d85 100644 (file)
@@ -1,50 +1,50 @@
-{**************************************************************************}\r
-{*                                                                        *}\r
-{*  Copyright (C) 2003-2007 Polytechnique.org                             *}\r
-{*  http://opensource.polytechnique.org/                                  *}\r
-{*                                                                        *}\r
-{*  This program is free software; you can redistribute it and/or modify  *}\r
-{*  it under the terms of the GNU General Public License as published by  *}\r
-{*  the Free Software Foundation; either version 2 of the License, or     *}\r
-{*  (at your option) any later version.                                   *}\r
-{*                                                                        *}\r
-{*  This program is distributed in the hope that it will be useful,       *}\r
-{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}\r
-{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}\r
-{*  GNU General Public License for more details.                          *}\r
-{*                                                                        *}\r
-{*  You should have received a copy of the GNU General Public License     *}\r
-{*  along with this program; if not, write to the Free Software           *}\r
-{*  Foundation, Inc.,                                                     *}\r
-{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}\r
-{*                                                                        *}\r
-{**************************************************************************}\r
-<config\r
-grandOncleVisibility="-1"\r
-tooltipSize="0"\r
-tooltipDX="0"\r
-tooltipDY="20"\r
-panelSize="28"\r
-citySize="6"\r
-radius100="1.6"\r
-radius0="3"\r
-select="aim"\r
-aimTween="5"\r
-transition="2"\r
-textLookInCity="Rechercher les x dans cette ville"\r
-textZoomIn="Zoom"\r
-textGoTo="Va Ã\83  "\r
-textZoomBackTo="Revient Ã\83  "\r
-textLoading="Chargement"\r
-textYouAreIn="Tu es dans "\r
-textSeeMapOfCity="Voir la carte de "\r
-textYouHaveSelected="Tu as sÃ\83©lectionnÃ\83© "\r
-{if $background}\r
-background="{$background}"\r
-zoomBarBackgroundColor="{$background}"\r
-{/if} \r
-textCopyright="Les rÃ\83Å¡gles de l'annuaire s'appliquent aussi Ã\83  cette application"\r
-autofolder="true"\r
-iconSwf="icon.swf"\r
-scriptInfosArea="country?{$querystring}"/>\r
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+<config
+grandOncleVisibility="-1"
+tooltipSize="0"
+tooltipDX="0"
+tooltipDY="20"
+panelSize="28"
+citySize="6"
+radius100="1.6"
+radius0="3"
+select="aim"
+aimTween="5"
+transition="2"
+textLookInCity="Rechercher les x dans cette ville"
+textZoomIn="Zoom"
+textGoTo="Va Ã  "
+textZoomBackTo="Revient Ã  "
+textLoading="Chargement"
+textYouAreIn="Tu es dans "
+textSeeMapOfCity="Voir la carte de "
+textYouHaveSelected="Tu as sélectionné "
+{if $background}
+background="{$background}"
+zoomBarBackgroundColor="{$background}"
+{/if} 
+textCopyright="Les règles de l'annuaire s'appliquent aussi Ã  cette application"
+autofolder="true"
+iconSwf="icon.swf"
+scriptInfosArea="country?{$querystring}"/>
 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index 15a9e61..13a4b02 100644 (file)
@@ -94,7 +94,7 @@ notre base de données.
 <div id="searchbar" style="display: none">
 <h2>Barre de recherche pour ton navigateur</h2>
 <p>
-  Si tu utilises un navigateur moderne tel que Firefox ou Internet Explore 7, tu peux ajouter un module de recherche
+  Si tu utilises un navigateur moderne tel que Firefox ou Internet Explorer 7, tu peux ajouter un module de recherche
   directement dans ton navigateur. Pour ceci, <a href="javascript:addSearchEngine()">installe</a> la barre de recherche
   rapide.
 </p>
index 32d07cd..2c772f4 100755 (executable)
@@ -5,13 +5,12 @@ global $globals;
 require_once 'connect.db.inc.php';
 $globals->dbcharset = 'latin1';
 
-function is_utf8($s)
-{
-    return @iconv('utf-8', 'utf-8', $s) == $s;
-}
-
-$tables = array ('city', 'city_in_maps', 'maps', 'pays', 'region');
-foreach ($tables as $table) {
+$tables = array ('city' => array('id', 'alias'),
+                 'city_in_maps' => array('city_id', 'map_id', 'infos'),
+                 'maps' => array('map_id'),
+                 'pays' => array('a2'),
+                 'region' => array('a2', 'region'));
+foreach ($tables as $table => $keys) {
     $res = XDB::query("SELECT * FROM geoloc_$table");
     if (!$res) {
         echo "$table\n";
@@ -22,10 +21,12 @@ foreach ($tables as $table) {
         $from = array();
         $to   = array();
         foreach ($array as $key=>$value) {
-            $from[] = $key . '="' . XDB::escape($value) . '"';
+            if (in_array($key, $keys)) {
+                $from[] = $key . '=' . XDB::escape($value);
+            }
             $valued = utf8_decode($value);
             if (is_utf8($value) && $valued != $value) {
-                $to[] = $key . '="' . XDB::escape($valued) .'"';
+                $to[] = $key . '=' . XDB::escape($valued);
             }
         }
         if (!empty($to)) {
@@ -34,6 +35,8 @@ foreach ($tables as $table) {
             $sql = "UPDATE geoloc_$table SET $to WHERE $from";
             if (!XDB::execute($sql)) {
                 echo "Echec : $sql\n";
+            } elseif (XDB::affectedRows() == 0) {
+                echo "$sql\n";
             }
         }
     }