Advertisement:

Different color for each category

Aloittaja Vish, helmikuu 23, 2006, 02:05:42 AP

« edellinen - seuraava »

Vish

How can I have different color for each category?
Something like this:



I was able to find post that explained how to have alternate colors for boards, but have not been able to find nor figure out myself.

I tried playing with the catbg class but in vain.

I know back of my mind I might have to delve into hardcore php stuff in there, but want to make sure it has not been done before and also get ideas on where exactly to start from !!

Any help would be greatly helpful.


Acf

You need to know PHP if you wand to do that i guess.
Maybe counting the number of cats, and when the number is uneven giving the boards a different style.

Don't now how they did it with the messages maybe it can be found there.


Sigh...

Prasad007

you could ask the same in "Scripting Help" board maybe

p.s. are you vishwajeet?

Vish

Thanks acf and Prasad for replying...

In back of my mind I know that I will need to play with the php code and if if and else statements in there, but I am want to make sure that before diving in there, I am not wasting my time. If it has been done before by someone, I'd rather use that effort.

I will post this in scripting too.
Thanks

H

Lainaus käyttäjältä: Prasad007 - helmikuu 23, 2006, 08:16:22 AP
you could ask the same in "Scripting Help" board maybe

p.s. are you vishwajeet?


No he shouldnt. That would be double posting ;)
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

kegobeer

After a quick look at BoardIndex.template.php, it wouldn't be hard.  Just add extra css classes to your stylesheet, throw in a counter that increments during the loop, and use those new classes.

x++;
echo '<a href="blabla" class="hrefstyle', $x, '">';

That's not specific, of course, but a starting point.  If I get a chance, I'll play with that tonight.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Vish

kegobeer

Thanks for the pointer, I will look it up too myself...


Acf


$num = count($category['boards']);
$i = 0;
foreach ($category['boards'] as $board)
{
$i++;


' , ($i == $num) ? 'yourhtmltreu' : 'yourhtmlfalse' , '
piece of code i used to find the last board in a cat... geuss you can use it ;)
Sigh...

Advertisement: