• Welcome to ForumKorner!
    Join today and become a part of the community.

Color changes

Michael

Member
Reputation
1
Hey!

I'd like to see this implemented, if possible. For thread designs, we click the little 'A' to change the color of certain text and it looks like this:

S2kZcUn.png


It is really annoying because there are so many colors that we could use that aren't there. I was wondering if we could have this:

http://www.colorpicker.com

We can choose absolutely any color we want and the hexadecimal code is already there!

Thoughts?
 

Professor

Active Member
Reputation
0
It's not that easy bub.

Do we even have a coder for the site? Other than @Philly that is.
 

Michael

Member
Reputation
1
Roy said:
It's not that easy bub.

Do we even have a coder for the site? Other than @Philly.

I never stated or asked if it was easy or not. There are members here that can code this quite easily, it's not something I want right this instant, I want member opinions.
 

Astro

User is banned.
Reputation
0
Nice suggestion, I wonder who you stole it from.

Roy said:
It's not that easy bub.

Do we even have a coder for the site? Other than @Philly that is.

There should be a MyBB Plugin out there for something like this. I can't imagine that this hasn't been made before.
 

Michael

Member
Reputation
1
Astro said:
Nice suggestion, I wonder who you stole it from.


There should be a MyBB Plugin out there for something like this. I can't imagine that this hasn't been made before.

I didn't steal this from you, mate.
 

Prepare

Power member.
Reputation
0
You can use Hex Codes of any color. But it would be a little easier to have a wheel or something.
 

Sector

Power member.
Reputation
0
We honestly don't really need more colors. No one even uses all the colors as it is. I think it'd just be a waste of a plug-in for once.
 

Sapphire

Power member.
Reputation
0
I mean every basic color is there, although I see what you're getting at.

I would love to see a new change in this, but honestly don't believe the site needs it.
 

Jimmy

Ex-Staff Member
Reputation
0
Requires editing the post editor and integrate the color picker API with it. This has never been done before, so I can't say if it's possible.
 

Professor

Active Member
Reputation
0
I believe this is what you were wanting. You're welcome.

This will add Color Hex Validation in Nickman's Form Manager 2.0 Plugin.
In the plugin files, open:

admin/modules/config/forms.php

and find all instances of (there are four):
Code:
"5"=>"All letters"

Change them to:
Code:
"5"=>"All letters","6"=>"A Color Hex"

Save the file and close. Now open:

forms.php (included to be uploaded in the site root).

and find this at near-about line no. 602:
Code:
if ($items[$name]['type'] == 5)
 {
 validate_letters($name,$value);
 }

Add just after that (before final closing curly brace '}' of 'validate' function:
Code:
if ($items[$name]['type'] == 6)
 {
 validate_colorhex($name,$value);
 }

Now find this function near about line no. 645:
Code:
function validate_numeric($name,$value)
{
 if (!is_numeric($value))
 {
 form_error("The field $name was not a number");
 }
}

Add just after that:
Code:
function validate_colorhex($name,$colhex)
{
 if (!preg_match("/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/",$colhex))
 {
 form_error("The field $name was not a valid color hex code");
 }
}

Save the file and close. Re-upload two modified files, activate the plugin.
Now you have additional option for the fields with Color Hex Validation.
 
Top