News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Show "no new posts" board icon to guests [SMF 2.1.x]

Started by MobileCS, December 04, 2022, 12:06:51 AM

Previous topic - Next topic

MobileCS

Is there a way I can change it so it shows the "no new posts" board icon to guests?

Steve

You want the guest to see 'no new posts' on all boards even the first time they visit?
DO NOT pm me for support!

MobileCS

Yes, I just want guests to see the "no new posts" board icon - even on first visit.

As it stands now, the "new posts" board icon always shows for them, regardless if they have viewed the board or not.

Sir Osis of Liver

Post views are tracked by member, there's no way for forum to know if a guest has been there previously, or what's been posted since last visit.  Why do you want to do that?

Or do you want guests to always see no new posts icon for all boards?

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

MobileCS

Quote from: Sir Osis of Liver on December 04, 2022, 02:31:12 PMOr do you want guests to always see no new posts icon for all boards?

Yes, that's what I would like to do.

Sir Osis of Liver

Someone can clean this up, but it'll give you the general idea -

BoardIndex.template.php


function template_bi_board_icon($board)
{
global $context, $scripturl;

if ($context['user']['is_guest'])

echo '
<a href="', ($context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '" class="board_off"', !empty($board['board_tooltip']) ? ' title="' . $board['board_tooltip'] . '"' : '', '></a>';

  else

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


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters


Advertisement: