1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
//fonction des quotes
function cb_replace2($m) {
global $Bdd;
if($m[1]>0 && is_numeric($m[1])){
//recherche des infos sur le commentaires selectionne
$res = $Bdd -> Send_Query('SELECT c_id, c_date, c_nom , c_mail, c_texte, c_suppr FROM comment WHERE c_id=\''.$m[1].'\' AND c_suppr=\'0\'');
if($obj = $Bdd -> get_object($res))
{
$txt = $obj->c_texte;
$pattern = "#[citation]([^0-9])[/citation]#";
preg_match_all($pattern ,$txt, $matches, PREG_SET_ORDER);
print_r($matches);
$txt = str_replace(array('<','>'), array('<','>'), $txt);
}
return utf8_decode('<blockquote><span class="or">'.$obj->c_nom.'</span> :<br />'.$txt.'</blockquote>');
}
return $m[0]; # Par défaut, on laisse la chaîne inchangée
}
function parse_texte2($texte){
$texte = preg_replace_callback('`\[citation\](.*)\[/citation\]`U', 'cb_replace2', $texte);
return($texte);
} |