Go Back   vBulletin Modification Discussions > vBulletin Discusions > vBulletin Modifications
Home Register FAQ Members List Calendar Mark Forums Read
vBSEO Info Tags

About This Page: This is a discussion on How to limit / select the numbers of colors in BB Code ? within the vBulletin Modifications forums, part of the vBulletin Discusions category, at vBulletin Modification Discussions. Hello, I have posted this trouble in other forums but I could not get a solution... I hope I will get here some answers. I have dark and light skins installed and when posting, if it is used the default


Reply
 
LinkBack Thread Tools
Old 10-24-2006, 02:49 PM   #1 (permalink)
Junior Member
 
Join Date: Oct 2006
Posts: 14
DigitALL is on a distinguished road
iTrader: (0)
Arrow How to limit / select the numbers of colors in BB Code ?

Hello,

I have posted this trouble in other forums but I could not get a solution... I hope I will get here some answers.
I have dark and light skins installed and when posting, if it is used the default text color, the post appears fine under each skin.
Here is my problem: for example, a member posts a text with grey color text to have a better contrast under the dark skin he prefers. But under a light skin where the background is light grey, the same text could be hardly seen.
Example: this message is written in default color but as you can use "this color" or "this color" or "this color" are not so visible anymore.
For that reason I have disabled the the "Allow Color BB Code" from ACP/Options/BB Code Settings so the members could post only in a default color. This looks fine but many members told me that they want the colors back, or at least few of them.

Further to my search I found that the file "vbulletin_cpcolorpicker.js" found in /forum/clientscript/ has a definition of the color array. I have randomly modified this file and in a point to eliminate it but the color and the pallete was still there. If you take a look at it, that's the one but the problem is probably not the only one...

I found that there are few colors that could be used under all skins.
How can I edit the color palette/array for text and use only the colors I want? The palette has currently 40 colors displayed. I wish to have displayed say only eight (one row). Is there a hack or info on how to control these colors?
DigitALL is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links

Old 10-26-2006, 09:36 AM   #2 (permalink)
Junior Member
 
Join Date: Jun 2006
Posts: 23
Alfarin is on a distinguished road
iTrader: (0)
I'm not aware of any hacks for this. And long story short, it's not just a matter of JS edit, but a php edit on the default vBulletin files as well as deploying your own custom algorithm to decide what to do when you have a color that is not allowed.

I think you might be able to find someone to make a custom hack for this either here or on vBulletin.org. Though, I'm too busy to code hacks lately.
Alfarin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-26-2006, 08:27 PM   #3 (permalink)
Administrator
 
Code Monkey's Avatar
 
Join Date: May 2006
Posts: 2,203
Code Monkey is on a distinguished road
iTrader: (0)
vBORG has always had it turned off, so I assume it's not an easy task.
__________________
Please do not PM me unless it's personal. General vBulletin or mod questions by PM will be ignored.

Try the vBSEO Demo

Click here for Instant Community
Code Monkey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-27-2006, 09:22 AM   #4 (permalink)
Junior Member
 
Join Date: Oct 2006
Posts: 14
DigitALL is on a distinguished road
iTrader: (0)
What it amazes me is that vBulletin provides colors that you will never use and also if you use a certain color (see my first msg) you will not be able to read it. It should be correct for them to provide info on how to adjust those.
Yes Alfarin, you are right, probable it is a PHP too but I'm not a coder. Anyway, I did something and wish to write it here, hopefully somebody will come with more complete info on how to do it, or why not, a nice hack. I will post it in other similar forums too.

I was suggested to look into "vbulletin_textedit.js" and find the color HEX defintion.

In this file you will find the original code as:

Code:
* Define available color name options - keyed with hex value
*
* @var	array	Color options
*/
var coloroptions = new Array();
coloroptions = {
	'#000000' : 'Black',
	'#A0522D' : 'Sienna',
	'#556B2F' : 'DarkOliveGreen',
	'#006400' : 'DarkGreen',
	'#483D8B' : 'DarkSlateBlue',
	'#000080' : 'Navy',
	'#4B0082' : 'Indigo',
	'#2F4F4F' : 'DarkSlateGray',
	'#8B0000' : 'DarkRed',
	'#FF8C00' : 'DarkOrange',
	'#808000' : 'Olive',
	'#008000' : 'Green',
	'#008080' : 'Teal',
	'#0000FF' : 'Blue',
	'#708090' : 'SlateGray',
	'#696969' : 'DimGray',
	'#FF0000' : 'Red',
	'#F4A460' : 'SandyBrown',
	'#9ACD32' : 'YellowGreen',
	'#2E8B57' : 'SeaGreen',
	'#48D1CC' : 'MediumTurquoise',
	'#4169E1' : 'RoyalBlue',
	'#800080' : 'Purple',
	'#808080' : 'Gray',
	'#FF00FF' : 'Magenta',
	'#FFA500' : 'Orange',
	'#FFFF00' : 'Yellow',
	'#00FF00' : 'Lime',
	'#00FFFF' : 'Cyan',
	'#00BFFF' : 'DeepSkyBlue',
	'#9932CC' : 'DarkOrchid',
	'#C0C0C0' : 'Silver',
	'#FFC0CB' : 'Pink',
	'#F5DEB3' : 'Wheat',
	'#FFFACD' : 'LemonChiffon',
	'#98FB98' : 'PaleGreen',
	'#AFEEEE' : 'PaleTurquoise',
	'#ADD8E6' : 'LightBlue',
	'#DDA0DD' : 'Plum',
	'#FFFFFF' : 'White'
};
Then I started to change the colors definiton and noticed the palette it still display 40 squares but some colors are the same. Then I replaced the word "White" with "DeepSkyBlue" but with the same HEX and noticed that instead of 40 colors palette, I have 39.
I went further with the mods and I currently have only 12 colors left. I realize that this is just trial and error.

I have finalized the script to this form:

Code:
* Define available color name options - keyed with hex value
*
* @var	array	Color options
*/
var coloroptions = new Array();
coloroptions = {
	'#708090' : 'Black',
	'#A0522D' : 'Sienna',
	'#696969' : 'DarkOliveGreen',
	'#008080' : 'DarkGreen',
	'#0000FF' : 'DarkSlateBlue',
	'#0000FF' : 'Navy',
	'#FF00FF' : 'Indigo',
	'#696969' : 'Black',
	'#FF0000' : 'DarkRed',
	'#FF8C00' : 'DarkOrange',
	'#808000' : 'Olive',
	'#008000' : 'Green',
	'#008080' : 'Teal',
	'#0000FF' : 'Blue',
	'#708090' : 'SlateGray',
	'#696969' : 'DimGray',
	'#FF0000' : 'Red',
	'#F4A460' : 'SandyBrown',
	'#9ACD32' : 'YellowGreen',
	'#2E8B57' : 'SeaGreen',
	'#48D1CC' : 'MediumTurquoise',
	'#4169E1' : 'RoyalBlue',
	'#FF00FF' : 'Purple',
	'#808080' : 'Gray',
	'#FF00FF' : 'Magenta',
	'#FF8C00' : 'Orange',
	'#9ACD32' : 'YellowGreen',
	'#9ACD32' : 'Lime',
	'#00FFFF' : 'RoyalBlue',
	'#00BFFF' : 'DeepSkyBlue',
	'#9932CC' : 'DarkOrchid',
	'#808080' : 'Blue',
	'#808080' : 'Pink',
	'#808080' : 'Wheat',
	'#808080' : 'LemonChiffon',
	'#808080' : 'Magenta',
	'#808080' : 'PaleTurquoise',
	'#808080' : 'SeaGreen',
	'#808080' : 'Plum',
	'#48D1CC' : 'DeepSkyBlue'
};
Obviously this script relates to another script. I wanted to get rid of black and in fact it is not in the pallete anymore but it still is in the reference color. See the final in the attached image. The colors are oke now to be used under multiple skins BUT the black still appears under "A" (color selection) and by just pressing the button without displying the palette, the black is still there.

privatesat dot com/PrivateSAT_Files/img1.jpg

Ooops! I can not post a pic. Again that forum restriction that you must have minimum 10 post to post a link... like other with less posts will have nothing valuable to post...
However, perhaps this gives some ideas to others...
DigitALL is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply
Tags: , , , ,





Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


A vBSkinworks Design Recoded By vBModder.
All Code Distributed On This Site is © 2006 by it's author.
Search Engine Optimization by vBSEO 3.1.0

All times are GMT -7. The time now is 02:34 PM.
Online Users 42
Registered 2
Guests 40
Members 3364
Active Members 219
Threads 1687
Posts 7143
Top poster: Code Monkey (2203)
Welcome to our newest member, abstrakt
Most users ever online was 235, 04-11-2007 at 08:59 AM.
Speak Out! vBulletin gets the web talking!


vBulletin Setup SEO

vBulletin graphics resource images