Alternating Colors
Ok this is a pretty old 'trick' but I'm bored so here goes.
This is how you can get the effect of switching colors, like posts in vBulletin and such. Code:
$bits = ''; Then in the loop, we each time increment $bgcounter by one, so once it's an odd number and once it's even. And last, inside the loop we check every time wheter $bgcounter is even or odd. This is done using the modulus operator. If it's even, we get {firstaltcolor} in $bgcolor. Otherwise, we put there {secondaltcolor}. Then all there's left to do is use $bgcolor in the template, and you will once get the first alternating color, and once the second. :) |
thanks finally i can get that working
|
firefly you a genius I just did what I needed to do in seconds, I even amazed myself ;)
|
pardon the newbie question, but I just installed purchased and installed vbulletin yesterday and I want to install this hack.
In which module do I install this code? thanks in advance and pardon my ignorance. all in all, I got purchased the product and had the forum up and running in about 3 hours... - jeff |
This is not a hack. You file hacks in the Full Releases forum, this just a forum to share small tips with other hackers. :)
|
thanks
|
could you maybe give a bit of help on how to implement this please?
|
All times are GMT. The time now is 02:23 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|