View Full Version : Post Background Color
Marco van Herwaarden
12-05-2005, 10:00 PM
Post Background Color - Version 1.03b
Hack: Post Background Color
Version: v1.03b
Author: MarcoH64
Description
Create Color Schemes, set specific colors for different styles to match the styles colors the best. Give usergroups permissions to attach
a color scheme as background to a post. Great to allow Admins/Moderators to highlight important posts in a thread for example.
Features
- Create Color Schemes
- Override the default color for a Color Scheme for each Style if needed.
- User Usergroup permissions to allow/deny the use of background colors
- On posting/editing, optionally choose a background color
- Choose (vB Options) if you want the background color to be applied to the messagetext, the postbit info, or both.
- Create background images or gradients (thanks to applehat for the idea ;))
Changelog:
17-7-2006 v1.03b
- Fixed uninstall code. Space was missing in the DELETE FROMdatastore.
(if you have currently installed 1.03, then please do an overwrite install with version 1.03b prior to uninstallation. If you are already uninstalling with 1.03 and run into a SQL-error, see post https://vborg.vbsupport.ru/showpost.php?p=1032141&postcount=33 (https://vborg.vbsupport.ru/showpost.php?p=1032141&postcount=33) to fix an aborted uninstall)
7-12-2005 v1.03
- Increased size of colorcode in tables to support larger values so we can also use images and gradients
- Changed the postbit from background-color to background style attribute to support the above.
7-12-2005 v1.02
- Removed   from dropdown menu
- Fixed bug where colorscheme could not be reset to 'None' once a color was set.
5-12-2005 v1.01
- Fixed missing new column for post table in install routines.
5-12-2005 v1.00
- Initial Release
Notes
Copyright ?2005 MarcoH64
This Modification may not be redistributed in whole or significant part or changed without prior agreement of author.
Please don't forget to click Install.
If you like this work and would like to support the author, donations are always welcome at Paypal: Marcoh64 AT gmail.com
Marco van Herwaarden
12-06-2005, 01:31 PM
Reserved
Alan @ CIT
12-06-2005, 01:33 PM
Nice work mate :)
Flow Fusion
12-06-2005, 02:54 PM
Very nice I will install.
Marco van Herwaarden
12-06-2005, 04:15 PM
Did you also add some color schemes?
PS I will be gone out of the country in an hour, so i won't be able to give more support until next week.
Marco van Herwaarden
12-06-2005, 05:08 PM
lol, now I get this error..
Database error in vBulletin 3.5.1:Install code was missing a new column in the post table. Version 1.01 with updated install code released. Just do an overwrite install.
Also, my dropdowns are showing up as:
 Highlight
 Warning
Sorry no time to look into this anymore. It is probably a left over from an attampt to show the colors in the dropdown (which didn't work, somehow the colors didn't show).
Will remove this when i come back.
apdcanari
12-06-2005, 06:03 PM
Error
$mh_pbc_color_scheme_picker_options .= "<option value=\"$mh_pbc_colorschemeid\" $selected><span style=\"background-color: $colorscheme\">A </span>[COLOR=Red] $colorscheme[title]</option>";
Change
$mh_pbc_color_scheme_picker_options .= "<option value=\"$mh_pbc_colorschemeid\" $selected><span style=\"background-color: $colorscheme[colorcode]\">A </span>$colorscheme[title]</option>";
applehat
12-06-2005, 07:07 PM
Attached is the product XML with the above fix done to it.
applehat
12-06-2005, 07:17 PM
BUG: If you try and turn it back to NONE, it will not let you.
A Temp. Fix would be to add your alt2 (or alt 1) color as a selection called Default or something to that extent.
Marco van Herwaarden
12-07-2005, 06:54 AM
Version 1.02 released:
6-12-2005
- Removed   from dropdown menu
- Fixed bug where colorscheme could not be reset to 'None' once a color was set.
5-12-2005 v1.01
- Fixed missing new column for post table in install routines.
5-12-2005 v1.00
- Initial Release
(Yes i still have not left for my trip :()
Marco van Herwaarden
12-07-2005, 06:54 AM
Oops i got my dates wrong, add 1 day to each date in changelog :D
applehat
12-07-2005, 07:03 PM
pfft. No "Thanks Applehat for pointing this out"
haha, jk. Will update now.
Marco van Herwaarden
12-07-2005, 07:08 PM
Lol was a bit in a hurry posting the update.
Ofcourse no fixes without people reporting bugs, so thanks applehat (lol what a name).
Marco van Herwaarden
12-07-2005, 07:10 PM
Does anybody have an example of a good usage for this hack?
applehat
12-07-2005, 07:12 PM
haha....I thought it was cool, but have not used it yet....
Maby to highlight some post? Like I run a board with Indoor Tanning information, and i could use it to highlight usefull posts or something.
Realy dont know, just looked cool :-)
applehat
12-07-2005, 07:15 PM
You know what would be a nice add on? Not just being able to set a background color, but being able to set a background image...and how to repeat and align it...
Or can this already be done by doing url("blah")?
applehat
12-07-2005, 07:17 PM
Just try'd...nope :-P
applehat
12-07-2005, 07:19 PM
Also, this works fine in 3.5.2...so you can update the hack info.
Marco van Herwaarden
12-07-2005, 07:35 PM
haha....I thought it was cool, but have not used it yet....
Maby to highlight some post? Like I run a board with Indoor Tanning information, and i could use it to highlight usefull posts or something.
So you're going to Tan some posts. :D
Lol i made this after someone was requesting/talking about this a couple of weeks ago. More just as an excercise. I can't even find the thread of the user who was once requesting it.
dan35
12-07-2005, 07:43 PM
A background image? cool ;)
Marco van Herwaarden
12-07-2005, 07:55 PM
Version 1.03 released:
7-12-2005 v1.03
- Increased size of colorcode in tables to support larger values so we can also use images and gradients
- Changed the postbit from background-color to background style attribute to support the above.
To upgrade, simply choose an overwrite install.
Marco van Herwaarden
12-07-2005, 07:57 PM
You know what would be a nice add on? Not just being able to set a background color, but being able to set a background image...and how to repeat and align it...
Or can this already be done by doing url("blah")?
It does now. :D
Install version 1.03 and try for example:
#869BBF url(images/gradients/gradient_tcat.gif) repeat-x top left
or:#869BBF url(images/misc/vbulletin3_logo_grey.gif) repeat-x top left
Reeve of shinra
02-03-2006, 01:58 AM
2 stupid questions:
- will this work on the latest version?
- does this mean I can set a different background for usergroups a, b, c & d? Can I prevent the user changing that?
Okay I liked one more:
- I plan to use this with secondary usergroups, how will that work?
Registered = style a
|-- public usergroup b = style b
|-- public usergroup c = style c
Can I have a default in case of conflict like them being part of 2 usergroups?
thanks
hiiped
02-03-2006, 03:13 AM
It does now. :D
Install version 1.03 and try for example:
#869BBF url(images/gradients/gradient_tcat.gif) repeat-x top left
or:#869BBF url(images/misc/vbulletin3_logo_grey.gif) repeat-x top left
??????
is this suppose to allow the allowed usergroup to use an IMaGe instead of colors ?
if so, where are we supposed to add/put this ?
or what needs to be edited to have that option
( make instruction n00b proof ) :)
Thanks in advance
Marco van Herwaarden
02-03-2006, 07:16 AM
- will this work on the latest version?Not tested by me, but i see no reason why not.
- does this mean I can set a different background for usergroups a, b, c & d? Can I prevent the user changing that?It should merge the permissions to use Color Schemes if using seconday usergroups. Not tested this now since i am not at my development PC.
Can I have a default in case of conflict like them being part of 2 usergroups?There is no option to force a (default) color. Default is always None, in which case it will be a regular post.
is this suppose to allow the allowed usergroup to use an IMaGe instead of colors ?Yes you can use this to put a simple background color, an image or even a gradient. This is plain HTML, sorry i can't help you much with that since my HTML knowledge is also limited. Maybe someone else can post some nice examples.
hiiped
03-04-2006, 01:36 AM
Im trying to edit to allow user to add an image from a URL as background in post
< no success *sighs* >
where are the HTML geeks ? ;)
Nathan2006
07-15-2006, 11:52 PM
I have tried installing this but not working for me :(
So after trying to un-install the product I am getting this error:
Database error in vBulletin 3.5.4:
Invalid SQL:
ALTER TABLE post DROP COLUMN mh_pbc_colorschemeid;
MySQL Error : Can't DROP 'mh_pbc_colorschemeid'; check that column/key exists
Error Number : 1091
Date : Saturday, July 15th 2006 @ 08:48:54 PM
Script : http://www.************.com/admincp/plugin.php
Referrer : http://www.************.com/admincp/plugin.php?do=productdelete&productid=mh_pbc&s=
IP Address : ************
Username : ****
Classname : vb_database
Thank you for any help :)
chkdgate
07-16-2006, 06:57 AM
^^I'm interested in this as well but didn't the author mention that he wasn't sure it worked on the latest version?(3.5.4)
Nathan2006
07-16-2006, 01:08 PM
^^I'm interested in this as well but didn't the author mention that he wasn't sure it worked on the latest version?(3.5.4)
Yeah Im not sure but it does not work for me on 3.54 and I cannot remove the product now :(
chkdgate
07-16-2006, 04:04 PM
Did you try reverting your templates?
Nathan2006
07-16-2006, 04:13 PM
Did you try reverting your templates?
Hi,
before I make any changes to code I always take a full copy of the
code then if I get any problems I just delete all the code from
the template and replace it all with the original code ;)
This is something to do with the uninstall of the product not he templates :(
And because I am not a coder I don't know how to uninstall it :(
chkdgate
07-16-2006, 05:45 PM
PM the author of this hack. I don't want to tell you to do something and then mess up your board. Let me know what happens.
Marco van Herwaarden
07-17-2006, 12:18 PM
I have tried installing this but not working for me :(
So after trying to un-install the product I am getting this error:
Database error in vBulletin 3.5.4:
Invalid SQL:
ALTER TABLE post DROP COLUMN mh_pbc_colorschemeid;
MySQL Error : Can't DROP 'mh_pbc_colorschemeid'; check that column/key exists
Error Number : 1091
Date : Saturday, July 15th 2006 @ 08:48:54 PM
Script : http://www.************.com/admincp/plugin.php
Referrer : http://www.************.com/admincp/plugin.php?do=productdelete&productid=mh_pbc&s=
IP Address : ************
Username : ****
Classname : vb_database
Thank you for any help :)I have looked into this and there is a space missing from one of the uninstall steps causing a SQL-error. The error you quoted however can only happen if you try to uninstall twice. You would have gotten a different error the first time.
To fix your current situation (this only applies if you tried to uninstall twice, will upload a fixed version in a few minutes for those that still have to start uninstallation), do the following:
Go to AdminCP->Plugin System->Manage Products, then:
- Select 'Edit' from the dropdown menu behind the Post Background Color product.
- On the edit page you will find 3 rows with each 2 columns with install/uninstall code.
- The right column contains the uninstall codes
- Change the uninstall for version 1.00 (the first row) to contain only (overwrite the current code):
// Clean Datastore
$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "datastore WHERE title = 'mh_pbc'");
- Remove all the code from the version 1.01 uninstall code box (right column, second row)
- Save the product (use the bottom Save button!)
Uninstall again.
Nathan2006
07-17-2006, 12:31 PM
Which code do I need to replace?
Uninstall code version 1.00
// Drop mh_pbc_colorscheme
$vbulletin->db->query_write("DROP TABLE " . TABLE_PREFIX . "mh_pbc_colorscheme");
// Drop mh_pbc_stylecolor
$vbulletin->db->query_write("DROP TABLE " . TABLE_PREFIX . "mh_pbc_stylecolor");
// Drop usergroup permissions
$vbulletin->db->query_write("ALTER TABLE " . TABLE_PREFIX . "usergroup DROP COLUMN mh_pbc_permissions");
// Clean Datastore
$vbulletin->db->query_write("DELETE FROM" . TABLE_PREFIX . "datastore WHERE title = 'mh_pbc'");
Replace this:
// Drop mh_pbc_colorscheme
$vbulletin->db->query_write("DROP TABLE " . TABLE_PREFIX . "mh_pbc_colorscheme");
With this: ?
// Clean Datastore
$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "datastore WHERE title = 'mh_pbc'");
If I'm doing it right I get a page cannot be found?
Marco van Herwaarden
07-18-2006, 04:38 PM
- Change the uninstall for version 1.00 (the first row) to contain only (overwrite the current code):
// Clean Datastore
$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "datastore WHERE title = 'mh_pbc'");
- Remove all the code from the version 1.01 uninstall code box (right column, second row)
I don't understand how you can get confused.
When finished, the first row of uninstall code should only contain that delete from datastore, and the second and third unstill rows should be empty.
Nathan2006
07-18-2006, 04:54 PM
I don't understand how you can get confused.
When finished, the first row of uninstall code should only contain that delete from datastore, and the second and third unstill rows should be empty.
Hi,
I have tried this (Screenshot 1)
Then after clicking save I get this error (Screenshot 2)
Im doing every correct.
What would happen if I installed your updated product
and tried uninstalling?
Thanks for your help :)
Marco van Herwaarden
07-19-2006, 02:22 PM
That looks more like a server config problem. What happens if you try to save it without making a change?
Nathan2006
07-19-2006, 04:07 PM
That looks more like a server config problem. What happens if you try to save it without making a change?
Hi,
I just tried and I receive the same page not found :(
Is there anyway I can fix this?
Thank you for your help
Marco van Herwaarden
07-19-2006, 04:18 PM
Then it is very likely that it is a server issue.
Please try first by turning off GZip compression in your vBulletin Options.
Other things that might cause something like this:
- A .htaccess rewrite rule playing games
- mod_security settings if this is installed
- memory settings (doubt it in this case)
I very much doubt that this got anything to do with this modification. Can you (fake) edit other products? Are you having more problems with sometimes getting this kind of errors.
Nathan2006
07-20-2006, 08:03 PM
Then it is very likely that it is a server issue.
Please try first by turning off GZip compression in your vBulletin Options.
Other things that might cause something like this:
- A .htaccess rewrite rule playing games
- mod_security settings if this is installed
- memory settings (doubt it in this case)
I very much doubt that this got anything to do with this modification. Can you (fake) edit other products? Are you having more problems with sometimes getting this kind of errors.
I got it sorted :)
Its was something to do with the mod_security setup on the server
and they have sorted it all and everything is good :)
Thanks
xcesiv
12-19-2007, 09:43 AM
is it possible to have this setup to change the backgrond automatically every second post.
Not making it user changable tho
Marco van Herwaarden
12-21-2007, 09:38 AM
No, this modification is not intended for that.
Derek Chai
01-12-2008, 04:38 PM
Possible for vB 3.7? It's <td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px"> Instead of <td class="alt2" width="175">
TCE Killa
02-23-2008, 04:29 PM
Can this be updated to 3.6.X please? I got everything working on my 3.6.8 version, just can't change the Usergroup Permissions. But everything is there.... Maybe there is away to add the Usergroup Permissions in the Plug-Ins? Thanks.
Scamorz
03-17-2008, 11:09 AM
How i can make it compatible with 3.6.8 version???!
Ok I have this on 3.7, but how do I add colors? I don't understand that part in the directions.
newguy
06-19-2008, 11:56 PM
Marco, any plans on updating this to work with vBulletin 3.7.X? Or do you know it will work already?
Thanks
TimberFloorAu
07-12-2008, 09:19 PM
This does work for 3.7.2
In postbit legacy you just need to tweak the settings if you use custom style.
Still perplexed as to Gradients and Images
Triky
07-23-2008, 07:44 AM
I will try it on vB 3.7.x. :erm:
Thanks, Marco.
dnicu26
09-28-2008, 03:57 PM
Can't get this to work.. I can't select the colour when posting :(.
This does work for 3.7.2
In postbit legacy you just need to tweak the settings if you use custom style.
Still perplexed as to Gradients and Images
What do you mean tweak the settings, to what?
shawn_RS
10-04-2008, 10:07 PM
The drop-down menu is not appearing....how do I fix this?
Marcus_Fenix
12-16-2008, 11:25 AM
Ah, a small kick from me, because I'm having the same problem. Any clues?
laytonw
03-28-2009, 03:17 AM
Did you also add some color schemes?
PS I will be gone out of the country in an hour, so i won't be able to give more support until next week.
Will this work on 3.8?
Layton
Is there anyway we could put this on 4.0?
JohnMcClane
04-15-2010, 01:13 PM
Anyway this can be done for vb4? An option to only display on certain conditions would be perfect. Users birthday?
Prohibit
10-26-2010, 06:49 PM
Also looking for this on 4 :)
Would like a moderator post color, donating member, premium member, and admin.
Samsine
05-25-2012, 07:34 PM
I would like to use this modification on vB4. :)
Who can adapt this addon?
Regards
Looking also for that addon. Looks great. Is there anyway to add this manually to a default template?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.