X-Git-Url: http://git.cyclocoop.org/?p=ptitvelo%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Fbase%2Ftrouver_table.php;fp=www%2Fecrire%2Fbase%2Ftrouver_table.php;h=7f42984504b3735973cd7f7b1e89986bc077bed5;hp=c181af07ce478a21f1dec6e6e632ffa7d0d1abe7;hb=d18fcb8f27a4016e3fa7b50a9b2255d529dca543;hpb=e847eea4a82a7396dd0abf860f9b30d654f38629 diff --git a/www/ecrire/base/trouver_table.php b/www/ecrire/base/trouver_table.php index c181af0..7f42984 100644 --- a/www/ecrire/base/trouver_table.php +++ b/www/ecrire/base/trouver_table.php @@ -103,7 +103,7 @@ function base_trouver_table_dist($nom, $serveur='', $table_spip = true){ // base sous SPIP: gerer les abreviations explicites des noms de table if ($connexion['spip_connect_version']) { - if (isset($table_des_tables[$nom])) { + if ($table_spip AND isset($table_des_tables[$nom])) { $nom = $table_des_tables[$nom]; $nom_sql = 'spip_' . $nom; } @@ -120,7 +120,7 @@ function base_trouver_table_dist($nom, $serveur='', $table_spip = true){ AND $desc_cache=unserialize($desc_cache)) $connexion['tables'] = $desc_cache; } - if (!isset($connexion['tables'][$nom_sql])) { + if ($table_spip AND !isset($connexion['tables'][$nom_sql])) { if (isset($tables_principales[$nom_sql])) $fdesc = $tables_principales[$nom_sql]; @@ -131,13 +131,11 @@ function base_trouver_table_dist($nom, $serveur='', $table_spip = true){ $nom_sql = 'spip_' . $nom; $fdesc = &$tables_principales[$nom_sql]; } - else { - if (isset($tables_auxiliaires[$n=$nom]) - OR isset($tables_auxiliaires[$n='spip_'.$nom])) { - $nom_sql = $n; - $fdesc = &$tables_auxiliaires[$n]; - } # table locale a cote de SPIP, comme non SPIP: - } + elseif (isset($tables_auxiliaires[$n=$nom]) + OR isset($tables_auxiliaires[$n='spip_'.$nom])) { + $nom_sql = $n; + $fdesc = &$tables_auxiliaires[$n]; + } # table locale a cote de SPIP, comme non SPIP: } if (!isset($connexion['tables'][$nom_sql])) { @@ -152,8 +150,9 @@ function base_trouver_table_dist($nom, $serveur='', $table_spip = true){ // on retombe sur la description donnee dans les fichiers spip $desc = $fdesc; } - else + else { $desc['exist'] = true; + } $desc['table'] = $desc['table_sql'] = $nom_sql; $desc['connexion']= $serveur;