Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: Antes in Juni 16, 2014, 12:29:45 NACHMITTAGS

Titel: [Trick] Show board icon as "on" to guests
Beitrag von: Antes in Juni 16, 2014, 12:29:45 NACHMITTAGS
This small trick allows you to show board icons as on all the time to guests.

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

Code (Replace) Auswählen
                // 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 '

Titel: Re: [Trick] Show board icon as "on" to guests
Beitrag von: Matthew K. in Juni 16, 2014, 12:44:36 NACHMITTAGS
Code (Find) Auswählen
                // If the board or children is new, show an indicator.
                if ($board['new'] || $board['children_new'])
                    echo '

Code (Replace) Auswählen
                // If the board or children is new, show an indicator.
                if ($board['new'] || $board['children_new'] || $user_info['is_guest'])
                    echo '
Titel: Re: [Trick] Show board icon as "on" to guests
Beitrag von: Antes in Juni 16, 2014, 12:46:43 NACHMITTAGS
then you'll show on2.png or on.png based on which variable returns true.
Titel: Re: [Trick] Show board icon as "on" to guests
Beitrag von: Antechinus in Juni 16, 2014, 08:20:33 NACHMITTAGS
Are you sure that will work? Does the forum track what is new for guests?
Titel: Re: [Trick] Show board icon as "on" to guests
Beitrag von: ARG01 in Juni 16, 2014, 08:46:47 NACHMITTAGS
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.

;)
Titel: Re: [Trick] Show board icon as "on" to guests
Beitrag von: Illori in Juni 16, 2014, 09:06:21 NACHMITTAGS
Zitat von: Antechinus in Juni 16, 2014, 08:20:33 NACHMITTAGS
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.
Titel: Re: [Trick] Show board icon as "on" to guests
Beitrag von: Arantor in Juni 16, 2014, 09:08:25 NACHMITTAGS
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.
Titel: Re: [Trick] Show board icon as "on" to guests
Beitrag von: Jade Elizabeth in Juli 19, 2014, 06:59:05 VORMITTAG
I use it for my site because it makes it prettier :)
http://www.creativeburrow.org/