News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Color & BgColor Clickable BBCode Bar

Started by burtybob, June 03, 2008, 04:14:15 AM

Previous topic - Next topic

burtybob

Quote from: ladynightowl on July 02, 2008, 06:16:33 PM
I just installed this mod (love it), but if anyone is having a hard time with getting the bgcolor tag to work, you need to make the change in the Subs.php file (just like in Karl's, but it wasn't included in this one):

./Sources/Subs.php

Find:


array(
            'tag' => 'hr',
            'type' => 'closed',
            'content' => '<hr />',
            'block_level' => true,
),


Add After:


array(
              'tag' => 'bgcolor',
              'type' => 'unparsed_equals',
              'test' => '(#[\da-fA-F]{3}|#[\da-fA-F]{6}|[A-Za-z]{1,12})\]',
              'before' => '<span style="background-color:$1;">',
              'after' => '</span>',
),


If you don't do that, then there will be no 'bgcolor' option to enable in Posts and Topics > BBCode

Thanks ive update the package now to recognise that little error :/ thats where i am trying to fix something else as well.
If your support topic does not have a link i will NOT assist you.
A link is easy to add AND is a massive help very often.
And a login account would be usefull even if its only pass and user =demo and its a normal account its not hard to add those two pieces of information.

I will do edits for you but not for free :) time costs money.

LLStarks


burtybob

Quote from: LLStarks on July 02, 2008, 06:39:03 PM
yay. now bgcolor works.
Good.

Thanks to ladynighthowl for point that out :D.

I still can only use [bgcolor][/bgcolor] :( i cant see why if everyone elses is fine!?!?
If your support topic does not have a link i will NOT assist you.
A link is easy to add AND is a massive help very often.
And a login account would be usefull even if its only pass and user =demo and its a normal account its not hard to add those two pieces of information.

I will do edits for you but not for free :) time costs money.

LLStarks

well, wouldn't [color] be defined by SMF without the mod? <_<

LLStarks

btw, nice job on adding proper 2.0 support. i do still look forward to wysiwyg support in the future.

LLStarks

#25
also, i'd like to ask how i reenable the drop down. i want to have it in addition to the color picker.


edit: i did it manually by reinserting the following code

if (!isset($context['disabled_tags']['color']))
echo ' <select name="sel_color" id="sel_color" style="margin-bottom: 1ex; font-size: x-small;">
<option value="" selected="selected">', $txt['change_color'], '</option>
<option value="black">', $txt['black'], '</option>
<option value="red">', $txt['red'], '</option>
<option value="yellow">', $txt['yellow'], '</option>
<option value="pink">', $txt['pink'], '</option>
<option value="green">', $txt['green'], '</option>
<option value="orange">', $txt['orange'], '</option>
<option value="purple">', $txt['purple'], '</option>
<option value="blue">', $txt['blue'], '</option>
<option value="beige">', $txt['beige'], '</option>
<option value="brown">', $txt['brown'], '</option>
<option value="teal">', $txt['teal'], '</option>
<option value="navy">', $txt['navy'], '</option>
<option value="maroon">', $txt['maroon'], '</option>
<option value="limeGreen">', $txt['lime_green'], '</option>
</select>';

burtybob

Quote from: LLStarks on July 02, 2008, 11:07:15 PM
also, i'd like to ask how i reenable the drop down. i want to have it in addition to the color picker.


edit: i did it manually by reinserting the following code

if (!isset($context['disabled_tags']['color']))
echo ' <select name="sel_color" id="sel_color" style="margin-bottom: 1ex; font-size: x-small;">
<option value="" selected="selected">', $txt['change_color'], '</option>
<option value="black">', $txt['black'], '</option>
<option value="red">', $txt['red'], '</option>
<option value="yellow">', $txt['yellow'], '</option>
<option value="pink">', $txt['pink'], '</option>
<option value="green">', $txt['green'], '</option>
<option value="orange">', $txt['orange'], '</option>
<option value="purple">', $txt['purple'], '</option>
<option value="blue">', $txt['blue'], '</option>
<option value="beige">', $txt['beige'], '</option>
<option value="brown">', $txt['brown'], '</option>
<option value="teal">', $txt['teal'], '</option>
<option value="navy">', $txt['navy'], '</option>
<option value="maroon">', $txt['maroon'], '</option>
<option value="limeGreen">', $txt['lime_green'], '</option>
</select>';


Yeah that is the only way to really have it...
Ill see what i can do.
Dunno how to set it so that users can choose as im new to mods :D
If your support topic does not have a link i will NOT assist you.
A link is easy to add AND is a massive help very often.
And a login account would be usefull even if its only pass and user =demo and its a normal account its not hard to add those two pieces of information.

I will do edits for you but not for free :) time costs money.

sasawawa


QuoteThe package was installed successfully. You should now be able to use whatever functionality it adds or changes; or not be able to use functionality it removes.

Install successfully, thank you . ;D :D

Migraine


:o  Install worked great... but when I went to uninstall it, so I could try the option without the drop down, it didn't uninstall and is still usable, even though it is no longer listed in my installed packages list...

Also, the image indicating the background option isn't showing up.

Any recommendations??

~M

burtybob

Quote from: Migraine on July 18, 2008, 02:52:22 PM

:o  Install worked great... but when I went to uninstall it, so I could try the option without the drop down, it didn't uninstall and is still usable, even though it is no longer listed in my installed packages list...

Also, the image indicating the background option isn't showing up.

Any recommendations??

~M
Hey sorry to hear about it not uninstalling correctly im not entirely sure why that is.
For the image not showing up try a hard refresh "Ctrl+F5" that has worked for someone else i think it was with this mod also having problems.
If that does not work please let me know and have a link to your forum and a test user to log in with thanks.
If your support topic does not have a link i will NOT assist you.
A link is easy to add AND is a massive help very often.
And a login account would be usefull even if its only pass and user =demo and its a normal account its not hard to add those two pieces of information.

I will do edits for you but not for free :) time costs money.

Migraine

Hi burtybob,   :)

I did try the hard refresh but it didn't seem to help. 

Not sure what's going on now, but I did manage to get it to disappear -- not sure how, unless it was a server issue. However, when I try to reinstall it, now I get two fully functional color bars... LOL 

I'll reinstall and PM you login info so you can see... maybe with any luck, you'll only see one!   :)

~M

God Of Mana

Quote from: Lady Night Owl on July 02, 2008, 06:16:33 PM
I just installed this mod (love it), but if anyone is having a hard time with getting the bgcolor tag to work, you need to make the change in the Subs.php file (just like in Karl's, but it wasn't included in this one):

./Sources/Subs.php

Find:


array(
            'tag' => 'hr',
            'type' => 'closed',
            'content' => '<hr />',
            'block_level' => true,
),


Add After:


array(
              'tag' => 'bgcolor',
              'type' => 'unparsed_equals',
              'test' => '(#[\da-fA-F]{3}|#[\da-fA-F]{6}|[A-Za-z]{1,12})\]',
              'before' => '<span style="background-color:$1;">',
              'after' => '</span>',
),


If you don't do that, then there will be no 'bgcolor' option to enable in Posts and Topics > BBCode
Thanks, this helped


Great mod and thatnks, this helped

LLStarks

Please fix the SQL installation errors for the 2.0 version.

I had to do it manually.

burtybob

Quote from: LLStarks on August 21, 2008, 09:44:20 PM
Please fix the SQL installation errors for the 2.0 version.

I had to do it manually.

I do not know of any SQL errors on the 2.0 since when i installed it on my systems 2.0 it installs fine :/
Please can you give me the error message? Thanks,
Burtybob
If your support topic does not have a link i will NOT assist you.
A link is easy to add AND is a massive help very often.
And a login account would be usefull even if its only pass and user =demo and its a normal account its not hard to add those two pieces of information.

I will do edits for you but not for free :) time costs money.

LLStarks

Compare the install2 routine between your latest release and the previous one.

burtybob

Quote from: LLStarks on August 22, 2008, 08:26:29 AM
Compare the install2 routine between your latest release and the previous one.

With or without the dropdown menu there?
If your support topic does not have a link i will NOT assist you.
A link is easy to add AND is a massive help very often.
And a login account would be usefull even if its only pass and user =demo and its a normal account its not hard to add those two pieces of information.

I will do edits for you but not for free :) time costs money.

LLStarks

install2.php will not function on SMF2.0 unless it is coded as follows

<?php 
/************************************************** 
   COLOR & BGCOLOR BBCODE BAR v3.5 By Ben Burt 
*************************************************** 
            INSTALL 2.PHP 
*************************************************** 
    - creates array 
    - stores our settings in the array 
    - checks the settings table if setting exists 
    - inserts the setting (ignores if already exists 
*/ 
 
// INSTALL SHOULD ONLY BE RUN WITH SMF 
if (!defined('SMF')) 
    include_once(
"SSI.php"); 
 
// CREATE AN ARRAY FOR OUR SETTINGS 
$newSetting = array(); 
 
// NOW ADD OUR SETTINGS TO THE ARRAY 
$newSetting['enable_colorbar'] = '1'
$newSetting['enable_qrcolorbar'] = '1'
 
// CYCLE THROUGH ARRAY ADDING EACH NEW SETTING - IF ALREADY EXISTS, IGNORE 
foreach ($newSetting as $key => $value){ 
     
    
mysql_query(
        INSERT IGNORE 
        INTO smf_settings (`variable`, `value`)    VALUES     ('
$key', '$value')") or die(mysql_error()); 

// tidy up 
unset($newSetting,$key,$value); 
 
?>

LLStarks

#37
Also, in SMF2.0 Beta 4, GenericControls.template.php has an added color, white.

burtybob

Quote from: LLStarks on September 03, 2008, 07:10:39 PM
Also, in SMF2.0 Beta 4, GenericControls.template.php has an added color, white.
Thanks for that, but also you do know that mysql_query is not used in SMF for compatability reasons.
Also as far as i can see that is the only change from my code to your install2.php is that one query. when tested myself i found that MY way did indeed work.
If your support topic does not have a link i will NOT assist you.
A link is easy to add AND is a massive help very often.
And a login account would be usefull even if its only pass and user =demo and its a normal account its not hard to add those two pieces of information.

I will do edits for you but not for free :) time costs money.

LLStarks

Your install2.php does not work on either of my 2.0 Beta 3.1 boards. Doesn't work on Beta 4 either.

Advertisement: