PDA

View Full Version : Alternating Thread Rows


AlienSector
03-23-2005, 10:00 PM
Just as the title says, this will allow you to alternate the thread row colors when viewing each forums' thread display (i.e. have each thread row alternate instead of having each cell alternate). I noticed this was requested a while back on vBulletin.com and had been asked before, so here it is :).

I don't believe the same modification has been released for vBulletin 3.0 that I have been made aware of, though if such has been released, please feel free to make notice.

Installation takes all of 2 minutes and requires modification to only 1 file and 1 template.

nexialys
03-24-2005, 10:13 AM
good thing that someone make it finally... i've added it myself for some clients, in a different structure (even smaller!) and to make it using less variables, let's play with it:
$altclass = ($row_count % 2) ? $color1 : $color2;can be transformed in$altclass = ($row_count % 2) ? 'alt1' : 'alt2';with this, you don't need the first identification...

also, this hack can be applyed in showthread to make posts having alternate colors, and in search results too... it's not always activated, but it works already... i found many styles that were not using the alternate colors at all...

also, it would be good to have the threadbit modified in the instructions instead of a complete replace, because MANY guys here have modified theirs with the time...

Marco van Herwaarden
03-24-2005, 10:21 AM
Sounds nice AlienSector.

1 Remark, would it be possible to give instructions on how to change the threadbit Template instead of only a replacement of the full Template. Some members might have already modified their threadbit template and don't want to replace it.

Edit: Crossposted with Nexialys, who beat me in this :D

AlienSector
03-24-2005, 06:15 PM
Sounds nice AlienSector.

1 Remark, would it be possible to give instructions on how to change the threadbit Template instead of only a replacement of the full Template. Some members might have already modified their threadbit template and don't want to replace it.

Edit: Crossposted with Nexialys, who beat me in this :D
The ZIP file has been updated with the new coding updates, thanks to Nexialys. I've also included instructions for Stock & Modified installations.

Please keep in mind, I do not have an overly modified threadbit template, so if you do encounter a problem with the display, please report it through this thread. Please also include the hack(s) you have installed that required you to modify the threadbit template.

Installation still should take only 2-3 minutes max.

AlienSector
03-24-2005, 06:19 PM
Just added a screenshot as well, for those that may not fully understand what this does based off the description.

TheComputerGuy
03-24-2005, 08:23 PM
sweet addon!

AlienSector
03-25-2005, 03:21 AM
sweet addon!
Thanks much :)

Viks
03-27-2005, 03:00 PM
super!

Deska
03-30-2005, 05:45 AM
How to get this hack work on Forum Home?
I want my forum list look like this.

Btw, nice hack...

AlienSector
03-30-2005, 03:39 PM
How to get this hack work on Forum Home?
I want my forum list look like this.

Btw, nice hack...
I've not actually looked at that part of vBulletin's coding, though there is a way to do it by template conditionals, which has been explained in the thread below over at vBulletin.com.

http://www.vbulletin.com/forum/showthread.php?t=100759

Be sure to note all instructions within the thread as there was confusion among some members :).

yoyoyoyo
03-31-2005, 12:54 PM
great hack, but unfortunately now it makes my "new posts" results shaded in, instead of the old way or alternating

venomx
03-31-2005, 01:41 PM
Am I the only one who doesnt understand what this does? I looked at the images... they look the same to me color wise...

AlienSector
04-01-2005, 08:14 AM
Am I the only one who doesnt understand what this does? I looked at the images... they look the same to me color wise...

It will alternate row colors (via alt1 and alt2) instead of alternating every other cell in the row. One row will be set to alt1, the next alt2, the following alt1 and so forth.

venomx
04-01-2005, 08:26 AM
Unless I am blind it already does that...

Zachariah
04-10-2005, 08:17 AM
Unless I am blind it already does that...


rows
-----------
alt1
-----------
alt2
-----------



default is column's

| alt1 | alt2 | alt1 |

albireo
07-08-2005, 04:33 PM
Thanks for great hack. It works nicely in the forumdisplay. But in search result (of threadbit style), every class="$altclass" tag is changed as follows:

every class=" " [empty]

How can I solve this problem?

Mythotical
07-10-2005, 02:58 AM
you can try it as class="$altclass" and see what happens or just leave it alone and wait for someone else to reply.

fribs
08-09-2005, 08:58 PM
Thanks for great hack. It works nicely in the forumdisplay. But in search result (of threadbit style), every class="$altclass" tag is changed as follows:

every class=" " [empty]

How can I solve this problem?

Here's what I did (3.0.8)- but be warned! I am no coder so this may trade one problem for another. At the moment though it is working for me:

In search.php
find:

// get info from thread
$thread = process_thread_array($thread, $lastread["$thread[forumid]"]);

$itemcount++;
and below it add:

$altclass = ($row_count % 2) ? 'alt1' : 'alt2';

Then a few lines down find:

exec_switch_bg();
eval('$searchbits .= "' . fetch_template('threadbit') . '";');
and below it add:

$row_count++;


This fixed the search results for me, but like I wrote earlier, this may cause problems that I am not farsighted enough to see - but since it's been a good month since you asked the question then this should cause someone with more experience to speak up if it is problematic.

In my novice understanding adding the code to search.php populates the variable where before it was empty. In any case, thank you AlienSector for taking the time to release this, it's a really nice touch to have for those of us who don't speak fluent PHP. :D

Fribs