miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Specific miniBB Support Forums / Specific /   

Problem with addon code

Author judex001
#1 | Posted: 21 Oct 2008 13:44 

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);
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();
$replacement[]='<div class="jscript"><pre>\\1</pre></div>';
$msg=preg_replace($pattern, $replacement, $msg);
/* END ADDON -- code */

Thanks for your help

Author Paul
Lead Developer
#2 | Posted: 21 Oct 2008 14:46 
Try to put the following condition:


surrounding code_unprotect function.

Author judex001
#3 | Posted: 21 Oct 2008 15:38 
It works fine now - thanks a lot.

Specific miniBB Support Forums / Specific / Problem with addon code Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.

Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB