\\1",
"\\1",
"\\1",
"\\1",
"
\\1", "
\\1", "
\\1 a écrit", "\\2", "
\\2
tag
function nl2brPlus($string) {
$string = str_replace("\n", "
", $string);
if(preg_match_all('/\(.*?)\<\/pre\>/', $string, $match)){
foreach($match as $a){
foreach($a as $b){
$string = str_replace(''.$b.'
', "".str_replace("
", "", $b)."", $string);
}
}
}
return $string;
}
# Transform URL and e-mails into links
function makeLinks($string) {
$string = preg_replace_callback('/\s(http|https|ftp):(\/\/){0,1}([^\"\s]*)/i','splitUri',$string);
return $string;
}
# Split links, require for makeLinks
function splitUri($matches) {
$uri = $matches[1].':'.$matches[2].$matches[3];
$t = parse_url($uri);
$link = $matches[3];
if (!empty($t['scheme'])) {
return ' '.$link.'';
} else {
return $uri;
}
}
// parse la description pour ajouter les liens sur les tags
function parse_tags ($desc) {
$desc_parse = preg_replace ('/#([\w\dÀÇÈÉÊËÎÏÔÙÚÛÜàáâçèéêëîïóùúûü]+)/i', '\\1', $desc);
return $desc_parse;
}