vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Alternate row colors (https://vborg.vbsupport.ru/showthread.php?t=58863)

hexonxonx 11-28-2003 05:24 AM

Alternate row colors
 
Hi

I have searched and searched and can't find the alternationg row colors mod here anywhere, or at least one that will work with 2.3.2. Can anyone provide the code for this? I don't want the colors to alterate for the colums, just the rows for forumhome and showthreads,

Thanks!

Dean C 11-28-2003 03:27 PM

It needs hacking - you can't do it just in templates (AFAIK) - needs 4 lines of code I think. So moved to hack requests :)

Michi 06-14-2004 02:05 PM

You can do it quite simply for Forumdisplay like this:

Find in forumdisplay.php:
Code:

  while ($thread=$DB_site->fetch_array($threads)) { // and $counter++<$perpage) {
Right after that, add:

Code:

            if($oror++ % 2 == 0)
          {
                  $tread[color] = "{secondaltcolor}";
          }
          else
          {
                  $tread[color] = "{firstaltcolor}";
          }

And thats that. Then just add bgcolor="$tread[color]" to table cells in the template you want. You can also rename the variables "$oror" and $tread[color] to whatever you want.

And, if you're clever, you can also add the same thingy to what ever loop that lists threads, topics, posts etc.

Berethorn 07-02-2004 02:28 PM

I don't know much about PHP code - I'm trying to figure out how to alternate the colors for each POST, not for each column. Any way to alter this code to accomplish that? :)


All times are GMT. The time now is 08:40 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.01910 seconds
  • Memory Usage 1,710KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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