Home  | FAQ  | Search  | Memberlist  | Usergroups  | Register  | Profile  | Log in  | Log in for your private messages
How 2 add Font Color BBCode to myBloggie

Post new topic   Reply to topic    myWebland Forum Index -> Customization
View previous topic :: View next topic  
Author Message
Site Admin

Joined: 14 Jul 2004
Posts: 671

PostPosted: Mon Jun 12, 2006 2:25 pm    Post subject: How 2 add Font Color BBCode to myBloggie Reply with quote

This post teach you on how to add bbcode for font color to myBloggie. Please follow the below instruction carefully

1) Back-up the follow files before your proceed
- function.php ( directory : "includes/" )
- add.php ( directory : mybloggie's root" )
- edit.php ( directory : mybloggie's root" )
- formsubmit.tpl ( directory : "templates/{style or theme used}/admin/" )

2) create a new file in the "includes/" directory named : color-list.php
copy & paste the following into that file & save it


if ( !defined('IN_MYBLOGGIE') )
    die("You are not allowed to access this page directly !");

$no_of_colors = 24;























$color[23]['colorcode']='#800000' ;



3) Open function.php

in the function viewbbcode($message); , look for return substr($message, 1);

Paste the below before -> return substr($message, 1);

    // Font colours
    $bb_tpl['color_open']   =  "<span style=\"color: {COLOR_CODE}\">";
    $bb_tpl['color_close']  =  "</span>";
    $bb_tpl['color_open'] = str_replace('{COLOR_CODE}', '\\1', $bb_tpl['color_open']);
    $message = preg_replace("/\[color=(\#[0-9A-F]{6}|[a-z]+)\]/si", $bb_tpl['color_open'], $message);
    $message = str_replace("[/color]", "</span>", $message);

4) Open formsubmit.tpl insert this before </div>. Should be somewhere between line 55 & 56.

                    <select style="background-color:none" name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver="helpline('s')">
                      <option class="options" style="color:#606060; background-color:#606060" value="{L_DEFAULT}" title="{L_DEFAULT}">{L_DEFAULT}</option>
                    <!-- BEGIN coloroptions -->
                      <option style="color:{coloroptions.CLR_CODE}; background-color:{coloroptions.CLR_CODE}" value="{coloroptions.CLR_CODE}" title="{coloroptions.CLR_NAME}">{coloroptions.CLR_NAME}</option>
                    <!-- END coloroptions -->

4) Open add.php & edit.php

add below into both file just before ->if (isset($_POST["preview"])){

include ($mybloggie_root_path.'includes/color-list.php');
for ($i=1; $i<($no_of_colors+1); $i++) {
 $template->assign_block_vars('coloroptions', array(
          'CLR_CODE'        => $color[$i]['colorcode'],
          'CLR_NAME'        => $color[$i]['colorname'],


Try it & feedback in there is any problem
Back to top
View user's profile Send private message Send e-mail

Joined: 03 Jun 2006
Posts: 6

PostPosted: Mon Jun 12, 2006 4:49 pm    Post subject: Yestested. Some feedback! Reply with quote

Hello Sean,
inserted in Mybloggie beta and previous and it works!

Some feedback:
I took some time to find where is the color field chooser:
To improve usability please write in that fields something like the other choosers [COLOR] or [COL] also when it is not choosed. It's a lot easier and more noticeable.

2) there is a tiny error, a redundance:
I find two similar colors: GRAY and GREY with the same hex color chooser.

So solutions are
a) to choose two different kinda greys like i did
(light grey 808080, dark grey 363636). It's simple and I modified the code by myself in color-list.php
b) cut away one gray.

Obviously, I prefer the previous solution. More colours more fun and it's so simple to customize personal colors.

So Sean, c'mon and hold on tight on this cool project. As I can test I can help you. When yoiu need an italian translation consider me first. This can expand your excellent script.
I'm still consider to modify and customize deeply more on my sites. You will know ASAP.

My sites currently running with your scripts are:

Yeah dude, still consider me for this kinda testing and more.
And when you will do the links on Titles I will donate to you 20US$ for friendships.
Feel free to write me anytime!

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    myWebland Forum Index -> Customization All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Error. Page cannot be displayed. Please contact your service provider for more details. (9)

Powered by phpBB © 2001, 2005 phpBB Group
Contact Us