CVS: spip/ecrire articles.php3, 1.146, 1.147 articles_edit.php3, 1.70, 1.71 inc_base.php3, 1.91, 1.92 inc_version.php3, 1.273, 1.274

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

Modified Files:
  articles.php3 articles_edit.php3 inc_base.php3
  inc_version.php3
Log Message:
nomenclature plus cohérente : url_ref (dans les articles) devient url_site (comme dans les brèves) ; on l'évoque sous le nom "Lien hypertexte" et non plus "Adresse (URL) de référence"...

Index: articles.php3

RCS file: /home/spip-cvs/spip/ecrire/articles.php3,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -d -r1.146 -r1.147
--- articles.php3 13 Oct 2003 21:05:45 -0000 1.146
+++ articles.php3 18 Oct 2003 14:06:25 -0000 1.147
@@ -196,7 +196,8 @@
   $titre = addslashes(corriger_caracteres($titre));
   $soustitre = addslashes(corriger_caracteres($soustitre));
   $descriptif = addslashes(corriger_caracteres($descriptif));
- $url_ref = addslashes(corriger_caracteres($url_ref));
+ $nom_site = addslashes(corriger_caracteres($nom_site));
+ $url_site = addslashes(corriger_caracteres($url_site));
   $chapo = addslashes(corriger_caracteres($chapo));
   $texte = addslashes(corriger_caracteres($texte));
   $ps = addslashes(corriger_caracteres($ps));
@@ -216,7 +217,7 @@
     $change_rubrique = "";
   }

- $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";
+ $query = "UPDATE spip_articles SET surtitre=\"$surtitre\", titre=\"$titre\", soustitre=\"$soustitre\", $change_rubrique descriptif=\"$descriptif\", chapo=\"$chapo\", texte=\"$texte\", ps=\"$ps\", url_site=\"$url_site\", nom_site=\"$nom_site\" $add_extra WHERE id_article=$id_article";
   $result = spip_query($query);
   calculer_rubriques();
   if ($statut_article == 'publie') $reindexer = true;
@@ -277,7 +278,8 @@
   $soustitre = $row["soustitre"];
   $id_rubrique = $row["id_rubrique"];
   $descriptif = $row["descriptif"];
- $url_ref = $row["url_ref"];
+ $nom_site = $row["nom_site"];
+ $url_site = $row["url_site"];
   $chapo = $row["chapo"];
   $texte = $row["texte"];
   $ps = $row["ps"];
@@ -723,11 +725,11 @@
}

-if ($descriptif<>'' OR $url_ref<>'') {
+if ($descriptif OR $url_site OR $nom_site) {
   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'>";
   $texte_case = ($descriptif) ? "{{"._T('info_descriptif')."}} $descriptif\n\n" : '';
- $texte_case .= ($url_ref) ? "{{"._T('info_urlref')."}} [->$url_ref]" : '';
+ $texte_case .= ($nom_site.$url_site) ? "{{"._T('info_urlref')."}} [".$nom_site."->".$url_site."]" : '';
   echo propre($texte_case);
   echo "</font>";
   echo "</div>";

Index: articles_edit.php3

RCS file: /home/spip-cvs/spip/ecrire/articles_edit.php3,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- articles_edit.php3 13 Oct 2003 21:05:45 -0000 1.70
+++ articles_edit.php3 18 Oct 2003 14:06:25 -0000 1.71
@@ -38,7 +38,8 @@
     $id_rubrique = $row["id_rubrique"];
     $id_secteur = $row['id_secteur'];
     $descriptif = $row["descriptif"];
- $url_ref = $row["url_ref"];
+ $nom_site = $row["nom_site"];
+ $url_site = $row["url_site"];
     $chapo = $row["chapo"];
     $texte = $row["texte"];
     $ps = $row["ps"];
@@ -284,7 +285,8 @@
   $surtitre = entites_html($surtitre);

   $descriptif = entites_html($descriptif);
- $url_ref = entites_html($url_ref);
+ $nom_site = entites_html($nom_site);
+ $url_site = entites_html($url_site);
   $chapo = entites_html($chapo);
   $texte = entites_html($texte);
   $ps = entites_html($ps);
@@ -357,9 +359,12 @@
     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 (($options == "avancees" AND $articles_urlref != "non") OR $nom_site OR $url_site) {
+ echo _T('entree_liens_sites')."<br />\n";
+ echo _T('info_titre')." ";
+ echo "<input type='text' name='nom_site' class='forml' width='40' value=\"$nom_site\"/><br />\n";
+ echo _T('info_url')." ";
+ echo "<input type='text' name='url_site' class='forml' width='40' value=\"$url_site\"/>";
   }

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

Index: inc_base.php3

RCS file: /home/spip-cvs/spip/ecrire/inc_base.php3,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- inc_base.php3 14 Oct 2003 15:37:16 -0000 1.91
+++ inc_base.php3 18 Oct 2003 14:06:25 -0000 1.92
@@ -43,14 +43,15 @@
     langue_choisie VARCHAR(3) DEFAULT 'non',
     id_trad bigint(21) DEFAULT '0' NOT NULL,
     extra longblob NULL,
- url_ref text NOT NULL,
+ nom_site tinytext NOT NULL,
+ url_site 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 (25)),
+ KEY url_site (url_site (25)),
     KEY date_modif (date_modif))";
   $result = spip_query($query);

@@ -1415,6 +1416,7 @@
     maj_version (1.718);
   }

+ /*
   if ($version_installee < 1.720) {
     spip_query("ALTER TABLE spip_articles ADD url_ref text NOT NULL");
     maj_version (1.720);
@@ -1424,6 +1426,20 @@
     spip_query("ALTER TABLE spip_articles ADD INDEX url_ref (url_ref (25))");
     maj_version (1.721);
   }
+ */
+
+ if ($version_installee < 1.722) {
+ spip_query("ALTER TABLE spip_articles ADD nom_site tinytext NOT NULL");
+ spip_query("ALTER TABLE spip_articles ADD url_site text NOT NULL");
+ spip_query("ALTER TABLE spip_articles ADD INDEX url_site (url_site (25))");
+ if ($version_installee >= 1.720) {
+ spip_query("UPDATE spip_articles SET url_site=url_ref");
+ spip_query("ALTER TABLE spip_articles DROP INDEX url_ref");
+ spip_query("ALTER TABLE spip_articles DROP url_ref");
+ }
+ maj_version (1.722);
+ }
+

   return true;
}

Index: inc_version.php3

RCS file: /home/spip-cvs/spip/ecrire/inc_version.php3,v
retrieving revision 1.273
retrieving revision 1.274
diff -u -d -r1.273 -r1.274
--- inc_version.php3 14 Oct 2003 15:37:17 -0000 1.273
+++ inc_version.php3 18 Oct 2003 14:06:25 -0000 1.274
@@ -149,7 +149,7 @@
// (utilise pour les modifs de la base de donnees)

// version de la base
-$spip_version = 1.721;
+$spip_version = 1.722;

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