Skip to content
Extraits de code Groupes Projets
Valider e482eccf rédigé par esj's avatar esj
Parcourir les fichiers

Petites améliorations pour le raccourci ->spip

parent d22de0b5
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -572,7 +572,6 @@ function calculer_url ($lien, $texte='', $pour='url') {
$f = $tableau_raccourcis[$f];
$f=(($pour == 'url') ? 'generer' : 'calculer') . '_url_' . $f;
if (function_exists($f)) {
charger_generer_url();
if ($pour == 'url') return $f($match[2]) . $ancre;
$res = $f($match[2], $texte, $ancre);
return ($pour == 'titre') ? $res[2] : $res;
......@@ -685,11 +684,13 @@ function calculer_url_site($id, $texte, $ancre)
function calculer_url_spip($id, $texte, $ancre)
{
global $tableau_raccourcis;
global $tableau_raccourcis, $home_server;
if (is_numeric($tableau_raccourcis['spip'][$id]))
$p= "spip.php?page=article&id_article=" . $tableau_raccourcis['spip'][$id];
$p= "/spip.php?page=article&id_article=" . $tableau_raccourcis['spip'][$id];
else $p = '';
return array("http://www.spip.net/$p$ancre", 'spip', "SPIP $id");
return array($home_server ."$p$ancre",
'spip',
'SPIP ' . join('.', preg_split('//',strval($id),-1,PREG_SPLIT_NO_EMPTY)));
}
//
......
......@@ -132,7 +132,8 @@ $quota_cache = 10;
// Serveurs externes
//
# aide en ligne
$help_server = 'http://www.spip.net/aide';
$home_server = 'http://www.spip.net';
$help_server = $home_server . '/aide';
# TeX
$tex_server = 'http://math.spip.org/tex.php';
# MathML (pas pour l'instant: manque un bon convertisseur)
......@@ -199,7 +200,27 @@ $tableau_raccourcis = array(
'im' => 'document',
'img' => 'document',
'image' => 'document',
'spip' => array(19 => 3368) // num article sur spipnet. A completer
// articles de reference sur www.spip.net
'spip' => array(
1 => 1309,
10 => 1309,
103 => 1309,
104 => 1309,
105 => 1309,
12 => 1310,
121 => 1310,
13 => 1253,
14 => 1832,
15 => 1911,
16 => 1965,
17 => 2102,
171 => 2102,
172 => 2102,
18 => 2991,
181 => 2991,
182 => 3173,
183 => 3333,
19 => 3368)
);
# la matrice standard (fichiers definissant les fonctions a inclure)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter