You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
contrib.spip.net/galactic_contrib_fonctions.php

35 lines
835 B
PHP

<?php
// Retire les liens en syntaxe Trac: [URL titre] ---> titre
function tracbrut($texte) {
if (preg_match_all('/[[][^ ]* *([^]]*)]/', $texte, $m, PREG_SET_ORDER)) {
foreach ($m as $r) {
$texte = str_replace($r[0], $r[1], $texte);
}
}
return $texte ? $texte : 'Log';
}
function balise_ID_RUBRIQUE_CARNET_dist($p) {
static $id = null;
if (is_null($id)) {
include_spip('inc/config');
$id = lire_config('gribouille/secteur_wiki', 0);
if (!$id) {
$ids = lire_config('autorite/espace_wiki');
if ($ids) {
$id = reset($ids);
}
}
}
$p->code = "$id";
return $p;
}
function critere_contrib_recherche_fulltext_dist($idb, &$boucles, $crit) {
// sur contrib, la recherche sur le titre des forums est pas pertinente
return critere_recherche_fulltext_dist($idb,$boucles, $crit, ['forum' => ['titre']]);
}