News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Board icons - different for each one ?

Started by malcolm_x, May 05, 2006, 04:58:13 AM

Previous topic - Next topic

malcolm_x

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  :(

Anakin_holland


dys

My Themes

Please use our official Support Forum instead of PM-ing me for any support. From now on, all my themes support will only be available there. Thanks!

malcolm_x

#3
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.

stefano8663

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?

malcolm_x

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/ [nofollow]

stefano8663

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  :(

malcolm_x

First check maybe on default template, i dont know what can be wrong with blublur...

Advertisement: