The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Changing background for each header box
Hello,
I am trying to change the background for each header box (each box, may have a different background). I have tried to use an IF statement to read the title of the box and based on that set the background="whatever.gif" inside of a <td> tag. However, for some reason the image is not displaying. Can anyone offer some advice? Thanks Gladys |
#2
|
||||
|
||||
<td style="background-image: url(images/whatever.gif);">
|
#3
|
|||
|
|||
Yes, but since vBulletin is using a template to display these, I need to find a way to test for the header title and depending on what I find in that header, I can define the background style. For Example
<if TITLE == "Search"> <td style="MyStyle> </if> Unfortunately, I do not know the right code to do this test. thanks, Gladys |
#4
|
||||
|
||||
If you are trying to set different background depending on what forum is shown check $vbulletin->GPC['forumid'] like this:
Code:
<if condition="!$vbulletin->GPC['forumid']"> default background <else /><if condition="$vbulletin->GPC['forumid'] == 1"> background for forum 1 <else /><if condition="$vbulletin->GPC['forumid'] == 2"> background for forum 2 </if></if></if> |
#5
|
|||
|
|||
Hmm.. the <if condition="$vbulletin->GPC['forumid'] == 2"> seems not to be working in my forum. It seems that the If condition is never true so it always does the else.
Also what I originally want to do is change the header color for the Welcome, Search, Control CP, Quick Reply, etc... boxes. Some of these boxes have their own template, so it would be easy to change. See attachment for more clarification. Sorry I could not explain it better and Thanks for your help! Gladys |
#6
|
|||
|
|||
Those two boxes are completely different tables in the search template, and you have no need for if conditionals.
You simply need to create another "tcat" class, call it "tcat2" and change the background image. Then you just need to change the style for that td to tcat2, etc. Like so: Code:
<td class="tcat2"> $vbphrase[errors_occured_with_search]: </td> Code:
<td class="tcat3"> <if condition="$show['searchthread']">$vbphrase[search_thread] - <a href="showthread.php?$session[sessionurl]t=$threadinfo[threadid]">$threadinfo[title]</a><else />$vbphrase[search_forums]</if> </td> HTML Code:
.tcat { background: #162756 url(../../images/gradients/gradient_tcat3.gif) repeat-x top left; color: #FFFFFF; font: bold 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; padding:6px; } .tcat a:link, .tcat_alink { color: #ffffff; text-decoration: none; } .tcat a:visited, .tcat_avisited { color: #ffffff; text-decoration: none; } .tcat a:hover, .tcat a:active, .tcat_ahover { color: #FFFF00; text-decoration: underline; } |
#7
|
|||
|
|||
ok. For some reason I am not explaining myself correctly. I am using CMPS. I want to change the header for each of the boxes that I show. So this is what CMPS shows
Code:
LEFT COLUMN MIDDLE COLUMN RIGHT COLUMN BOX 1 BOX 2 BOX 3 BOX 4 BOX 5 BOX 6 BOX 7 For Box 1, I want the background header to be Red For Box 2, I want the background header to be blue For Box 3, I want the background header to be Green For Box 4, I want the background header to be Orange For Box 5, I want the background header to be Blue For Box 6, I want the background header to be purple For box 7, I want the background header to be black Because the changes to some of these boxes are controlled by a single template, the only way I can see doing this is comparing the text that will be input for each header so I do something like: If Box Title == Search header -> Red If Box Title == Login header --> green .... So ... What I need to know is what is the variable that I need to use in order to test for the Box Title so I can do the proper test to display the appropiate background. Hope this explains it better, Gladys |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|