Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: Antes on June 16, 2014, 12:29:45 PM

Title: [Trick] Show board icon as "on" to guests
Post by: Antes on June 16, 2014, 12:29:45 PM
This small trick allows you to show board icons as on all the time to guests.

Open BoardIndex.template.php
Code (Find) Select
                // If the board or children is new, show an indicator.
                if ($board['new'] || $board['children_new'])
                    echo '

Code (Replace) Select
                // If the board or children is new, show an indicator.
                if ($context['user']['is_guest'])
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'on','.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
                elseif ($board['new'] || $board['children_new'])
                    echo '

Title: Re: [Trick] Show board icon as "on" to guests
Post by: Matthew K. on June 16, 2014, 12:44:36 PM
Code (Find) Select
                // If the board or children is new, show an indicator.
                if ($board['new'] || $board['children_new'])
                    echo '

Code (Replace) Select
                // If the board or children is new, show an indicator.
                if ($board['new'] || $board['children_new'] || $user_info['is_guest'])
                    echo '
Title: Re: [Trick] Show board icon as "on" to guests
Post by: Antes on June 16, 2014, 12:46:43 PM
then you'll show on2.png or on.png based on which variable returns true.
Title: Re: [Trick] Show board icon as "on" to guests
Post by: Antechinus on June 16, 2014, 08:20:33 PM
Are you sure that will work? Does the forum track what is new for guests?
Title: Re: [Trick] Show board icon as "on" to guests
Post by: ARG01 on June 16, 2014, 08:46:47 PM
I have on a few occasions upon request set the New Post "new_some" icon to be visible to guests under the boards along with the No New Post "new_none.png" and Redirect Board "new_redirect.png" icons. The only actual good I see in this is to show newbies that they must be logged in to see any new posts. It may help, it may not but just seems more practical.

;)
Title: Re: [Trick] Show board icon as "on" to guests
Post by: Illori on June 16, 2014, 09:06:21 PM
Quote from: Antechinus on June 16, 2014, 08:20:33 PM
Are you sure that will work? Does the forum track what is new for guests?

nope smf does not show the new flag to guests.
Title: Re: [Trick] Show board icon as "on" to guests
Post by: Arantor on June 16, 2014, 09:08:25 PM
The point is to show guests the 'on' icon to entice them into viewing. 2.1 already does this but like so many other things I regret making the change because conservatism is alive and well.
Title: Re: [Trick] Show board icon as "on" to guests
Post by: Jade Elizabeth on July 19, 2014, 06:59:05 AM
I use it for my site because it makes it prettier :)
http://www.creativeburrow.org/