diff --git a/ecrire/inc.php3 b/ecrire/inc.php3 index 9f689bd87b846676698f1e1bc4d0158f48371e0b..36662c0225d95ef451e0f3ba1a8b7edbfefcd601 100644 --- a/ecrire/inc.php3 +++ b/ecrire/inc.php3 @@ -7,19 +7,19 @@ if (!file_exists("inc_connect.php3")) { include ("inc_version.php3"); -include_local ("inc_connect.php3"); -include_local ("inc_meta.php3"); -include_local ("inc_auth.php3"); - -include_local ("inc_presentation.php3"); -include_local ("inc_texte.php3"); -include_local ("inc_filtres.php3"); -include_local ("inc_urls.php3"); -include_local ("inc_mail.php3"); -include_local ("inc_admin.php3"); -include_local ("inc_layer.php3"); -include_local ("inc_sites.php3"); -include_local ("inc_index.php3"); +include_ecrire("inc_connect.php3"); +include_ecrire("inc_meta.php3"); +include_ecrire("inc_auth.php3"); + +include_ecrire("inc_presentation.php3"); +include_ecrire("inc_texte.php3"); +include_ecrire("inc_filtres.php3"); +include_ecrire("inc_urls.php3"); +include_ecrire("inc_mail.php3"); +include_ecrire("inc_admin.php3"); +include_ecrire("inc_layer.php3"); +include_ecrire("inc_sites.php3"); +include_ecrire("inc_index.php3"); if (!file_exists("inc_meta_cache.php3")) ecrire_metas(); diff --git a/ecrire/inc_auth.php3 b/ecrire/inc_auth.php3 index 46a70ef035a7d25e01eccaf3158e213a95736774..48df746d70186a5775a7f226d1746209c7fc25eb 100644 --- a/ecrire/inc_auth.php3 +++ b/ecrire/inc_auth.php3 @@ -5,7 +5,6 @@ if (defined("_ECRIRE_INC_AUTH")) return; define("_ECRIRE_INC_AUTH", "1"); - function ask_php_auth($text_failure) { @Header("WWW-Authenticate: Basic realm=\"administrateur\""); @Header("HTTP/1.0 401 Unauthorized"); diff --git a/ecrire/inc_base.php3 b/ecrire/inc_base.php3 index 8e9f5e122a68e30300a5b7937965fd2c26cdce9d..943e6775b9692322583e269bcb91a51e753a90d6 100644 --- a/ecrire/inc_base.php3 +++ b/ecrire/inc_base.php3 @@ -298,11 +298,6 @@ function creer_base() { KEY id_mot (id_mot), KEY id_syndic (id_syndic))"; $result = mysql_query($query); -/* $query = "CREATE TABLE spip_mots_forum ( - id_mot bigint(21) DEFAULT '0' NOT NULL, id_forum bigint(21) DEFAULT '0' NOT NULL, - KEY id_mot (id_mot), KEY id_forum (id_forum))"; - $result = mysql_query($query);*/ - // // Gestion du site @@ -380,8 +375,29 @@ function creer_base() { "(3, 'gif', 'Image GIF', 'image')"; mysql_query($query); - $query = "INSERT IGNORE spip_types_documents (extension) VALUES ". - "('txt'), ('htm'), ('html'), ('pdf'), ('mp3'), ('mpg'), ('wav'), ('mid'), ('ra'), ('ram'), ('mov'), ('asf'), ('avi'), ('qt'), ('swf')"; + $query = "INSERT IGNORE spip_types_documents (extension, titre) VALUES ". + "('txt', 'Document texte'), ". + "('htm', 'Fichier HTML'), ". + "('html', 'Fichier HTML'), ". + "('pdf', 'Document PDF'), ". + "('mp3', 'Fichier sonore MP3'), ". + "('wav', 'Fichier sonore WAV'), ". + "('mid', 'Musique au format Midi'), ". + "('mpg', 'Video MPEG'), ". + "('ra', 'Fichier RealAudio'), ". + "('ram', 'Fichier RealAudio'), ". + "('rm', 'Fichier RealAudio'), ". + "('mov', 'Video QuickTime'), ". + "('qt', 'Video QuickTime'), ". + "('asf', 'Video Windows'), ". + "('avi', 'Video Windows'), ". + "('doc', 'Document Word'), ". + "('xls', 'Document Excel'), ". + "('ppt', 'Document PowerPoint'), ". + "('zip', 'Archive Zip'), ". + "('gz', 'Archive GZ'), ". + "('tgz', 'Archive TGZ'), ". + "('swf', 'Animation Flash')"; mysql_query($query); } diff --git a/ecrire/inc_objet.php3 b/ecrire/inc_objet.php3 new file mode 100644 index 0000000000000000000000000000000000000000..88ed4b50317815b95aac2ae3f06989907d3035de --- /dev/null +++ b/ecrire/inc_objet.php3 @@ -0,0 +1,134 @@ +<?php + +include_ecrire('inc_objet_base.php3'); + + +// +// --- Creation de classe concrete ---- +// +// Il faut creer deux classes : +// - une pour la factory +// - une pour le descripteur d'objet +// +// Le descripteur d'objet doit declarer le constructeur, qui peut +// etre laisse vide. +// +// La factory doit declarer 1) le constructeur, qui regle normalement +// le nom des champs, de la table sql, et du descripteur d'objet ; +// ainsi que 2) la methode new_object, qui prend le $id d'un objet en +// argument et initialise les champs du nouvel objet selon la +// semantique choisie pour icelui. +// +// Ensuite il faut instancier et enregistrer la factory et fournir +// une fonction globale d'appel d'objet. Le plus simple est de +// recopier la fonction fournie et de changer les noms. +// + +// -------------------------------------------------------------------- + +// +// Factory d'articles +// + +class ArticleFactory extends _ObjectFactory { + // Initialiser les variables de classe + function ArticleFactory() { + $this->fast_vars_list = array('id_article', 'id_rubrique', 'id_secteur', 'titre', 'surtitre', + 'soustitre', 'descriptif', 'date', 'date_redac', 'visites', 'referers', 'statut'); + $this->slow_vars_list = array('chapo', 'texte', 'ps'); + $this->sql_table = 'spip_articles'; + $this->object_class = 'Article'; + } + + // Initialiser les variables d'objet + function new_object($id) { + $this->set_object_field($id, 'titre', 'Nouvel article'); + $this->set_object_field($id, 'statut', 'poubelle'); + } +} + +class Article extends _Object { + // Ne rien faire + function Article() { + } +} + +add_factory('article'); // Retourne 'article_factory' + +function fetch_article($critere, $fast = true) { + return $GLOBALS['article_factory']->fetch_object($critere, $fast); +} + + +// -------------------------------------------------------------------- + +// +// Factory de breves +// + +class BreveFactory extends _ObjectFactory { + // Initialiser les variables de classe + function BreveFactory() { + $this->fast_vars_list = array('id_breve', 'id_rubrique', 'titre', + 'lien_titre', 'lien_url', 'date_heure', 'statut'); + $this->slow_vars_list = array('texte'); + $this->sql_table = 'spip_breves'; + $this->object_class = 'Breve'; + } + + // Initialiser les variables d'objet + function new_object($id) { + $this->set_object_field($id, 'titre', 'Nouvelle breve'); + $this->set_object_field($id, 'statut', 'refuse'); + } +} + +class Breve extends _Object { + // Ne rien faire + function Breve() { + } +} + +add_factory('breve'); // Retourne 'article_factory' + +function fetch_breve($critere, $fast = true) { + return $GLOBALS['breve_factory']->fetch_object($critere, $fast); +} + + +// -------------------------------------------------------------------- + +// +// Factory de documents +// + +class DocumentFactory extends _ObjectFactory { + // Initialiser les variables de classe + function DocumentFactory() { + $this->fast_vars_list = array('id_document', 'id_vignette', 'id_type', + 'titre', 'descriptif', 'fichier', 'largeur', 'hauteur', 'mode'); + $this->slow_vars_list = ''; + $this->sql_table = 'spip_documents'; + $this->object_class = 'Document'; + } + + // Initialiser les variables d'objet + function new_object($id) { + $this->set_object_field($id, 'titre', 'nouveau document'); + } +} + +class Document extends _Object { + // Ne rien faire + function Document() { + } +} + +add_factory('document'); // Retourne 'article_factory' + +function fetch_document($critere, $fast = true) { + return $GLOBALS['document_factory']->fetch_object($critere, $fast); +} + + +?> \ No newline at end of file diff --git a/ecrire/inc_objet_base.php3 b/ecrire/inc_objet_base.php3 new file mode 100644 index 0000000000000000000000000000000000000000..15c1ec0a88b231f898a5cc967e187e730ac4ee11 --- /dev/null +++ b/ecrire/inc_objet_base.php3 @@ -0,0 +1,315 @@ +<?php + +// +// Ce fichier ne sera execute qu'une fois +if (defined("_ECRIRE_INC_OBJET")) return; +define("_ECRIRE_INC_OBJET", "1"); + + +class _Abstract { + function abstract_error($str) { + die ("<h4>".$str."\n Veuillez contacter un developpeur.</h4>"); + } + function abstract() { + $this->abstract_error("Erreur de programmation. Cette fonction ne doit pas etre appelee dans ce contexte."); + } + function _Abstract() { $this->abstract(); } +} + + +class ObjectCacheInstance extends _Abstract { + // Variable values (array) + var $fast_vars; + var $slow_vars; + + // Variable status + var $fast_vars_loaded = false; + var $slow_vars_loaded = false; + + // Is modified ? + var $dirty = false; + + function ObjectCacheInstance() { + $this->fast_vars = array(); + $this->slow_vars = array(); + } +} + + +class _ObjectFactory extends _Abstract { + // Factory ID + var $id_factory; + + // Object class name (for instantiation) + var $object_class; + + // SQL table name/pattern + var $sql_table; + var $sql_id; + + // Plain array + var $fast_vars_list, $nb_fast_vars; + var $slow_vars_list, $nb_slow_vars; + + // Associative array + var $fast_vars_array; + var $slow_vars_array; + + // SQL field names + var $fast_vars_sql; + var $slow_vars_sql; + + // Object cache + var $cache; + + // --------------------------------------------------------- + + // + // Init factory helper variables and constants + // + function init_factory($id_factory) { + $this->id_factory = $id_factory; + + // Store different representations of fast vars + if (is_array($this->fast_vars_list)) { + reset($this->fast_vars_list); + while (list($key, $val) = each($this->fast_vars_list)) { + $this->fast_vars_array[$val] = $val; + $this->fast_vars_sql[] = $this->sql_table.'.'.$val; + } + $this->fast_vars_sql = join(', ', $this->fast_vars_sql); + $this->nb_fast_vars = count($this->fast_vars_list); + } + else $this->nb_fast_vars = 0; + + // Store different representations of slow vars + if (is_array($this->slow_vars_list)) { + reset($this->slow_vars_list); + while (list($key, $val) = each($this->slow_vars_list)) { + $this->slow_vars_array[$val] = $val; + $this->slow_vars_sql[] = $this->sql_table.'.'.$val; + } + $this->slow_vars_sql = join(', ', $this->slow_vars_sql); + $this->nb_slow_vars = count($this->slow_vars_list); + } + else $this->nb_slow_vars = 0; + + // Default value for object id in database + if (!$this->sql_id) { + $this->sql_id = 'id_'.strtolower($this->object_class); + } + } + + + // + // Object management methods + // + + function new_object($id) { $this->abstract(); } + + function create_object_cache_instance($id) { + if (!($g = $this->cache[$id])) { + $g = '_'.$this->object_class.'_'.$id; + $GLOBALS[$g] = new ObjectCacheInstance; + $this->cache[$id] = $g; + } + return $g; + } + + // Create a new alias for an object + // (aliases are the only way by which user code sees an object) + function create_object_alias($id) { + $class = $this->object_class; + $alias = new $class; + $alias->init_object($this->id_factory, $id); + return $alias; + } + + // Get field of an object (by ID) + function get_object_field($id, $name) { + $g = $this->cache[$id]; + if ($v = $this->fast_vars_array[$name]) { + if (!$GLOBALS[$g]->fast_vars_loaded) + $this->load_object_id($id, true); + return $GLOBALS[$g]->fast_vars[$v]; + } + else if ($v = $this->slow_vars_array[$name]) { + if (!$GLOBALS[$g]->slow_vars_loaded) + $this->load_object_id($id, false); + return $GLOBALS[$g]->slow_vars[$v]; + } + else { + $this->abstract_error("Nom de champ incorrect $name pour objet de type ".$this->object_class); + } + } + + // Set field of an object (by ID) + function set_object_field($id, $name, $value) { + $g = $this->cache[$id]; + if ($v = $this->fast_vars_array[$name]) { + if (!$GLOBALS[$g]->fast_vars_loaded) + $this->load_object_id($id, true); + $GLOBALS[$g]->fast_vars[$v] = $value; + $GLOBALS[$g]->dirty = true; + } + else if ($v = $this->slow_vars_array[$name]) { + if (!$GLOBALS[$g]->slow_vars_loaded) + $this->load_object_id($id, false); + $GLOBALS[$g]->slow_vars[$v] = $value; + $GLOBALS[$g]->dirty = true; + } + else { + $this->abstract_error("Nom de champ incorrect $name pour objet de type ".$this->object_class); + } + } + + + // + // Load object by SQL query + // + function load_object_sql($query, $fast, $multiple = false) { + $cols = $this->fast_vars_sql; + if (!$fast && $this->slow_vars_sql) { + if ($cols) $cols .= ', '; + $cols .= $this->slow_vars_sql; + } + // Replace generic names by actual ones + $query = ereg_replace('#cols', $cols, $query); + $query = ereg_replace('#table', $this->sql_table, $query); + $query = ereg_replace('#id', $this->sql_table.'.'.$this->sql_id, $query); + $result = mysql_query($query); + echo " >>> $query\n"; + // If multiple results expected, create a result array + if ($multiple) $r = array(); + if ($result) while ($row = mysql_fetch_array($result)) { + $id = $row[$this->sql_id]; + $g = $this->create_object_cache_instance($id); + // Read fast vars + for ($i = 0; $i < $this->nb_fast_vars; $i++) { + $var = $this->fast_vars_list[$i]; + $GLOBALS[$g]->fast_vars[$var] = $row[$var]; + } + $GLOBALS[$g]->fast_vars_loaded = true; + if (!$fast) { + // Read slow vars + for ($i = 0; $i < $this->nb_slow_vars; $i++) { + $var = $this->slow_vars_list[$i]; + $GLOBALS[$g]->slow_vars[$var] = $row[$var]; + } + $GLOBALS[$g]->slow_vars_loaded = true; + } + if ($multiple) $r[$id] = $id; + else break; + } + if ($multiple) return $r; + } + + // + // Load object by ID + // + function load_object_id($id, $fast = true) { + $query = "SELECT #cols FROM #table WHERE #id=$id"; + $this->load_object_sql($query, $fast); + } + + // + // Fetch object only if not in cache + // + function fetch_object_id($id, $fast = true) { + if ($g = $this->cache[$id]) { + if (!$GLOBALS[$g]->dirty) return; + } + else { + $g = $this->create_object_cache_instance($id); + } + $this->load_object_id($id, $fast); + } + + // + // Create new object + // + function create_object() { + static $new_id = 0; + $id = 'new_'.(++$new_id); + $g = $this->create_object_cache_instance($id); + $GLOBALS[$g]->dirty = true; + $GLOBALS[$g]->fast_vars_loaded = true; + $GLOBALS[$g]->slow_vars_loaded = true; + $this->new_object($id); + return $id; + } + + // + // Main load function : fetch object by generic criterium + // + function fetch_object($critere, $fast = true) { + if ($critere == 'new') { + // create object + $id = $this->create_object(); + } + else if ($critere > 0) { + // get object by id + $id = intval($critere); + $this->fetch_object_id($id, $fast); + } + else { + // get object list by sql + return $this->load_object_sql($critere, $fast, true); + } + return $this->create_object_alias($id); + } + + // + // Main save function : update object by ID + // + function update_object($id) { + $g = $this->cache[$id]; + if ($GLOBALS[$g]->dirty) { + // generate INSERT query (penser au addslashes) + } + } +} + + +class _Object extends _Abstract { + // Factory ID + var $id_factory; + + // Object ID + var $id = 0; + + function init_object($id_factory, $id = 0) { + $this->id_factory = $id_factory; + if ($id) $this->id = $id; + } + + function get($var) { + return $GLOBALS[$this->id_factory]->get_object_field($this->id, $var); + } + + function set($var, $value) { + return $GLOBALS[$this->id_factory]->set_object_field($this->id, $var, $value); + } + + function commit() { + return $GLOBALS[$this->id_factory]->update_object($this->id); + } +} + + +// +// Create a factory of a given type, and register it +// + +function add_factory($type) { + global $factories; + $class = ucfirst($type).'Factory'; + $id_factory = $type.'_factory'; + $GLOBALS[$id_factory] = new $class; + $GLOBALS[$id_factory]->init_factory($id_factory); + return $id_factory; +} + + + +?> \ No newline at end of file diff --git a/ecrire/inc_texte.php3 b/ecrire/inc_texte.php3 index faa65b57b502dda96712d07cc58b73fd60670431..445081feed3647987afd62cc55e2921e46e3819b 100644 --- a/ecrire/inc_texte.php3 +++ b/ecrire/inc_texte.php3 @@ -229,12 +229,12 @@ function integre_image($id_document, $align, $affichage_detaille = false) { if ($fichier_vignette) { $vignette = "<img src='$fichier_vignette' border=0"; - if ($largeur_vignette && $hauteur_vignette) { + if ($largeur_vignette && $hauteur_vignette) $vignette .= " width='$largeur_vignette' height='$hauteur_vignette'"; - } - if ($titre) { + if ($align) + $vignette .= " align='$align'"; + if ($titre) $vignette .= " alt=\"$titre\" title=\"$titre\""; - } if ($affichage_detaille) $vignette .= ">"; else @@ -244,9 +244,10 @@ function integre_image($id_document, $align, $affichage_detaille = false) { $vignette = "pas de prévisualisation"; } - if ($mode == 'document' OR $affichage_detaille) { + if ($mode == 'document' OR $affichage_detaille) $vignette = "<a href='$fichier'>$vignette</a>"; - } + if ($align == 'center') + $vignette = "<div align='center'>$vignette</div>"; if ($affichage_detaille) { $query_type = "SELECT * FROM spip_types_documents WHERE id_type=$id_type"; $result_type = mysql_query($query_type); diff --git a/ecrire/inc_version.php3 b/ecrire/inc_version.php3 index c1557d84640e113534176687b79384ae98a6702d..f89579b5da5ac9336417aa84dfbe8b40dd8c864d 100644 --- a/ecrire/inc_version.php3 +++ b/ecrire/inc_version.php3 @@ -12,8 +12,8 @@ define("_ECRIRE_INC_VERSION", "1"); // (utilise pour les modifs de la base de donnees) // -$spip_version = 1.408; // version de la base -$spip_version_affichee = "1.4 alpha 8"; // version de SPIP +$spip_version = 1.409; // version de la base +$spip_version_affichee = "1.4 alpha 9"; // version de SPIP // diff --git a/inc-calcul.php3 b/inc-calcul.php3 index b4360ef516a055b9042056f3e0cbf53f74249a8c..d4c29024fa1e2eee64df9f52fce9faaa69ca065a 100644 --- a/inc-calcul.php3 +++ b/inc-calcul.php3 @@ -10,9 +10,9 @@ $GLOBALS['espace_logos'] = 3; // HSPACE=xxx VSPACE=xxx pour les logos (#LOGO_AR $GLOBALS['espace_images'] = 3; // HSPACE=xxx VSPACE=xxx pour les images integrees (<IMG1>) -include_local("ecrire/inc_index.php3"); -include_local("ecrire/inc_texte.php3"); -include_local ("ecrire/inc_filtres.php3"); +include_ecrire("inc_index.php3"); +include_ecrire("inc_texte.php3"); +include_ecrire("inc_filtres.php3"); include_local("inc-forum.php3"); @@ -25,7 +25,7 @@ else { if (file_exists("mes_fonctions.php3")) { - include ("mes_fonctions.php3"); + include_local("mes_fonctions.php3"); } diff --git a/inc-formulaires.php3 b/inc-formulaires.php3 index c77d8c7ec694365498d368f14990c4aedf931c4e..13487f96167205fa337cbc8837475c28a641e594 100644 --- a/inc-formulaires.php3 +++ b/inc-formulaires.php3 @@ -7,8 +7,7 @@ define("_INC_FORMULAIRES", "1"); function test_pass() { - include_local("ecrire/inc_acces.php3"); - + include_ecrire("inc_acces.php3"); for (;;) { $passw = creer_pass_aleatoire(); $query = "SELECT statut FROM spip_signatures WHERE statut='$passw'"; @@ -45,9 +44,9 @@ function erreur($zetexte){ function formulaire_signature($id_article) { global $val_confirm, $nom_email, $adresse_email, $message, $nom_site, $url_site, $url_page; - include_local ("ecrire/inc_connect.php3"); - include_local ("ecrire/inc_texte.php3"); - include_local ("ecrire/inc_filtres.php3"); + include_ecrire("inc_connect.php3"); + include_ecrire("inc_texte.php3"); + include_ecrire("inc_filtres.php3"); echo "<a name='sp$id_article'>"; @@ -286,7 +285,7 @@ function formulaire_inscription() { global $nom_inscription; if ($mail_inscription) { - include_local ("ecrire/inc_connect.php3"); + include_ecrire("inc_connect.php3"); $query = "SELECT * FROM spip_auteurs WHERE email='$mail_inscription'"; $result = mysql_query($query); $ok = true; @@ -375,7 +374,7 @@ function formulaire_site($la_rubrique) { } // Tester l'URL du site - include_local ("ecrire/inc_sites.php3"); + include_ecrire("inc_sites.php3"); if (!recuperer_page($url_site)) { $reponse_signature .= erreur("L'URL que vous avez indiquée n'est pas valide."); $refus = "oui"; diff --git a/inc-forum.php3 b/inc-forum.php3 index 9b35ff1aa46ed91aecdcf7b14fe8d32edfea8d35..f0874b2c39ed741370acba5df5ab2580198856cf 100644 --- a/inc-forum.php3 +++ b/inc-forum.php3 @@ -6,13 +6,13 @@ if (defined("_INC_FORUM")) return; define("_INC_FORUM", "1"); -include_local ("ecrire/inc_connect.php3"); -include_local ("ecrire/inc_meta.php3"); -include_local ("ecrire/inc_admin.php3"); -include_local ("ecrire/inc_acces.php3"); -include_local ("ecrire/inc_texte.php3"); -include_local ("ecrire/inc_filtres.php3"); -include_local ("ecrire/inc_mail.php3"); +include_ecrire("inc_connect.php3"); +include_ecrire("inc_meta.php3"); +include_ecrire("inc_admin.php3"); +include_ecrire("inc_acces.php3"); +include_ecrire("inc_texte.php3"); +include_ecrire("inc_filtres.php3"); +include_ecrire("inc_mail.php3"); if (file_exists("inc-urls.php3")) { include_local ("inc-urls.php3"); } @@ -46,7 +46,7 @@ function enlever_cookie_forum() { function decoder_hash_forum($email, $hash) { if (!$email OR !$hash) return false; - include("ecrire/inc_connect.php3"); + include_ecrire("inc_connect.php3"); $query = "SELECT * FROM spip_auteurs WHERE email='$email'"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { diff --git a/inc-public.php3 b/inc-public.php3 index 8aadb172c3c223add35d8c107b4bc036b1284000..a3246d52f82ec7fa34ef9408f4607d3303912dca 100644 --- a/inc-public.php3 +++ b/inc-public.php3 @@ -65,17 +65,17 @@ $use_cache &= ($recalcul != 'oui'); $use_cache &= empty($HTTP_POST_VARS); if (!$use_cache) { - include_local ("ecrire/inc_connect.php3"); + include_ecrire("inc_connect.php3"); if (!$db_ok) $use_cache = true; } if ($use_cache) { if (file_exists("ecrire/inc_meta_cache.php3")) { - include_local("ecrire/inc_meta_cache.php3"); + include_ecrire("inc_meta_cache.php3"); } else { - include_local ("ecrire/inc_connect.php3"); - include_local ("ecrire/inc_meta.php3"); + include_ecrire("inc_connect.php3"); + include_ecrire("inc_meta.php3"); } } else { @@ -172,9 +172,9 @@ if (!file_exists("CACHE/.htaccess")) { if (lire_meta('activer_moteur') == 'oui') { $fichier_index = 'CACHE/.index'; if ($db_ok) { - include_local ("ecrire/inc_texte.php3"); - include_local ("ecrire/inc_filtres.php3"); - include_local ("ecrire/inc_index.php3"); + include_ecrire("inc_texte.php3"); + include_ecrire("inc_filtres.php3"); + include_ecrire("inc_index.php3"); $s = ''; if ($id_article AND !deja_indexe('article', $id_article)) $s .= "article $id_article\n"; @@ -193,11 +193,11 @@ if (lire_meta('activer_moteur') == 'oui') { } } if ($use_cache AND file_exists($fichier_index) AND $size = filesize($fichier_index)) { - include_local ("ecrire/inc_connect.php3"); + include_ecrire("inc_connect.php3"); if ($db_ok) { - include_local ("ecrire/inc_texte.php3"); - include_local ("ecrire/inc_filtres.php3"); - include_local ("ecrire/inc_index.php3"); + include_ecrire("inc_texte.php3"); + include_ecrire("inc_filtres.php3"); + include_ecrire("inc_index.php3"); $f = fopen($fichier_index, 'r'); $s = fgets($f, 100); $suite = fread($f, $size); @@ -219,7 +219,7 @@ if (lire_meta('activer_moteur') == 'oui') { // if ($use_cache && file_exists('CACHE/.purge2')) { - include_local ("ecrire/inc_connect.php3"); + include_ecrire("inc_connect.php3"); if ($db_ok) { unlink('CACHE/.purge2'); $query = "SELECT fichier FROM spip_forum_cache WHERE maj < DATE_SUB(NOW(), INTERVAL 14 DAY)"; @@ -237,7 +237,7 @@ if ($use_cache && file_exists('CACHE/.purge2')) { } if ($use_cache && file_exists('CACHE/.purge')) { - include_local ("ecrire/inc_connect.php3"); + include_ecrire("inc_connect.php3"); if ($db_ok) { unlink('CACHE/.purge'); $f = fopen('CACHE/.purge2', 'w'); @@ -309,7 +309,7 @@ if ($admin_ok AND !$flag_preserver) { // if ($id_article AND lire_meta("activer_statistiques") != "non" AND !$flag_preserver) { - include_local ("ecrire/inc_connect.php3"); + include_ecrire("inc_connect.php3"); include_local ("inc-stats.php3"); if ($db_ok) ecrire_stats(); } @@ -320,10 +320,11 @@ if ($id_article AND lire_meta("activer_statistiques") != "non" AND !$flag_preser // if ($db_ok AND lire_meta("activer_syndic") != "non") { - include_local ("ecrire/inc_texte.php3"); - include_local ("ecrire/inc_filtres.php3"); - include_local ("ecrire/inc_sites.php3"); - include_local ("ecrire/inc_index.php3"); + include_ecrire("inc_texte.php3"); + include_ecrire("inc_filtres.php3"); + include_ecrire("inc_sites.php3"); + include_ecrire("inc_index.php3"); + executer_une_syndication(); executer_une_indexation_syndic(); } diff --git a/spip_cache.php3 b/spip_cache.php3 index dd689d590c3fe99d3f36e19e5d4d6440aabb1951..5c851d441034d9e02b3811d1be4fa028517b876a 100644 --- a/spip_cache.php3 +++ b/spip_cache.php3 @@ -2,9 +2,9 @@ include ("ecrire/inc_version.php3"); -include_local("ecrire/inc_connect.php3"); -include_local("ecrire/inc_meta.php3"); -include_local("ecrire/inc_admin.php3"); +include_ecrire("inc_connect.php3"); +include_ecrire("inc_meta.php3"); +include_ecrire("inc_admin.php3"); include_local("inc-cache.php3"); diff --git a/spip_cookie.php3 b/spip_cookie.php3 index 4c75b8398f24e61d50ed1595b25eb64e3e3ac01b..09a58c2b269999058da5019515bfc4824be316b0 100644 --- a/spip_cookie.php3 +++ b/spip_cookie.php3 @@ -1,7 +1,7 @@ <?php include ("ecrire/inc_version.php3"); -include_local ("ecrire/inc_cookie.php3"); +include_ecrire("inc_cookie.php3"); if ($ajout_cookie == "oui") { ajout_cookie_admin(); diff --git a/spip_image.php3 b/spip_image.php3 index 9dec1506e4f6255bc20f9f8014288b9b5093e955..122e9a86c6e12017fe3620c3977b6ad41655d105 100644 --- a/spip_image.php3 +++ b/spip_image.php3 @@ -2,9 +2,9 @@ include ("ecrire/inc_version.php3"); -include_local ("ecrire/inc_connect.php3"); -include_local ("ecrire/inc_meta.php3"); -include_local ("ecrire/inc_admin.php3"); +include_ecrire("inc_connect.php3"); +include_ecrire("inc_meta.php3"); +include_ecrire("inc_admin.php3"); if ($HTTP_POST_VARS) $vars = $HTTP_POST_VARS; else $vars = $HTTP_GET_VARS; diff --git a/spip_pass.php3 b/spip_pass.php3 index 1c30603b0bbbc895ee66b96981cb588795941685..58263dc5fc7160eca4b5c3a8177efe81d2195838 100644 --- a/spip_pass.php3 +++ b/spip_pass.php3 @@ -2,8 +2,8 @@ include ("ecrire/inc_version.php3"); -include_local ("ecrire/inc_connect.php3"); -include_local ("ecrire/inc_meta.php3"); +include_ecrire("inc_connect.php3"); +include_ecrire("inc_meta.php3"); include_local ("inc-forum.php3"); ?> diff --git a/spip_redirect.php3 b/spip_redirect.php3 index 05331f47a18dfed2468d71786401d21dac90e0aa..e91ceb339f4d42de9a7f7b184951d2c63c588586 100644 --- a/spip_redirect.php3 +++ b/spip_redirect.php3 @@ -4,7 +4,7 @@ include ("ecrire/inc_version.php3"); -include_local("ecrire/inc_connect.php3"); +include_ecrire("inc_connect.php3"); if (file_exists("inc-urls.php3")) { include_local ("inc-urls.php3"); } diff --git a/spip_test_dirs.php3 b/spip_test_dirs.php3 index 178b9dfc725463c70cef776d2d949c687895d08b..4700253229705ea7ef06eee0fe86d60381abd351 100644 --- a/spip_test_dirs.php3 +++ b/spip_test_dirs.php3 @@ -1,6 +1,8 @@ <?php -include ("ecrire/inc_presentation.php3"); +include("ecrire/inc_version.php3"); + +include_ecrire("inc_presentation.php3"); function bad_dirs($bad_dirs) { echo "