View Full Version : Alternating row colors
Kaitlyn2004
07-28-2006, 04:41 PM
Instead of alternating row colors, vb does each column a different color...
Is there some way I can create a counter in the template and then input that style?
I can get the whole "alternating row colors" thing just fine, I just need a way to increase/modulus a var and I am not familar with how that would be possible through the vB templates
simsimt
07-28-2006, 06:09 PM
Depending on where do you want rows to alternate colors, edit either forumbit or threadbit template (or both) as follows:
Find all instances of alt1 & alt2, & replace them with $bgclass.
Then at the beginning of the template add:
<if condition="exec_switch_bg()"></if>
Kaitlyn2004
07-28-2006, 09:59 PM
Wonderful! I don't understand how you knew about that availability :(
HOW!? :)
I can't seem to get this to work for the forum home template...
forumhome_forumbit_level2_post
it just ends up with an empty class name...
simsimt
07-29-2006, 12:11 AM
Credits of this method goes to Colin Frey.
Try adding this at the beginning of the template (after the first if condition line):
<td class="$bgclass">
Kaitlyn2004
07-29-2006, 12:14 AM
I have this in forumhome_forumbit_level2_post:
<if condition="exec_switch_bg(1)"></if>
<tr align="center">
<td width="32" class="$bgclass"><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" /></td>
<td width="100%" class="$bgclass" align="$stylevar[left]" valign="top" id="f$forum[forumid]">
<div>
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
</div>
<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&f=$forum[forumid]" rel="nofollow">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
</td>
<td width="175" valign="top" class="$bgclass" nowrap="nowrap">$forum[lastpostinfo]</td>
<td width="50" class="$bgclass" nowrap="nowrap">$forum[threadcount]</td>
<td width="50" class="$bgclass" nowrap="nowrap">$forum[replycount]</td>
<if condition="$vboptions['showmoderatorcolumn']">
<td width="10" class="$bgclass" nowrap="nowrap"><div class="smallfont">$forum[moderators] </div></td>
</if>
</tr>
$childforumbits
All I get are class="".... its not filling in correctly.
Edit: But it DOES work just fine in the threadbit template
this is VERY frustrating.. boooo
ANYBODY? any ideas?
Cheertobi
08-21-2006, 09:39 PM
Same here, did not get it work at the forumbits ;(
Tobi
nevetS
09-02-2006, 02:21 PM
I'm working on this now... Did anybody find a solution yet?
Kaitlyn, I figured this out, and created a plugin to handle it. The instructions are relatively simple:
https://vborg.vbsupport.ru/showthread.php?t=125654
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.