News:

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

Main Menu

Online and offline images change

Started by spiros, May 11, 2020, 06:58:13 AM

Previous topic - Next topic

spiros

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)

<i class="far fa-comment-dots fa-lg"></i>
<i class="far fa-comment" fa-lg></i>


Here is the string:

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

vbgamer45

Try something like

<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

spiros

#2
Thanks! I got: syntax error, unexpected 'member' (T_STRING)


vbgamer45

#3
Corrected here

<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

spiros

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/

vbgamer45

Forgot the '; on the end
Corrected here

<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

spiros

Oh, yes! Thank you so much for your kind help!

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

Advertisement: