Hi,
First thanks for a wonderful forum app and all the work around.
I try to add the addon code to my forum but it seems I have a problem when I try to use it in a new topic (I don't have any problem when replying).
When I click on post topic, I got an error message :
Fatal error: Cannot redeclare code_unprotect() (previously declared in /home/content/f/x/c/fxconfidential/html/forum/bb_codes.php:87) in .../forum/bb_codes.php on line 87
===================================================== line 87 :/* ADDON -- code */ line 88 : if(preg_match_all('/\{ \[ \}code\{ \] \}(.+?)\{ \[ \}\/code\{ \] and ...\}/is',$msg,$replacementI)){
function code_unprotect($val){ if(get_magic_quotes_gpc()==1) $val=stripslashes($val); $val=str_replace("{ : }",":",$val); $val=str_replace("{ ; }",";",$val); $val=str_replace("{ [ }","[",$val); $val=str_replace("{ ] }","]",$val); $val=str_replace(array("\n\r","\r\n"),"\r",$val); if(get_magic_quotes_gpc()==1) $val=addslashes($val); return $val; }
foreach($replacementI[0] as $val) $msg=str_replace($val,code_unprotect($val),$msg); }
$pattern=array(); $replacement=array(); $pattern[]="/\[code\](.+?)\[\/code\]/is"; $replacement[]='<div class="jscript"><pre>\\1</pre></div>'; $msg=preg_replace($pattern, $replacement, $msg); /* END ADDON -- code */ =====================================================
Thanks for your help |