diff --git a/ecrire/config-fonctions.php3 b/ecrire/config-fonctions.php3 index d195652c01f5b52598de8b4ffba508e1b6ee2306..63a9324e56b6926a07ba754be7228e30c8756c6f 100644 --- a/ecrire/config-fonctions.php3 +++ b/ecrire/config-fonctions.php3 @@ -90,17 +90,13 @@ else { // mettre a jour les formats graphiques lisibles switch (lire_meta('image_process')) { case 'gd1': - $formats_graphiques = lire_meta('gd_formats'); - break; case 'gd2': - $formats_graphiques = lire_meta('gd_formats'); + $formats_graphiques = lire_meta('gd_formats_read'); break; case 'netpbm': $formats_graphiques = lire_meta('netpbm_formats'); break; case 'convert': - $formats_graphiques = 'gif,jpg,png'; - break; case 'imagick': $formats_graphiques = 'gif,jpg,png'; break; diff --git a/ecrire/inc_getdocument.php3 b/ecrire/inc_getdocument.php3 index 7c7e3ccb322f951e4cb069d16e249c999711216d..0f7b97df475840705a0d9012cb78a9613115d7e1 100644 --- a/ecrire/inc_getdocument.php3 +++ b/ecrire/inc_getdocument.php3 @@ -427,12 +427,25 @@ function effacer_logo($nom) { // Tester nos capacites function tester_vignette ($test_vignette) { global $pnmscale_command; + // verifier les formats acceptes par GD if ($test_vignette == "gd1") { // Si GD est installe et php >= 4.0.2 if (function_exists('imagetypes')) { - if (imagetypes() & IMG_GIF) + + if (imagetypes() & IMG_GIF & 0) { $gd_formats[] = "gif"; + } else { + # Attention GD sait lire le gif mais pas forcement l'ecrire + if (function_exists('ImageCreateFromGIF')) { + $srcImage = @ImageCreateFromGIF(_DIR_IMG . "test.gif"); + if ($srcImage) { + $gd_formats_read_gif = ",gif"; + ImageDestroy( $srcImage ); + } + } + } + if (imagetypes() & IMG_JPG) $gd_formats[] = "jpg"; if (imagetypes() & IMG_PNG) @@ -469,6 +482,7 @@ function tester_vignette ($test_vignette) { } if ($gd_formats) $gd_formats = join(",", $gd_formats); + ecrire_meta("gd_formats_read", $gd_formats.$gd_formats_read_gif); ecrire_meta("gd_formats", $gd_formats); ecrire_metas(); } diff --git a/ecrire/inc_version.php3 b/ecrire/inc_version.php3 index b8af448c003c3dc5b740e598ee68fb3b485b8ac8..4283ff48328cfe4eb4905bd906e805d8aee359fe 100644 --- a/ecrire/inc_version.php3 +++ b/ecrire/inc_version.php3 @@ -28,7 +28,7 @@ define('_FILE_CONNECT', $included_files = array(); function include_local($file) { - if ($GLOBALS['included_files'][$file]++) return; + if (@$GLOBALS['included_files'][$file]++) return; include($file); } @@ -36,19 +36,19 @@ function include_ecrire($file) { # Hack pour etre compatible avec les mes_options qui appellent cette fonction define_once('_DIR_INCLUDE', _DIR_RESTREINT); $file = _DIR_INCLUDE . $file; - if ($GLOBALS['included_files'][$file]++) return; + if (@$GLOBALS['included_files'][$file]++) return; include($file); } function include_lang($file) { $file = _DIR_LANG . $file; - if ($GLOBALS['included_files'][$file]++) return; + if (@$GLOBALS['included_files'][$file]++) return; include($file); } function include_plug($file) { $file = _DIR_RESTREINT . $file; - if ($GLOBALS['included_files'][$file]++) return; + if (@$GLOBALS['included_files'][$file]++) return; if (file_exists($file)) include($file); } @@ -1094,6 +1094,8 @@ function redirige_par_entete($url) { } function debut_entete($title, $entete='') { + global $flag_preserver; + if (!$entete) { if (!$charset = lire_meta('charset')) $charset = 'utf-8'; $entete = "Content-Type: text/html; charset=$charset"; diff --git a/ecrire/statistiques_lang.php3 b/ecrire/statistiques_lang.php3 index 626b5629e698afafcd8582a3e500d0c4376168d5..ced2cc57709394e2887fb62ffa9aca125dfd85f3 100644 --- a/ecrire/statistiques_lang.php3 +++ b/ecrire/statistiques_lang.php3 @@ -42,47 +42,12 @@ if ($connect_statut != '0minirezo') { } // -// Statistiques sur le site +// Statistiques par langue // -function enfants($id_parent){ - global $nombre_vis; - global $total_vis; - global $nombre_abs; - global $critere; - - $query = "SELECT id_rubrique FROM spip_rubriques WHERE id_parent='$id_parent'"; - $result = spip_query($query); - $nombre = 0; - - while($row = spip_fetch_array($result)) { - $id_rubrique = $row['id_rubrique']; - - $query2 = "SELECT SUM(".$critere.") AS cnt FROM spip_articles WHERE id_rubrique='$id_rubrique'"; - $result2 = spip_query($query2); - $visites = 0; - if ($row2 = spip_fetch_array($result2)) { - $visites = $row2['cnt']; - } - $nombre_abs[$id_rubrique] = $visites; - $nombre_vis[$id_rubrique] = $visites; - $nombre += $visites; - $nombre += enfants($id_rubrique); - } - $nombre_vis[$id_parent] += $nombre; - return $nombre; -} - - - - - -if ($total_vis<1) $total_vis=1; - debut_cadre_enfonce("langues-24.gif"); - $query = "SELECT SUM(".$critere.") AS total_visites FROM spip_articles"; $result = spip_query($query); $visites = 1; @@ -103,7 +68,8 @@ debut_cadre_enfonce("langues-24.gif"); while ($row = spip_fetch_array($result)) { $lang = $row['lang']; $visites = round($row['cnt'] / $total_visites * $taille); - + $pourcent = round($row['cnt'] / $total_visites * 100); + if ($visites > 0) { if ($ifond==0){ @@ -116,7 +82,7 @@ debut_cadre_enfonce("langues-24.gif"); echo "<tr bgcolor='$couleur'>"; $dir=lang_dir($lang,'',' dir=rtl'); - echo "<td width='100%' style='border-bottom: 1px solid #cccccc;'><span class='verdana2'$dir><div style='float: $spip_lang_right;'>$visites%</div>".traduire_nom_langue($lang)."</span></td>"; + echo "<td width='100%' style='border-bottom: 1px solid #cccccc;'><span class='verdana2'$dir><div style='float: $spip_lang_right;'>$pourcent%</div>".traduire_nom_langue($lang)."</span></td>"; echo "<td style='border-bottom: 1px solid #cccccc;'>"; echo "<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH='".($taille+5)."' HEIGHT=8>"; diff --git a/htaccess-html.txt b/htaccess-html.txt index 82215ac1b70f51baafa6dd19d22e30dd5887cecf..40aace35870953eb554654ea1191d78b6468cfb1 100644 --- a/htaccess-html.txt +++ b/htaccess-html.txt @@ -1,7 +1,7 @@ ########################################################### # Fichier .htaccess pour les URLs 'html' ; a installer # # si vous reglez $type_urls='html' # -# dans ecrire/mes_options.php3 ou dans mes_fonctions.php3 # +# dans ecrire/mes_options.php3 # # (fichier associe : inc-urls-html.php3) # ########################################################### diff --git a/htaccess-propres.txt b/htaccess-propres.txt index 4c19051e204e69dc926a3079af969454a6b46507..033419b5186b2f019a5f638dc1363b5855e55dbf 100644 --- a/htaccess-propres.txt +++ b/htaccess-propres.txt @@ -1,7 +1,7 @@ ########################################################### # Fichier .htaccess pour les URLs propres ; a installer # -# si vous reglez $type_urls='propre' # -# dans ecrire/mes_options.php3 ou dans mes_fonctions.php3 # +# si vous reglez $type_urls='propres' # +# dans ecrire/mes_options.php3 # # (fichier associe : inc-urls-propres.php3) # ###########################################################