miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Official Addons and Solutions miniBB Support Forums / Official Addons and Solutions /  
 

Color Picker

 
Author myarbro
Partaker
#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 
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
Partaker
#3 | Posted: 28 May 2008 11:41 
Nice! I misunderstood some of the directions. It's perfect now. Thanks!

Author Excalibor
Partaker
#4 | Posted: 12 Jan 2009 19:00 
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
Partaker
#6 | Posted: 16 Jan 2009 21:13 
Hello Paul,

Thank.

Author K3Exe
Partaker
#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
Partaker
#9 | Posted: 16 Mar 2014 23:51 
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 
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="https://www.minibb.com/forums/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
 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.


  ⇑