News:

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

Main Menu

Forum image mod

Started by elmatador, August 17, 2006, 11:44:07 PM

Previous topic - Next topic

elmatador

Hello,

is there like for phpbb a mod that sets a small image besides the forum name ?

Bigguy

There are a couple ways to do this. Here is one:

THIS IS FOR SMF1.1RC2

To replace the default board icons with custom ones, you have to open the BoardIndex.template.php file and find this:

// 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 replace with this:

// 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" />';


Now make new icons and instead of them being named on.gif, on2.gif and off.gif you will name the new ones:

on_##.gif were ## is the board id of the board you want the icon to show in. Place the icon in the images folder of your default theme.

If you would like an example of this you can goto:

www.smfhelper.com

elmatador

Where can i find that file ??
because i cant find the text to replace in the file index.template.php (the theme that i'm using)

Gary

It's in BoardIndex.template.php (& MessageIndex.template.php for child boards)

-AwwLilMaggie
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

Advertisement: