le 02/01/2005 à 21:07
Exportation de fonctions
t'as utilisé l'astuce pour forcer le téléchargement ? :p
$string = preg_replace("`\[QUOTE\](.+?(?=\[/QUOTE\]))\[/QUOTE\]`i","<div class='quote'> \\1 </div>",$string);
function bbcode_quote($code)
{
return '<div class="quote">'.$code[1].'</div>';
}
function creer_bbcode ($string) {
$string = preg_replace_callback ("`\[LIEN\](.+?(?=\[/LIEN\]))\[/LIEN\]`i",'bbcode_lien', $string);
$string = preg_replace_callback("/\[lien=(.*?)\](.*?)\[\/lien\]/is",'bbcode_lien2',$string);
$string = preg_replace_callback ("`\[IMG\](.+?(?=\[/IMG\]))\[/IMG\]`i",'bbcode_image', $string);
$string = preg_replace_callback("`\[QUOTE\](.+?(?=\[/QUOTE\]))\[/QUOTE\]`i",'bbcode_quote',$string);
$string = preg_replace ("`\[MAIL\](.+?(?=\[/MAIL\]))\[/MAIL\]`i","<a href=mailto:\\1> \\1 </A>", $string);
return ($string);
}
Chargement en cours