Advertisement:

Author Topic: Online and offline images change  (Read 507 times)

Offline spiros

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 1,884
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
Online and offline images change
« on: May 11, 2020, 06:58:13 AM »
I am trying to change the images to Font Awesome icons. I find it a bit complex to adapt the following string in display.template. I want to replace with those two (online and offline image respectively)

Code: [Select]
<i class="far fa-comment-dots fa-lg"></i>
<i class="far fa-comment" fa-lg></i>

Here is the string:

Code: [Select]
// Since we know this person isn't a guest, you *can* message them.
if ($context['can_send_pm'])
echo '
<li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '" class=" tooltip">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '" />' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,654
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Online and offline images change
« Reply #1 on: May 11, 2020, 07:35:00 AM »
Try something like
Code: [Select]
<li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '" class=" tooltip">', $settings['use_image_buttons'] ? '($message['member']['online']['is_online'] ? '<i class="far fa-comment-dots fa-lg"></i>' : <i class="far fa-comment" fa-lg></i>')  : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline spiros

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 1,884
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
Re: Online and offline images change
« Reply #2 on: May 11, 2020, 07:51:22 AM »
Thanks! I got: syntax error, unexpected 'member' (T_STRING)

« Last Edit: May 11, 2020, 08:08:08 AM by spiros »

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,654
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Online and offline images change
« Reply #3 on: May 11, 2020, 08:03:01 AM »
Corrected here
Code: [Select]
<li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '" class=" tooltip">', $settings['use_image_buttons'] ? ($message['member']['online']['is_online'] ? '<i class="far fa-comment-dots fa-lg"></i>' : '<i class="far fa-comment" fa-lg></i>')  : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
« Last Edit: May 11, 2020, 08:19:23 AM by vbgamer45 »
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline spiros

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 1,884
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
Re: Online and offline images change
« Reply #4 on: May 11, 2020, 08:06:19 AM »
Thanks again!

Now: syntax error, unexpected '/'

I think it was wise of me not to try, if it gives you pain... then I would stand no chance.

I think one can test quickly here:
https://phpcodechecker.com/

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,654
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Online and offline images change
« Reply #5 on: May 11, 2020, 08:19:38 AM »
Forgot the '; on the end
Corrected here
Code: [Select]
<li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '" class=" tooltip">', $settings['use_image_buttons'] ? ($message['member']['online']['is_online'] ? '<i class="far fa-comment-dots fa-lg"></i>' : '<i class="far fa-comment" fa-lg></i>')  : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline spiros

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 1,884
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
Re: Online and offline images change
« Reply #6 on: May 11, 2020, 08:23:35 AM »
Oh, yes! Thank you so much for your kind help!

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,654
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Online and offline images change
« Reply #7 on: May 11, 2020, 08:24:48 AM »
Glad to help
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro