miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /  
 

Enabling moderators to use color BB codes / color tags

 
 
Page  Page 2 of 3:  « Previous  1  2  3  Next »

Author Paul
Lead Developer 
#16 | Posted: 27 May 2006 15:45 
The $pattern and $replacement variables should be set in one line, no spaces and no breaks should be here. Be sure they has been pasted this way. miniBB splits large phrases into pieces, if they rich the length limit, so you must care about long lines.

Author shedrock
Partaker
#17 | Posted: 27 May 2006 15:55 
Actually, I found out the problem Paul. I must have the code for the [bold] before the [colors] in the bbcodes.php file. It works this way now.

Thank again.

Shedrock

Author Paul
Lead Developer 
#18 | Posted: 27 May 2006 16:04 
Ok then.

Author pikkupiru
Partaker
#19 | Posted: 2 Oct 2006 04:05 
I have been trying to implement these color BB codes to my own forum, with no success. It simply posts the code in the submitted post. Is it only bb_codes.php I need to edit, or are there more files to change?

Many thanks.

Author Paul
Lead Developer 
#20 | Posted: 2 Oct 2006 06:52 
Be sure you're pasting these lines in the proper place. They all must be pasted before the string

$msg=preg_replace($pattern, $replacement, $msg);

Actually, we already have color BB codes by default, but they work only for admin. If you notice the string if($GLOBALS['user_id']==1... in bb_codes.php, it sets the condition of [font...] code available only for admin.

Yes, bb_codes.php is the only file you need to edit for adding/removing the BB codes.

Author pikkupiru
Partaker
#21 | Posted: 2 Oct 2006 16:57 
It appears to be working now... It turned out I was having server troubles at the time, I'm sure there were issues with my file uploads.

Thanks.

Author SamSam
Partaker
#22 | Posted: 30 Dec 2007 09:38 
Look at the following statement in bb_codes.php:

if($admin==1) {
$pattern[]="/\[font(#[A-F0-9]{6})\](.+?)\[\/font\]/is";
$replacement[]='<font color="\\1">\\2</font>';
}

you may edit it like:

if($admin==1 or $GLOBALS['isMod']==1) {
$pattern[]="/\[font(#[A-F0-9]{6})\](.+?)\[\/font\]/is";
$replacement[]='<font color="\\1">\\2</font>';
}

and it should work.

is it possible to allow other user also ?

Author Paul
Lead Developer 
#23 | Posted: 30 Dec 2007 11:48 
The condition should be

$admin==1 or $GLOBALS['isMod']==1 or in_array($GLOBALS['user_id'], array(1,2,3))

where 1,2,3 would stand for your user IDs.

Author SamSam2
Guest
#24 | Posted: 31 Dec 2007 06:46 
Paul
_______________________________________________
if($admin==1 or $GLOBALS['isMod']==1) {
$pattern[]="/\[font(#[A-F0-9]{6})\](.+?)\[\/font\]/is";
$replacement[]='<font color="\\1">\\2</font>';
}
________________________________________________
I want to enable for all user, is it possible?
I did that one you wrote but it's gave me error!

Author Paul
Lead Developer 
#25 | Posted: 31 Dec 2007 09:18 
For enabling to all users, just remove this condition.

Author SamSam2
Guest
#26 | Posted: 31 Dec 2007 11:56 
For enabling to all users, just remove this condition.
thank u

Author SamSam2
Guest
#27 | Posted: 21 Jan 2008 01:31 
$pattern[]="/\[red\](.+?)\[\/red\]/is";
$replacement[]='<font color=\"#FF0000\">\\1</font>';


when I wan to edit my post it's not like this :

[red] text [/red]

it is like that : ( in edit mode )

<font color="#FF0000"> text </font>

is it possible to make like this in edit mode also :

[red] text [/red]

Author Paul
Lead Developer 
#28 | Posted: 21 Jan 2008 04:13 
when I wan to edit my post it's not like this

- you need to apply back-decoding algorithm properly in the function deCodeBB() of the same file.

Author SamSam2
Guest
#29 | Posted: 21 Jan 2008 05:56 
decoding algorithm
so how can i make decoding for this :

{
$pattern[]="/\[red\](.+?)\[\/red\]/is";
$replacement[]='<font color=\"#D51512\">\\1</font>';
}

Author Paul
Lead Developer 
#30 | Posted: 21 Jan 2008 06:55 
$pattern[]="/<font color=\"#D51512\">(.+?)<\/font>/is";
$replacement[]="[red]\\1[/red]";

Page  Page 2 of 3:  « Previous  1  2  3  Next » 
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 Enabling moderators to use color BB codes / color tags
 Share Topic's Link

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


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑