vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=253)
-   -   Forum row alternating colors (https://vborg.vbsupport.ru/showthread.php?t=251508)

Conner85 10-01-2010 11:41 PM

Forum row alternating colors
 
I just found a website telling how to do it but the author didn't say which template to edit. If someone could please look at this code and let me know which templates to edit, that would be greatly appreciated. Thanks.

Code:

With the release of vBulletin 4.x.x, I found myself searching for new updated code for alternating row color for the new vBulletin 4. You will see from another post within our Helpful Tips, Tricks & Articles we have an example of how to use this within vBulletin 3.x so we hope you will understand how to use this code without me having to go into to much detail.

After searching around, seeing others having the same problem I was having I decided to put together a solution.

Here is the new code for vBulletin 4, I am using this myself in my skin development.

Place this code at the top of the template

<vb:if condition="$altrow =& $GLOBALS['altrow']"></vb:if>
<vb:if condition="!isset($altrow)">
    <vb:if condition="$altrow = 0"></vb:if>
</vb:if>
<vb:if condition="++$altrow % 2 == 0">
    <vb:if condition="$rowClass = 'alt2'"></vb:if>
<vb:else />
    <vb:if condition="$rowClass = 'alt1'"></vb:if>
</vb:if>

Now where you want the alt1 or alt2 to be outputed please use

{vb:raw $rowClass}

Note: I have taken the time to do this and all I ask is that if you wish to share this on other forums, please do me a favor and link back to this post.

Enjoy!

I found this at http://www.forumthemes.com/helpful-t...in-method.html

8thos 10-02-2010 01:51 AM

Interesting.

Conner85 10-04-2010 12:48 AM

Anyone at all?

ProFifaLeagues 10-04-2010 09:25 AM


Heres a little more info from his posts on that site which may help you out!

How it works:

The way the colors are currently assigned is via CSS classes. The template changes remove the class definitions from the table cells, and add class definitions to the displayed rows. The CSS Classes used are the "Alt1" and "Alt2" classes - defined in the Admin Control Panel under Style Manager, (style), Main CSS, "First Alternating Color" and "Second Alternating Color".

Place the following code at the top of each template you want to alternate colors.
Code:
<if condition="$altrow =& $GLOBALS['altrow']"></if> <if condition="!isset($altrow)"> <if condition="$altrow = 0"></if> </if> <if condition="++$altrow % 2 == 0"> <if condition="$rowClass = 'alt1'"></if> <else /> <if condition="$rowClass = 'alt2'"></if> </if>
threadbit template updates
1) On the very first line, change
Code:
<tr>
to
Code:
<tr class="$rowClass">
2) search and remove:
2) Find all ' class="alt1"' and remove
3) Find all ' class="alt2"' and remove

forumhome_forumbit_level1_post updates
1) On the second line, change
Code:
<tr align="center">
to
Code:
<tr class="$rowClass" align="center">
2) search and remove:
2) Find all ' class="alt1"' and remove
3) Find all ' class="alt2"' and remove
4) Find all ' class="alt1Active"' and remove

forumhome_forumbit_level2_post
1) On the very first line, change
Code:
<tr>
to
Code:
<tr class="$rowClass">
2) search and remove:
2) Find all ' class="alt1"' and remove
3) Find all ' class="alt2"' and remove
4) Find all ' class="alt1Active"' and remove

pm_messagelistbit
1) On the very first line, change Code:
<tr>
to
Code:
<tr class="$rowClass">
2) search and remove:
2) Find all ' class="alt1"' and remove
3) Find all ' class="alt2"' and remove
4) Find all ' class="alt1Active"' and remove

memberlist_resultsbit
1) change
Code:
<tr align="center">
to
Code:
<tr class="$rowClass" align="center">
2) search and remove:
2) Find all ' AND exec_switch_bg()"' and remove
3) Find all ' class="$bgclass"' and remove
4) Find all ' class="alt1Active"' and remove
5) Find all ' class="alt2"' and remove

Lynne 10-04-2010 01:59 PM

If this is for rows, <tr>, and the old alt colors, alt1 and al2, then it's not going to work for vB4 without a bit more tweaking than what has been posted.

ifitsmedia 03-02-2011 03:51 AM

Does anyone know of a complete guide on how to do this with VB 4.1.2?

eues 03-03-2011 10:04 PM

Quote:

Originally Posted by ifitsmedia (Post 2168567)
Does anyone know of a complete guide on how to do this with VB 4.1.2?

this please.

shabbirbhimani 03-09-2011 12:39 AM

Quote:

Originally Posted by ifitsmedia (Post 2168567)
Does anyone know of a complete guide on how to do this with VB 4.1.2?

See Alternating Colored Rows in vBulletin 4 [No Plugin]. Complete step by step guide on how to get this done in vBulletin 4.1.2


All times are GMT. The time now is 12:39 PM.

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.01179 seconds
  • Memory Usage 1,734KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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