X-Git-Url: http://git.cyclocoop.org/?p=ptitvelo%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fplugins-dist%2Ftextwheel%2Finc%2Flien.php;fp=www%2Fplugins-dist%2Ftextwheel%2Finc%2Flien.php;h=3441c0c429784fb2ead88200a73a05c3643f9044;hp=fb4b1b1235187f0976d762004eecdfdde04d8f66;hb=d18fcb8f27a4016e3fa7b50a9b2255d529dca543;hpb=e847eea4a82a7396dd0abf860f9b30d654f38629 diff --git a/www/plugins-dist/textwheel/inc/lien.php b/www/plugins-dist/textwheel/inc/lien.php index fb4b1b1..3441c0c 100644 --- a/www/plugins-dist/textwheel/inc/lien.php +++ b/www/plugins-dist/textwheel/inc/lien.php @@ -111,7 +111,7 @@ function inc_lien_dist($lien, $texte='', $class='', $title='', $hlang='', $rel=' // sinon les crochets ne peuvent plus servir qu'a ce type de raccourci define('_RACCOURCI_LIEN', "/\[([^][]*?([[][^]>-]*[]][^][]*)*)->(>?)([^]]*)\]/msS"); -// http://doc.spip.org/@expanser_liens +// http://code.spip.net/@expanser_liens function expanser_liens($t, $connect='', $env=array()) { @@ -189,7 +189,7 @@ function expanser_un_lien($reg, $quoi='echappe', $env=null){ // Meme analyse mais pour eliminer les liens // et ne laisser que leur titre, a expliciter si ce n'est fait -// http://doc.spip.org/@nettoyer_raccourcis_typo +// http://code.spip.net/@nettoyer_raccourcis_typo function nettoyer_raccourcis_typo($texte, $connect='') { $texte = pipeline('nettoyer_raccourcis_typo',$texte); @@ -238,7 +238,7 @@ function nettoyer_raccourcis_typo($texte, $connect='') // pour ne pas confondre avec un autre raccourci define('_RACCOURCI_ATTRIBUTS', '/^((?:[^[]*?(?:\[[^]]*\])?)*?)([|]([^<>]*?))?([{]([a-z_]*)[}])?$/'); -// http://doc.spip.org/@traiter_raccourci_lien_atts +// http://code.spip.net/@traiter_raccourci_lien_atts function traiter_raccourci_lien_atts($texte) { $bulle = $hlang = false; @@ -291,7 +291,7 @@ define('_RACCOURCI_CHAPO', '/^(\W*)(\W*)(\w*\d+([?#].*)?)$/'); * renvoie l'url reelle de redirection si le $url=true, * l'url brute contenue dans le chapo sinon * - * http://doc.spip.org/@chapo_redirige + * http://code.spip.net/@chapo_redirige * * @param string $virtuel * @param bool $url @@ -316,7 +316,7 @@ function virtuel_redirige($virtuel, $url=false){ // 'titre': seulement T ci-dessus (i.e. le TITRE ci-dessus ou dans table SQL) // 'url': seulement U (i.e. generer_url_RACCOURCI) -// http://doc.spip.org/@calculer_url +// http://code.spip.net/@calculer_url function calculer_url ($ref, $texte='', $pour='url', $connect='', $echappe_typo = true) { $r = traiter_lien_implicite($ref, $texte, $pour, $connect, $echappe_typo); $r = ($r ? $r : traiter_lien_explicite($ref, $texte, $pour, $connect, $echappe_typo)); @@ -325,7 +325,7 @@ function calculer_url ($ref, $texte='', $pour='url', $connect='', $echappe_typo define('_EXTRAIRE_LIEN', ",^\s*(http:?/?/?|mailto:?)\s*$,iS"); -// http://doc.spip.org/@traiter_lien_explicite +// http://code.spip.net/@traiter_lien_explicite function traiter_lien_explicite ($ref, $texte='', $pour='url', $connect='', $echappe_typo = true) { if (preg_match(_EXTRAIRE_LIEN, $ref)) @@ -362,8 +362,9 @@ function traiter_lien_explicite ($ref, $texte='', $pour='url', $connect='', $ech } function liens_implicite_glose_dist($texte,$id,$type,$args,$ancre,$connect=''){ - if (function_exists($f = 'glossaire_' . $ancre)) - $url = $f($texte, $id); + if ( ($ancre AND function_exists($f = 'glossaire_' . $ancre)) + OR function_exists($f = 'glossaire_')) + $url = $f($texte, $id, $ancre); else $url = glossaire_std($texte); return $url; @@ -381,7 +382,7 @@ function liens_implicite_glose_dist($texte,$id,$type,$args,$ancre,$connect=''){ * unset($GLOBALS['lien_implicite_cible_public']); * => retablit le comportement automatique * - * http://doc.spip.org/@traiter_lien_implicite + * http://code.spip.net/@traiter_lien_implicite * * @param string $ref * @param string $texte @@ -417,7 +418,7 @@ function traiter_lien_implicite ($ref, $texte='', $pour='url', $connect='') // dans le cas d'un lien vers un doc, ajouter le type='mime/type' if ($type == 'document' AND $mime = sql_getfetsel('mime_type', 'spip_types_documents', - "extension IN (SELECT extension FROM spip_documents where id_document =".intval($id).")", + "extension IN (".sql_get_select("extension","spip_documents","id_document=".sql_quote($id)).")", '','','','',$connect) ) $r['mime'] = $mime; @@ -429,7 +430,7 @@ function traiter_lien_implicite ($ref, $texte='', $pour='url', $connect='') define('_RACCOURCI_URL', '/^\s*(\w*?)\s*(\d+)(\?(.*?))?(#([^\s]*))?\s*$/S'); -// http://doc.spip.org/@typer_raccourci +// http://code.spip.net/@typer_raccourci function typer_raccourci ($lien) { if (!preg_match(_RACCOURCI_URL, $lien, $match)) return array(); $f = $match[1]; @@ -467,7 +468,7 @@ function traiter_raccourci_titre($id, $type, $connect=NULL) // Le nom du modele doit faire au moins trois caracteres (evite

) // Si $doublons==true, on repere les documents sans calculer les modeles // mais on renvoie les params (pour l'indexation par le moteur de recherche) -// http://doc.spip.org/@traiter_modeles +// http://code.spip.net/@traiter_modeles define('_PREG_MODELE', '(<([a-z_-]{3,})' # ]+)\]/S"); define('_RACCOURCI_GLOSES', '/^([^|#{]*\w[^|#{]*)([^#]*)(#([^|{}]*))?(.*)$/S'); -// http://doc.spip.org/@traiter_raccourci_glossaire +// http://code.spip.net/@traiter_raccourci_glossaire function traiter_raccourci_glossaire($texte) { if (!preg_match_all(_RACCOURCI_GLOSSAIRE, @@ -618,7 +623,7 @@ function traiter_raccourci_glossaire($texte) return $texte; } -// http://doc.spip.org/@glossaire_std +// http://code.spip.net/@glossaire_std function glossaire_std($terme) { global $url_glossaire_externe;