Advertisement:

Author Topic: Hide online status in display.template (online/offline icon)  (Read 222 times)

Offline spiros

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 1,859
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
I am using this (as described here: https://www.simplemachines.org/community/index.php?topic=573194.msg4056070#msg4056070)

Code: [Select]
// Show online and offline buttons?
if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
echo '
', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<span class="', $message['member']['online']['is_online'] ? 'on' : 'off' ,'"></span>', $context['can_send_pm'] ? '</a>' : '';

However, it appears that the default SMF behaviour is for the online icon to appear green for a user who is online, even if one is viewing the post as a guest. How can this be changed so that a guest always sees a gray image (off).

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 72,310
Re: Hide online status in display.template (online/offline icon)
« Reply #1 on: May 21, 2020, 01:46:43 PM »
Surely having the icon be visible and green indicates to guests that people are actually online and that the forum has activity with actual people (encourages further signups)?

Online Deaks

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 22,238
  • Gender: Male
    • pouvik on GitHub
Re: Hide online status in display.template (online/offline icon)
« Reply #2 on: May 21, 2020, 01:47:06 PM »
hi spiros, best advice would be ask Antes in the topic, its been 6 days so I would message him.

Offline Antes

  • Evil Black Cat
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 9,070
  • Gender: Male
  • Black cat rulz!
    • XinYenFon on GitHub
    • merta on LinkedIn
    • @XinYenFon on Twitter
    • wowsnips
Re: Hide online status in display.template (online/offline icon)
« Reply #3 on: May 21, 2020, 04:17:12 PM »
I agree with Arantor on the subject but for some other reason if you want to make this happen;

Code: [Select]
// Show online and offline buttons?
if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
echo '
', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<span class="', ($message['member']['online']['is_online'] && !$user_info['is_guest']) ? 'on' : 'off' ,'"></span>', $context['can_send_pm'] ? '</a>' : '';
You can support me via Twitch Prime* or Patreon.

[ Bastion ] # [ Lunarfall ] # [ RDD (HTML5) ]

* Twitch prime is an extra perk of your amazon prime subscription -no extra payment required-.

Offline spiros

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 1,859
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
Re: Hide online status in display.template (online/offline icon)
« Reply #4 on: May 22, 2020, 04:37:32 AM »
Thanks again Antes! Most valuable help. Just tried, but still shows green to a guest.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 72,310
Re: Hide online status in display.template (online/offline icon)
« Reply #5 on: May 22, 2020, 06:40:05 AM »
Is $user_info in the list of global variables for that function?