vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Alternating row colors (https://vborg.vbsupport.ru/showthread.php?t=122408)

Kaitlyn2004 07-28-2006 03:41 PM

Alternating row colors
 
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 05: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:
Code:

<if condition="exec_switch_bg()"></if>

Kaitlyn2004 07-28-2006 08: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-28-2006 11:11 PM

Credits of this method goes to Colin Frey.

Try adding this at the beginning of the template (after the first if condition line):
Code:

<td class="$bgclass">

Kaitlyn2004 07-28-2006 11:14 PM

I have this in forumhome_forumbit_level2_post:

Code:

<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&amp;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]&nbsp;</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 08:39 PM

Same here, did not get it work at the forumbits ;(

Tobi

nevetS 09-02-2006 01: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


All times are GMT. The time now is 07:18 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01506 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete