miniBB ®  
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Official Addons and Solutions miniBB Support Forums / Official Addons and Solutions /   

Color Picker

Author myarbro
Registered
#1 | Posted: 28 May 2008 10:19 
How can I move the color_picker button from it's default location (near the PostTopic button) up above the text box alongside the bold, italic, and underline buttons. This is a toolbar area, of sorts, and it would look nice there and also save space.

Thanks for your advice!

Author Paul
Lead Developer
#2 | Posted: 28 May 2008 11:05 | Edited by: Paul 
Sorry, it isn't clear for me why this button should be located near PostTopic button at all? The readme.txt file contains the instructions exactly as you see it... the button's code could be pasted exactly amongst text formatting menu, like it's done on our demo site. You may just view the source of main_post_form.html template on demo site and check where to paste the code.

Author myarbro
Registered
#3 | Posted: 28 May 2008 11:41 
Nice! I misunderstood some of the directions. It's perfect now. Thanks!

Author Excalibor
Registered
#4 | Posted: 12 Jan 2009 19:00 | Edited by: Excalibor 
Hello,

In the readme.txt say (bold style):

by default, miniBB is not allowing to use color BB code for regular users (but for admin only). You will need to modify bb_codes.php file and remove the condition which looks like:


if($admin==1) {

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


}

But i have a error...:

Parse error: syntax error, unexpected T_LOGICAL_OR in /home/www/domain.com/foro/bb_codes.php on line 57

... when i erase this if($admin==1 or $GLOBALS['isMod']==1)

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


bb_codes.php:
if($admin==1 or $GLOBALS['isMod']==1){

$pattern[]="/\[[uU]\](.+?)\[\/[uU]\]/s";
$replacement[]='<u>\\1</u>';

$pattern[]="/\[urlc=((f|ht)tp[s]?:\/\/[^<> \n\r\[\]]+?)\](.*?)\[\/url\]/i";
$replacement[]="<a href=\"\\1\" target=\"_blank\">\\3</a>";

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


}

Thank.

Author Paul
Lead Developer
#5 | Posted: 13 Jan 2009 04:11 
You need to erase not just the string saying if($admin==1 or $GLOBALS['isMod']==1), you need to know how PHP works to move that condition :-)

Your code should be:

if($admin==1 or $GLOBALS['isMod']==1){

$pattern[]="/\[[uU]\](.+?)\[\/[uU]\]/s";
$replacement[]='<u>\\1</u>';

$pattern[]="/\[urlc=((f|ht)tp[s]?:\/\/[^<> \n\r\[\]]+?)\](.*?)\[\/url\]/i";
$replacement[]="<a href=\"\\1\" target=\"_blank\">\\3</a>";

}

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

so you just need to move the closing quote a bit higher...

Author Excalibor
Registered
#6 | Posted: 16 Jan 2009 21:13 
Hello Paul,

Thank.

Author K3Exe
Registered
#7 | Posted: 16 Mar 2014 19:55 
{$colorPicker} just for Admin ??
how?

sorry my english

Author Paul
Lead Developer
#8 | Posted: 16 Mar 2014 23:34 
This add-on is allowed to admin/moderator only, by default.

You have the README file for this add-on.

Inside of it, look for "admin only" statement. Instructions from that file will get you to the point on how to allow this add-on for regular members as well.

Author K3Exe
Registered
#9 | Posted: 16 Mar 2014 23:51 | Edited by: K3Exe 
but hide botton to all public " Color Picker"

edit: i will read, traslate use google xD!

Author Paul
Lead Developer
#10 | Posted: 17 Mar 2014 00:01 | Edited by: Paul 
Hopefully you could translate my instructions properly.

Under bb_plugins.php, paste this code:

if($user_id==1){
$colorPickerBtn=<<<out
<a href="JavaScript:doPicker()" onmouseover="window.status='{$l_bb_color}'; return true" onmouseout="window.status=''; return true" onmousemove="pasteSel()"><img src="{$main_url}/img/button_color.gif" style="width:22px;height:22px" alt="{$l_bb_color}" title="{$l_bb_color}" /></a>
out;
}

then instead of the code the add-on provides, paste into templates/main_post_form.html:

{$colorPickerBtn}

You should leave the code between

<!-- BEGIN COLOR PICK -->
...
<!-- END COLOR PICK -->

as it's provided in README.

That's a simple logics...

Official Addons and Solutions miniBB Support Forums / Official Addons and Solutions / Color Picker 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
  Extend your miniBB-forums, attaching the images and files,
get the File and Picture Attachments add-on!
Galleries / Attachments Addon for miniBB