Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Change Background Color for Specific Forums on Homepage Details »»
Change Background Color for Specific Forums on Homepage
Version: 1.00, by addamroy addamroy is offline
Developer Last Online: Jan 2018 Show Printable Version Email this Page

Category: Forum Home Enhancements - Version: 4.1.x Rating:
Released: 12-29-2012 Last Update: Never Installs: 11
Template Edits
Re-useable Code Translations  
No support by the author.

This modification will allow you to change the background color of specific forums on your forumhome.

For example, if you want to draw more attention to your private sections to drive paid registrations, this can help.

This mod is done via one simple template edit.

STEP 1 - Find the forumhome_forumbit_level2_post template via edit templates > Forum Home Templates.

Find the code below
Code:
<div class="forumrow table">
And replace it with
Code:
<div class="forumrow table"
<vb:if condition="$forum[forumid] == XXX">
style="background-color:#xxxxxx;"
</vb:if>
>
Replace XXX with the forumid of the forum you want to change the background color of.

Replace xxxxxx to the hex code of the color you want to use. You can find hex codes here, http://www.html-color-codes.com

If you have multiple forums you want to change the background colors of for each, simply stack additional vb:if conditions before the > for each forum you want to change.

Like below
Code:
<div class="forumrow table"
<vb:if condition="$forum[forumid] == XXX">
style="background-color:#xxxxxx;"
</vb:if>
<vb:if condition="$forum[forumid] == XXX">
style="background-color:#xxxxxx;"
</vb:if>
<vb:if condition="$forum[forumid] == XXX">
style="background-color:#xxxxxx;"
</vb:if>
>
Straight forward, works like a charm.

Check out my other Template Modifications for 4.x!

[Postbit-Legacy Hack] Attractive User Info Boxes for Posts

Link Private Forums to thread instead of error message

Sidebar Anywhere Enhancement - Custom Blocks Per Forum or Page

Change Thread Title Color for Specific Forums on Homepage

Change Title Color of Specific Forums on Homepage

Thread Starter Image in Postbit for OP

CUSTOM BUTTONS that look like your forum!

Custom User Rank Box in Posts

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
sodasusu

Comments
  #2  
Old 03-26-2013, 02:49 PM
astdirect astdirect is offline
 
Join Date: Dec 2009
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Didn't work for me im afraid - no change.
Reply With Quote
  #3  
Old 05-19-2013, 01:29 PM
masonox masonox is offline
 
Join Date: Feb 2008
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Best I've been able to do with only a minute of work is change it to this to change text color. I haven't tried working with background colors, but I'm sure the html is simple.

<vb:if condition="$forum[forumid] == XXX">
<span style="color:XXXX">
</vb:if>
Reply With Quote
  #4  
Old 06-01-2013, 04:25 PM
faisaly.com faisaly.com is offline
 
Join Date: Mar 2007
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does not work using vb4.1.11 just added the simple code....
Reply With Quote
  #5  
Old 06-13-2013, 07:17 PM
edytwinky edytwinky is offline
 
Join Date: Aug 2007
Posts: 512
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this working for anybody?
Reply With Quote
  #6  
Old 06-18-2013, 11:13 AM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I re worked the code a little bit, try again.
Reply With Quote
  #7  
Old 10-24-2017, 08:20 PM
Raptor Raptor is offline
 
Join Date: Nov 2001
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not working in vb 4.2.3
Reply With Quote
  #8  
Old 10-25-2017, 06:17 AM
ShawneyJ's Avatar
ShawneyJ ShawneyJ is offline
 
Join Date: Jul 2006
Location: Australia
Posts: 1,758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works ok on my test board Version 4.2.5.
Attached Images
File Type: jpg test6.jpg (36.2 KB, 0 views)
Reply With Quote
2 благодарности(ей) от:
mansonklan, MarkFL
  #9  
Old 11-19-2019, 03:28 AM
Raptor Raptor is offline
 
Join Date: Nov 2001
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this worked perfectly - simply add to the themes additional.css

XXX is the forum ID, #FFFFFF is the color

#catXXX .forumhead {
background: #FFFFFF !important;
}

Thanks to MarkL
Reply With Quote
  #10  
Old 11-19-2019, 10:26 AM
Raptor Raptor is offline
 
Join Date: Nov 2001
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Add this code to additional.css and it will change the background color of the header, the topic title, and the topic description

Simply add the forum ID and colors

Example:
Code:
#cat374 .forumhead {
	background: #2491BF !important;
}
#cat374 .forumbit_post .forumtitle a {
    color: #2491BF !important;
}
#cat374 .forumbit_post .forumdescription {
    color: #373737 !important;
}
Tested with vb4.2.5
Reply With Quote
Благодарность от:
scottkoz20
Reply


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:57 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05343 seconds
  • Memory Usage 2,315KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (4)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete