miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | 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 | Edited by: Paul 
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
Registered
#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
Registered
#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
Registered
#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
Registered
#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 | Edited by: Paul 
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 Top

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

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


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
Check out the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB