News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

New Forum Colors

Started by float4life, January 14, 2012, 07:44:51 PM

Previous topic - Next topic

float4life

When you create a post, I was wondering if there is anyway to add more colors when you click the Change Color thing. If not that is there anyway I can color text using some kind of BBcode that is for HTML color coding?

Arantor

The color bbcode can work on any colour you care to imagine.

[color=#000038]The color bbcode can work on any colour you care to imagine.[/color]

So, given that you can use HTML colours, what did you want to do exactly?

float4life

Quote from: arrowtotheknee on January 14, 2012, 07:47:23 PM
The color bbcode can work on any colour you care to imagine.

[color=#000038]The color bbcode can work on any colour you care to imagine.[/color]

So, given that you can use HTML colours, what did you want to do exactly?
On the drop down menu, I wanted to add colors so I can make a text color that matches my forum's themes.

Arantor



Arantor

I was kind of hoping you'd actually tell me what the colours themselves are... since it's a change to the raw PHP in one of the templates.

float4life

Quote from: arrowtotheknee on January 14, 2012, 07:52:53 PM
I was kind of hoping you'd actually tell me what the colours themselves are... since it's a change to the raw PHP in one of the templates.
Do you want to know the exact color code it is? If so: #0099ff

Arantor

Yes, I did - and I need to know what name it is you're wanting to use to list.

float4life

Quote from: arrowtotheknee on January 14, 2012, 07:59:55 PM
Yes, I did - and I need to know what name it is you're wanting to use to list.
Light Blue?

Arantor

OK, let's do this.

Find Themes/default/GenericControls.template.php, this code:
if (!isset($context['disabled_tags']['color']))
echo ',
{
sType: \'select\',
sName: \'sel_color\',
oOptions: {
\'\': ', JavaScriptEscape($txt['change_color']), ',
\'black\': ', JavaScriptEscape($txt['black']), ',
\'red\': ', JavaScriptEscape($txt['red']), ',
\'yellow\': ', JavaScriptEscape($txt['yellow']), ',
\'pink\': ', JavaScriptEscape($txt['pink']), ',
\'green\': ', JavaScriptEscape($txt['green']), ',
\'orange\': ', JavaScriptEscape($txt['orange']), ',
\'purple\': ', JavaScriptEscape($txt['purple']), ',
\'blue\': ', JavaScriptEscape($txt['blue']), ',
\'beige\': ', JavaScriptEscape($txt['beige']), ',
\'brown\': ', JavaScriptEscape($txt['brown']), ',
\'teal\': ', JavaScriptEscape($txt['teal']), ',
\'navy\': ', JavaScriptEscape($txt['navy']), ',
\'maroon\': ', JavaScriptEscape($txt['maroon']), ',
\'limegreen\': ', JavaScriptEscape($txt['lime_green']), ',
\'white\': ', JavaScriptEscape($txt['white']), '
}
}';


Replace with:
if (!isset($context['disabled_tags']['color']))
echo ',
{
sType: \'select\',
sName: \'sel_color\',
oOptions: {
\'\': ', JavaScriptEscape($txt['change_color']), ',
\'black\': ', JavaScriptEscape($txt['black']), ',
\'red\': ', JavaScriptEscape($txt['red']), ',
\'yellow\': ', JavaScriptEscape($txt['yellow']), ',
\'pink\': ', JavaScriptEscape($txt['pink']), ',
\'green\': ', JavaScriptEscape($txt['green']), ',
\'orange\': ', JavaScriptEscape($txt['orange']), ',
\'purple\': ', JavaScriptEscape($txt['purple']), ',
\'blue\': ', JavaScriptEscape($txt['blue']), ',
\'beige\': ', JavaScriptEscape($txt['beige']), ',
\'brown\': ', JavaScriptEscape($txt['brown']), ',
\'teal\': ', JavaScriptEscape($txt['teal']), ',
\'navy\': ', JavaScriptEscape($txt['navy']), ',
\'maroon\': ', JavaScriptEscape($txt['maroon']), ',
\'limegreen\': ', JavaScriptEscape($txt['lime_green']), ',
\'white\': ', JavaScriptEscape($txt['white']), ',
\'#0099ff\': "Light Blue"
}
}';


Works just fine on local install.

float4life

Thank you very much. By the way, I was wondering if you knew how I could make it to where there is a default text color for each membergroup?

Arantor

How changeable are we talking about? Would the user be able to change it easily?

float4life

Quote from: arrowtotheknee on January 14, 2012, 08:25:56 PM
How changeable are we talking about? Would the user be able to change it easily?
Yes. Evertime you post, it has a default text color (before you select your own color from the Change Color dropdown). What I'm wanting to do is make it to where every member group has a certain default text color, but they can still select the drop down menu to change it to any color they like.

Arantor

There's no 'very good' way to do that, but a variety of less wonderful but workable ways. The one that first came to mind was to simply inject a color bbc into the editor box when starting out, but that would possibly be not that intuitive (and be confusing) and users might just delete it anyway.

Thing is, I've seen it done in two situations: one, where the staff have a colour, different to the users - and no-one can change colours, and two, where users have all sorts of different colours, and it looks either a mess, or users just override it with their own choice of colour anyway.

float4life

Quote from: arrowtotheknee on January 14, 2012, 08:34:58 PM
There's no 'very good' way to do that, but a variety of less wonderful but workable ways. The one that first came to mind was to simply inject a color bbc into the editor box when starting out, but that would possibly be not that intuitive (and be confusing) and users might just delete it anyway.

Thing is, I've seen it done in two situations: one, where the staff have a colour, different to the users - and no-one can change colours, and two, where users have all sorts of different colours, and it looks either a mess, or users just override it with their own choice of colour anyway.
That's what I'm kind of wanting. If the the only way to do this is having it where staff can only use one color that they can't override, that would be fine to me.

Arantor

If they can't override it, why bother having the color bbcode in the first place? On the forums where the staff have a colour they can't override, no-one can use any colours, otherwise you get idiots trying to impersonate staff by using the same colour as the staff, and staff can override it anyway.

So, before getting into that, are you planning on turning off color bbcode generally?

float4life

No. I want it to where the default text, before you even select a color is a certain color for each member group. The color that the staff members use will NOT be in the drop down list for the colors. But yet, I still want BBcode to be available.

Arantor

That seems to be contrary to what you just said above, that staff can only use one colour they can't override... because they can just use the bbcode to override it!

* arrowtotheknee is having trouble understanding exactly what you're trying to achieve, especially since on any active forum the 'rainbow effect' doesn't normally look good.

float4life

Quote from: arrowtotheknee on January 14, 2012, 08:52:21 PM
That seems to be contrary to what you just said above, that staff can only use one colour they can't override... because they can just use the bbcode to override it!

* arrowtotheknee is having trouble understanding exactly what you're trying to achieve, especially since on any active forum the 'rainbow effect' doesn't normally look good.
Well, I'm quite sorry if it is hard for you do understand what I want to accomplish. But here, I'll try to make it clear:
I want to add a feature to where member groups have a default text color before they use BBcode or whatever. Each group will have a different color.
For example: Admininstrators - Red, Moderators - Purple, Regular Members - Blue

If the user wishes to, they can use BBcode/The dropdown list to change their color.

Arantor

So let me get this straight... colour per group (straightforward enough)

And that colour shouldn't be changeable by the group (so that a general moderator can't just decide that by default all moderators' posts will henceforth be green)...

And that if (for example) a moderator wants to use blue for their entire post, they can just use the color bbcode at the start to override the entire post?

And that if (for example) a regular member wants to use red for their entire post to look like an admin's post, they can?

Advertisement: