voici le source permettant la colorisation du PHP dans le forum :
<?php
// Extrait d'une fonction. $string[0] étant le code PHP
$code=highlight_string($string[0],true);
$code=& preg_replace_callback($GLOBALS['Text_PHPFunctions_search'],'Text_PHPManualLink',$code);
$code=& str_replace(
array('</font>',
'<font color="#0000BB">',
'<font color="#007700">',
'<font color="#DD0000">',
'<font color="#FF9900">',
'<font color="#000000">'
),
array('</span>',
'<span class="php_var">',
'<span class="php_sep">',
'<span class="php_str">',
'<span class="php_com">',
'<span class="code">',
),
$code);
?>
puis la fonction Text_PHPManualLink :
<?php
function Text_PHPManualLink($fct){
return '<a href="http://www.php.net/manual/fr/function.'.
str_replace('_','-',$fct[2]).
'.php" target="_blank">'.
$fct[2].'</a>';
}
?>
et enfin une partie de la variable $GLOBALS['Text_PHPFunctions_search'] :
<?php
$functions=array(
'abs',
'acos',
'acosh',
// [...] le fichier fait pas loin de 3000 lignes...
'zip_open',
'zip_read'
);
$CONF['Text_PHPFunctions_search']='`(<font color="#0000BB">)('.implode('|',$functions).')(</font>)`i';
?>