Hayreon
Enregistré le 18/01/2003
Messages: 1451
Non connecté
|
Ajouté le : 07/09/2004 09:17
Message :
Merci mais j'ai toujours un probleme :
Parse error: parse error, unexpected '<' in c:\program files\easyphp1-7\www\tests\include\fonctions.inc.php(108) : regexp code on line 1
Fatal error: Failed evaluating code:
1 <?php // 1er ligne du bbcode
1 // Ici il devrai y avoir le code
?> // Derniere ligne du bbcode
in c:\program files\easyphp1-7\www\tests\include\fonctions.inc.php on line 108
Voila le fonction affwall()
function affwall($code)
{
$code = "<?php\n".$code."\n?>";
$code = stripslashes(stripslashes($code));
$code = highlight_string($code,true);
$code = explode('<br>',$code);
for($x=0 ; $x<sizeof($code) ; $x++)
{
$text .= "<tr>\n";
$text .= "<td width='15' bgcolor='#C0C0C0' style=\"font-size: 10px; vertical-align: top;\">\n";
$text .= ($x+1);
$text .= "</td>\n";
$text .= "<td width='485' bgcolor='#F4F4F4' style=\"font-size: 10px; vertical-align: top;\">\n";
$text .= $code[$x];
$text .= "</td></tr>\n";
}
return $text;
}
Et le nouveau regex :
$msg = preg_replace("/\[wall\](.*?)\[\/wall\]/sie","<table width=\"500\" border=\"1\" style=\"border-style:solid; border-width:1px; border-collapse:collapse;\" bgcolor=\"f4f4f4\" bordercolor=\"000000\">".affwall("\\1")."</table>",$msg);
Merci
*** Message édité par Aquilon le 07/09/2004 09:23 ***
Avant de poster : La documentation - Les FAQ
|