Hi,
Is it possible to set the board icons to a custom icon for each board? My current 2.0.15 forum has this set up (Not on a default theme, however), but the 2.1 rc2 test forum doesn't appear to have this functionality.
if 2.0.x has it, you did it by a mod -- this is not a standard feature in any version of SMF.
You can try this mod -
https://custom.simplemachines.org/mods/index.php?mod=4224
Quote from: Sir Osis of Liver on July 03, 2019, 12:35:31 PM
You can try this mod -
https://custom.simplemachines.org/mods/index.php?mod=4224
I like that mod, but it doesn't appear to support custom images. Am I just missing something there?
You do realize that you apply custom images by CSS alone?
Yes. I was just hoping there would be a better system for it, like if there were an option when modifying boards to change the image to any you select. That way, people who don't know/can't be bothered to learn CSS can edit the images.
in that case... In theory this one should still work...
https://custom.simplemachines.org/mods/index.php?mod=511
No it doesn't. I have been trying to update it but at the present moment I have had no luck.
For the default theme you could do something like this:
// If the board or children is new, show an indicator.
if ($board['new'] || $board['children_new'])
echo '
<img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
// Is it a redirection board?
elseif ($board['is_redirect'])
echo '
<img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
// No new posts at all! The agony!!
else
echo '
<img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';
// If the board or children is new, show an indicator.
if ($board['new'] || $board['children_new'])
echo '
<img src="', $settings['images_url']. '/boardicons/', $board['id'],'.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
// Is it a redirection board?
elseif ($board['is_redirect'])
echo '
<img src="', $settings['images_url']. '/boardicons/', $board['id'],'.png" alt="*" title="*" />';
// No new posts at all! The agony!!
else
echo '
<img src="', $settings['images_url']. '/boardicons/', $board['id'],'.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';
Then add a new folder boardicons in Themes/{yourtheme}/images
And you add an image for each board by id. E.g. ?board=1.0, 1 is that forum ID so you save your icon as 1.png
Also could change this to your preference
// No new posts at all! The agony!!
else
echo '
<img src="', $settings['images_url']. '/boardicons/', $board['id'],'.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';
Like using
// No new posts at all! The agony!!
else
echo '
<img src="', $settings['images_url']. '/boardicons/', $board['id'],'_off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';
So you can have 1_off.png for the off icon, or simply add an inline style for opacity
Regards
If that code is for 2.1, you pretty much just updated the cbi mod, lol.
That was for 2.0 I didn't read the title tbh
But it's pretty much the same just add your icon instead of using css
function template_bi_board_icon($board)
{
global $context, $scripturl;
echo '
<a href="', ($context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '" class="board_', $board['board_class'], '"', !empty($board['board_tooltip']) ? ' title="' . $board['board_tooltip'] . '"' : '', '></a>';
}