MyBB Community Forums

Full Version: Color picker script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everyone Smile

I'm making a theme and I'm attempting to integrate a color picker script into it so users can morph the theme into virtually any color scheme they want. Problem is, it isn't really working out.

I have downloaded all the files from here http://www.eyecon.ro/colorpicker/ , and uploaded them.

I know there is already a thread on here involving this script and also one on mybbsecurity.net that's linked to from the thread on here. I have tried following the instructions in both threads and also the site where I downloaded the needed files from, but failed miserably. Somehow I just can't get this thing to work. First I got the color picker to appear in my theme's header, but it didn't work to change the theme's colors with it. Then when I tried again the color picker wouldn't even show up, then it did show up but I couldn't click on it.

So the needed files are uploaded. Does anyone happen to know what exactly to put into the headerinclude template to get this to work correctly on a mybb theme?

Any help would be greatly appreciated Smile

Many thanks in advance.
colorpicker.js and colorpicker.css should be added to headerinclude template
edit: obviously jQuery should also be included
(2013-05-06, 03:02 PM).m. Wrote: [ -> ]colorpicker.js and colorpicker.css should be added to headerinclude template

Thanks. I figured that lol

Surely that's not all is it? Apart from the links to the needed jscript and css files, I know there are specific pieces of javascript code as well that need to be added to the headerinclude, like code that will make the color picker work with mybb to change the theme's colors (or am I wrong?). From what I understand there is a bunch of code to add to the headerinclude to make this work. I just can't get anything right Blush
^ excuse me for the obvious response. I could not rectify it in reasonable time.
Quote:Invocation code
All you have to do is to select the elements in a jQuery way and call the plugin.
$('input').ColorPicker(options);
so jQuery function should be included in headerinclude template - that can be included through another js file

(changing colors with jquery with a color picker)
I'm inclined to give up. Is there anything that needs to be set or changed in any of the downloaded files?
jQuery color picker + MyBB = Flashing on page load.

I'd suggest using regular JS, combined with a css.php file. here are some tutorials that can help:

http://www.barelyfitz.com/projects/csscolor/
http://css-tricks.com/css-variables-with-php/
http://stackoverflow.com/questions/60066...den-in-php


Though if you'd just prefer the easiest method you're on the right track.
my Subject Color plugin uses Prototype code to launch a color picker, and several of the libraries are already included with MyBB's use of scriptaculous