Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Topic started by: malcolm_x on May 05, 2006, 04:58:13 AM

Title: Board icons - different for each one ?
Post by: malcolm_x on May 05, 2006, 04:58:13 AM
What should I do to make different icon for each board ? Now there are only on.gif and off.gif, but I want as many as boards.

I've seen SMF based forum using icons in that way, but I don't member where it was  :(
Title: Re: Board icons - different for each one ?
Post by: Anakin_holland on May 05, 2006, 06:50:36 AM
That might have been in this topic (http://www.simplemachines.org/community/index.php?topic=57202.0)?

Greetz!
Title: Re: Board icons - different for each one ?
Post by: dys on May 05, 2006, 09:34:37 AM
Thanks..this seems useful :D
Title: Re: Board icons - different for each one ?
Post by: malcolm_x on May 05, 2006, 03:49:20 PM
Thanks very much!  :D

I just used following code in BoardIndex.template.php

// Individual board icons. If a custom image exists, use it. Otherwise use the default image.
if (file_exists($settings['theme_dir'] . '/images/on_' . $board['id'] . '.gif'))
$board_new_img=$settings['images_url']. '/on_' . $board['id'] . '.gif';
else
$board_new_img=$settings['images_url']. '/on.gif';

if (file_exists($settings['theme_dir'] . '/images/on2_' . $board['id'] . '.gif'))
$childboard_new_img=$settings['images_url']. '/on2_' . $board['id'] . '.gif';
else
$childboard_new_img=$settings['images_url']. '/on2.gif';

if (file_exists($settings['theme_dir'] . '/images/off_' . $board['id'] . '.gif'))
$board_nonew_img=$settings['images_url']. '/off_' . $board['id'] . '.gif';
else
$board_nonew_img=$settings['images_url']. '/off.gif';


               // If the board is new, show a strong indicator.
                if ($board['new'])
echo '<img src="', $board_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';

                // This board doesn't have new posts, but its children do.
                elseif ($board['children_new'])
echo '<img src="', $childboard_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
                    // No new posts at all!  The agony!!
                    else
echo '<img src="', $board_nonew_img,'" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';
// Individual board icons end


to replace this one:

// If the board is new, show a strong indicator.
if ($board['new'])
echo '<img src="', $settings['images_url'], '/on.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
// This board doesn't have new posts, but its children do.
elseif ($board['children_new'])
echo '<img src="', $settings['images_url'], '/on2.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
// No new posts at all!  The agony!!
else
echo '<img src="', $settings['images_url'], '/off.gif" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';


And it works perfectly in babilon theme and in default. (SMF 1.1RC2)

I had to name icons like on_3.gif, off_3.gif, on2_3.gif, where 3 is board's ID.
Title: Re: Board icons - different for each one ?
Post by: stefano8663 on June 16, 2006, 07:31:12 AM
Not sure if I got it right, but it doesn't work with blublur template  :o

Do the .gifs need to be named on_1, on_2, on_3 and so on, where 1,2,3...are the boards in order?
Title: Re: Board icons - different for each one ?
Post by: malcolm_x on June 16, 2006, 07:56:36 AM
No, not in order. Each board has it's unique Id -
ie:
.../forum/index.php/board,5.0.html

and 5 is that id.

You can watch it working at my forum: www.akwarium.net.pl/forum/
Title: Re: Board icons - different for each one ?
Post by: stefano8663 on June 16, 2006, 08:17:51 AM
Yes mate, I saw your forum and that's exactly what I need! Ok, I made different icons for each board, on and off are supposed to be different, of course. So I named them on_1, on_2, off_1, off_2, where 1,2 and so on should be the board number I guess. I uploaded them in /forum/templates/blublur/images. Is it correct? This way it doesn't work, I still have the same old icon for each room  :(
Title: Re: Board icons - different for each one ?
Post by: malcolm_x on June 20, 2006, 12:50:32 PM
First check maybe on default template, i dont know what can be wrong with blublur...