CVS: spip/ecrire articles.php3, 1.145, 1.146 articles_edit.php3, 1.69, 1.70 configuration.php3, 1.34, 1.35 inc_base.php3, 1.89, 1.90 inc_config.php3, 1.38, 1.39 inc_version.php3, 1.271, 1.272

Update of /home/spip-cvs/spip/ecrire
In directory miel:/tmp/cvs-serv7637/ecrire

Modified Files:
  articles.php3 articles_edit.php3 configuration.php3
  inc_base.php3 inc_config.php3 inc_version.php3
Log Message:
ajout d'un "URL de référence" pour les articles (optionnel)
on ne conserve pas en cache les pages ayant gfénéré une erreur SQL

Index: articles.php3

RCS file: /home/spip-cvs/spip/ecrire/articles.php3,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -d -r1.145 -r1.146
--- articles.php3 4 Oct 2003 21:45:10 -0000 1.145
+++ articles.php3 13 Oct 2003 21:05:45 -0000 1.146
@@ -9,6 +9,7 @@
$articles_surtitre = lire_meta("articles_surtitre");
$articles_soustitre = lire_meta("articles_soustitre");
$articles_descriptif = lire_meta("articles_descriptif");
+$articles_urlref = lire_meta("articles_urlref");
$articles_chapeau = lire_meta("articles_chapeau");
$articles_ps = lire_meta("articles_ps");
$articles_redac = lire_meta("articles_redac");
@@ -195,6 +196,7 @@
   $titre = addslashes(corriger_caracteres($titre));
   $soustitre = addslashes(corriger_caracteres($soustitre));
   $descriptif = addslashes(corriger_caracteres($descriptif));
+ $url_ref = addslashes(corriger_caracteres($url_ref));
   $chapo = addslashes(corriger_caracteres($chapo));
   $texte = addslashes(corriger_caracteres($texte));
   $ps = addslashes(corriger_caracteres($ps));
@@ -214,7 +216,7 @@
     $change_rubrique = "";
   }

- $query = "UPDATE spip_articles SET surtitre=\"$surtitre\", titre=\"$titre\", soustitre=\"$soustitre\", $change_rubrique descriptif=\"$descriptif\", chapo=\"$chapo\", texte=\"$texte\", ps=\"$ps\" $add_extra WHERE id_article=$id_article";
+ $query = "UPDATE spip_articles SET surtitre=\"$surtitre\", titre=\"$titre\", soustitre=\"$soustitre\", $change_rubrique descriptif=\"$descriptif\", chapo=\"$chapo\", texte=\"$texte\", ps=\"$ps\", url_ref=\"$url_ref\" $add_extra WHERE id_article=$id_article";
   $result = spip_query($query);
   calculer_rubriques();
   if ($statut_article == 'publie') $reindexer = true;
@@ -275,6 +277,7 @@
   $soustitre = $row["soustitre"];
   $id_rubrique = $row["id_rubrique"];
   $descriptif = $row["descriptif"];
+ $url_ref = $row["url_ref"];
   $chapo = $row["chapo"];
   $texte = $row["texte"];
   $ps = $row["ps"];
@@ -720,15 +723,16 @@
}

-if ($descriptif) {
+if ($descriptif<>'' OR $url_ref<>'') {
   echo "<p><div align='left' style='padding: 5px; border: 1px dashed #aaaaaa; background-color: #e4e4e4;' $dir_lang>";
   echo "<font size=2 face='Verdana,Arial,Helvetica,sans-serif'>";
- echo "<b>"._T('info_descriptif')."</b> ";
- echo propre($descriptif);
- echo "&nbsp; ";
+ $texte_case = ($descriptif) ? "{{"._T('info_descriptif')."}} $descriptif\n\n" : '';
+ $texte_case .= ($url_ref) ? "{{"._T('info_urlref')."}} [->$url_ref]" : '';
+ echo propre($texte_case);
   echo "</font>";
   echo "</div>";
}
+

if ($statut_article == 'prop') {
   echo "<P><FONT FACE='Verdana,Arial,Helvetica,sans-serif' SIZE=2 COLOR='red'><B>"._T('text_article_propose_publication')."</B></FONT></P>";

Index: articles_edit.php3

RCS file: /home/spip-cvs/spip/ecrire/articles_edit.php3,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- articles_edit.php3 17 Sep 2003 04:52:44 -0000 1.69
+++ articles_edit.php3 13 Oct 2003 21:05:45 -0000 1.70
@@ -7,6 +7,7 @@
$articles_surtitre = lire_meta("articles_surtitre");
$articles_soustitre = lire_meta("articles_soustitre");
$articles_descriptif = lire_meta("articles_descriptif");
+$articles_urlref = lire_meta("articles_urlref");
$articles_chapeau = lire_meta("articles_chapeau");
$articles_ps = lire_meta("articles_ps");
$articles_redac = lire_meta("articles_redac");
@@ -37,6 +38,7 @@
     $id_rubrique = $row["id_rubrique"];
     $id_secteur = $row['id_secteur'];
     $descriptif = $row["descriptif"];
+ $url_ref = $row["url_ref"];
     $chapo = $row["chapo"];
     $texte = $row["texte"];
     $ps = $row["ps"];
@@ -282,6 +284,7 @@
   $surtitre = entites_html($surtitre);

   $descriptif = entites_html($descriptif);
+ $url_ref = entites_html($url_ref);
   $chapo = entites_html($chapo);
   $texte = entites_html($texte);
   $ps = entites_html($ps);
@@ -352,6 +355,11 @@
   }
   else {
     echo "<INPUT TYPE='hidden' NAME='descriptif' VALUE=\"$descriptif\">";
+ }
+
+ if (($options == "avancees" AND $articles_urlref != "non") OR $url_ref) {
+ echo "<P><b>"._T('info_urlref')."</b> ";
+ echo "<input type='text' name='url_ref' class='forml' width='40' value=\"$url_ref\"/>";
   }

   if (substr($chapo, 0, 1) == '=') {

Index: configuration.php3

RCS file: /home/spip-cvs/spip/ecrire/configuration.php3,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- configuration.php3 11 Mar 2003 14:56:37 -0000 1.34
+++ configuration.php3 13 Oct 2003 21:05:45 -0000 1.35
@@ -122,6 +122,7 @@
   $articles_chapeau = lire_meta("articles_chapeau");
   $articles_ps = lire_meta("articles_ps");
   $articles_redac = lire_meta("articles_redac");
+ $articles_urlref = lire_meta("articles_urlref");

   echo "<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=3 WIDTH=\"100%\">";
   echo "<TR><TD BGCOLOR='#EEEECC' BACKGROUND='img_pack/rien.gif' COLSPAN=2><B><FONT FACE='Verdana,Arial,Helvetica,sans-serif' SIZE=3 COLOR='black'>"._T('info_contenu_articles')."</FONT></B>".aide ("confart")."</TD></TR>";
@@ -181,6 +182,15 @@
   echo "</TD>";
   echo "<TD ALIGN='$spip_lang_left' class='verdana2'>";
   afficher_choix('articles_redac', $articles_redac,
+ array('oui' => _T('item_oui'), 'non' => _T('item_non')), " &nbsp; ");
+ echo "</TD></TR>\n";
+
+ echo "<TR>";
+ echo "<TD ALIGN='$spip_lang_left' class='verdana2'>";
+ echo _T('info_urlref');
+ echo "</TD>";
+ echo "<TD ALIGN='$spip_lang_left' class='verdana2'>";
+ afficher_choix('articles_urlref', $articles_urlref,
     array('oui' => _T('item_oui'), 'non' => _T('item_non')), " &nbsp; ");
   echo "</TD></TR>\n";

Index: inc_base.php3

RCS file: /home/spip-cvs/spip/ecrire/inc_base.php3,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -d -r1.89 -r1.90
--- inc_base.php3 27 Sep 2003 23:13:37 -0000 1.89
+++ inc_base.php3 13 Oct 2003 21:05:45 -0000 1.90
@@ -43,12 +43,14 @@
     langue_choisie VARCHAR(3) DEFAULT 'non',
     id_trad bigint(21) DEFAULT '0' NOT NULL,
     extra longblob NULL,
+ url_ref text NOT NULL,
     PRIMARY KEY (id_article),
     KEY id_rubrique (id_rubrique),
     KEY id_secteur (id_secteur),
     KEY id_trad (id_trad),
     KEY lang (lang),
     KEY statut (statut, date),
+ KEY url_ref (url_ref),
     KEY date_modif (date_modif))";
   $result = spip_query($query);

@@ -1411,6 +1413,12 @@
     spip_query("ALTER TABLE spip_referers_articles DROP domaine");
     spip_query("ALTER TABLE spip_referers_temp DROP domaine");
     maj_version (1.718);
+ }
+
+ if ($version_installee < 1.720) {
+ spip_query("ALTER TABLE spip_articles ADD url_ref text NOT NULL");
+ spip_query("ALTER TABLE spip_articles ADD INDEX url_ref (url_ref)");
+ maj_version (1.720);
   }

   return true;

Index: inc_config.php3

RCS file: /home/spip-cvs/spip/ecrire/inc_config.php3,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- inc_config.php3 28 Sep 2003 18:07:30 -0000 1.38
+++ inc_config.php3 13 Oct 2003 21:05:45 -0000 1.39
@@ -30,6 +30,7 @@
     'articles_redac' => 'non',
     'articles_mots' => 'oui',
     'post_dates' => 'oui',
+ 'articles_urlref' => 'non',
     'creer_preview' => 'non',
     'taille_preview' => 150,
     'articles_modif' => 'non',
@@ -200,6 +201,7 @@
     'articles_redac',
     'articles_mots',
     'post_dates',
+ 'articles_urlref',
     'creer_preview',
     'taille_preview',
     'articles_modif',

Index: inc_version.php3

RCS file: /home/spip-cvs/spip/ecrire/inc_version.php3,v
retrieving revision 1.271
retrieving revision 1.272
diff -u -d -r1.271 -r1.272
--- inc_version.php3 1 Oct 2003 16:23:28 -0000 1.271
+++ inc_version.php3 13 Oct 2003 21:05:45 -0000 1.272
@@ -149,10 +149,10 @@
// (utilise pour les modifs de la base de donnees)

// version de la base
-$spip_version = 1.718;
+$spip_version = 1.720;

// version de spip
-$spip_version_affichee = "1.7a8 CVS";
+$spip_version_affichee = "1.7b1 CVS";

// version de spip / tag cvs
if (ereg('Name: v(.*) ','$Name$', $regs)) $spip_version_affichee = $regs[1];