Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Aiheen aloitti: testipallo - toukokuu 17, 2006, 02:33:42 AP

Otsikko: Changing color of the border for particular category
Kirjoitti: testipallo - toukokuu 17, 2006, 02:33:42 AP
Hey there.

I would like to know if it's possible to change the color of the border for one category only. For example: default category for public with default colors and admin category for admins with different colors. Both of them visible on one page when admin is logged in.

If it is possible, how do I start?

1. Add '.admintable' to style.css with colors I like
2. Assign what table from where to use '.admintable' style?

I have 1.0.7.
Otsikko: Re: Changing color of the border for particular category
Kirjoitti: forsakenlad - toukokuu 17, 2006, 10:13:46 AP
Open up your BoardIndex.template.php file and search for:

<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="5">

And replace it with this:

<div class="';
if ($category['id'] === '1')
{
echo 'adminclass';
}
                else
                {
                        echo 'tborder';
                }
               
                echo '"><table border="0" width="100%" cellspacing="1" cellpadding="5">


The category id defined here is the category that you want the class assigned to ;)
Otsikko: Re: Changing color of the border for particular category
Kirjoitti: testipallo - toukokuu 18, 2006, 02:24:52 AP
Thanks for your reply, again :)

I guess the category id defined in your code won't be replaced by the category's name because I couldn't get it to work?

I replaced the code and here's what I wrote on style.css Did I get it right?


.adminclass
{
         background-color: #ffffff;
         border: 1px solid #ff0000;
}
Otsikko: Re: Changing color of the border for particular category
Kirjoitti: forsakenlad - toukokuu 20, 2006, 06:29:17 AP
You might also want to add some padding like "padding: 2px;" to the stylesheet to make the border more noticable. You of course can use the category name but I had thought the using the id would be easier to manage. To use a category name modify the variable like this: "$category['name']" ;)
Otsikko: Re: Changing color of the border for particular category
Kirjoitti: testipallo - toukokuu 22, 2006, 02:04:19 AP
Thank you :)