Quote:
Originally Posted by Kat-2
I thought of doing that, but when you have other themes, and members prefer to use another one, the color you pick may not show on other theme. Themes I have have the chatbox white, and Avenger is blue, so it needs the light color. Light colors won't show on white.
I am still trying to figure it out.
|
Ok so go to AdminCP > Plugins & Products > Add New Plugin
Title: Custom background per style for VSA Chatbox
Execution Order: 5
Hook Location: parse_templates
Code:
if (STYLEID == 1) {
if (THIS_SCRIPT == 'forumhome') {
$vsacssfix = '<style type="text/css">
#vsacb_messagearea {
background:#ffffff !important;
background-color:#ffffff !important;
}
</style>';
$template_hook[headinclude_bottom_css] .= $vsacssfix;
}
}
Now in styleid #1 it will show the chatbox with the background color in the plugin. I also told it to only do this on forumhome.
An example for multiple styles would be:
Code:
if (THIS_SCRIPT == 'forumhome') {
if (STYLEID == 1) {
$vsachatcssfix = '<style type="text/css">
#vsacb_messagearea {
background:#ffffff !important;
background-color:#ffffff !important;
}
</style>';
$template_hook[headinclude_bottom_css] .= $vsachatcssfix;
}
if (STYLEID == 2) {
$vsachatcss2fix = '<style type="text/css">
#vsacb_messagearea {
background:#ffffff !important;
background-color:#ffffff !important;
}
</style>';
$template_hook[headinclude_bottom_css] .= $vsachatcss2fix;
}
}
^ I moved the if this script to the outside so it's still specified but also not repeated (not required). If you're using the chatbox on other pages then remove that snippet about THIS_SCRIPT and the closing } tag in the code.
This should sort the chantbox background per style so long as you include each style in the plugin per new code

.
EDIT: This method is now outlined in my article Customizing Styles via Plugins Part 1: The Basics.