[Snippet] Online/Offline images Info

Mods, snippets and styles postet and supported by the users
Forum rules
As the forum title says this is for User Contributions
Post a support request in this forum and you will be banned!
Locked
User avatar
all4phone
BBCoder IV
BBCoder IV
Posts: 150
Joined: 11 Feb 2011, 13:50
BBCodes: 28
Favourite BBCode: Random text signature
Favourite MOD: BBCode Strikethrough MOD
Location: Poland
Contact:

[Snippet] Online/Offline images Info

Post by all4phone »

Online/Offline images Info
Written by all4phone, inspired by Stoker ;)

This phpBB3 snippet will show you how to display Online/Offline image in viewtopic and profile.


Open styles/prosilver/template/viewtopic_body.html
Find:

Code: Select all

    <!-- IF postrow.POSTER_POSTS != '' --><dd><strong>{L_POSTS}:</strong> {postrow.POSTER_POSTS}</dd><!-- ENDIF -->

Before add:

Code: Select all

    <dd><strong>Status:</strong><!-- IF postrow.S_ONLINE --><img src="images/online.gif" border="0" alt="" title="Online" /><!-- ELSE --><img src="images/offline.gif" border="0" alt="" title="Offline" /><!-- ENDIF --></dd>

Open styles/prosilver/template/memberlist_view.html
Find:

Code: Select all

  <dt>{L_USERNAME}:</dt>
Before add:

Code: Select all

<dt>Status:</dt><dd><!-- IF S_ONLINE --><img src="images/online.gif" border="0" alt="" title="Online" /><!-- ELSE --><img src="images/offline.gif" border="0" alt="" title="Offline" /><!-- ENDIF --></dd>
Selected images put in the root/images directory.
Attachments
onoffline.zip
(14.17 KiB) Downloaded 243 times
11online.gif
11online.gif (468 Bytes) Viewed 3244 times
11user_online.gif
11user_online.gif (790 Bytes) Viewed 3244 times
Last edited by all4phone on 06 Dec 2011, 15:23, edited 1 time in total.
User avatar
Stoker
Site Admin
Site Admin
Posts: 3540
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Online/Offline images Info

Post by Stoker »

Nice :thumb:
Board rules! No PM support
User avatar
FTH
BBCoder III
BBCoder III
Posts: 124
Joined: 25 Nov 2011, 23:28
BBCodes: 10
Contact:

Online/Offline images Info

Post by FTH »

thanks very much for this snippet ;)

just a question

it's not better to replace

Code: Select all

<img src="images/online.gif"
by

Code: Select all

<img src="styles/{T_THEME_PATH}/images/online.gif"
to display differents images per Style ?
User avatar
all4phone
BBCoder IV
BBCoder IV
Posts: 150
Joined: 11 Feb 2011, 13:50
BBCodes: 28
Favourite BBCode: Random text signature
Favourite MOD: BBCode Strikethrough MOD
Location: Poland
Contact:

[Snippet] Online/Offline images Info

Post by all4phone »

Yes it is a fantastic idea Franck, many thanks for that.

Here are the correct changes that need to be done:

Open: styles/your_style/template/viewtopic_body.html
Find:

Code: Select all

<!-- IF postrow.POSTER_POSTS != '' --><dd><strong>{L_POSTS}:</strong> {postrow.POSTER_POSTS}</dd><!-- ENDIF -->
Before add:

Code: Select all

<dd>Status: <!-- IF postrow.S_ONLINE --><img src="{T_THEME_PATH}/images/online.png" border="0" alt="" title="Online" /><!-- ELSE --><img src="{T_THEME_PATH}/images/offline.png" border="0" alt="" title="Offline" /><!-- ENDIF --></dd>
Open: styles/prosilver/template/memberlist_view.html
Find:

Code: Select all

<dt>{L_USERNAME}:</dt>
Before add:

Code: Select all

<dt>Status: </dt><dd><!-- IF S_ONLINE --> <img src="{T_THEME_PATH}/images/online.png" border="0" alt="" title="Online" /><!-- ELSE --><img src="{T_THEME_PATH}/images/offline.png" border="0" alt="" title="Offline" /><!-- ENDIF --></dd>
Place these two eg images in styles/your_style/theme/images directory:
online.png
online.png (433 Bytes) Viewed 3023 times
offline.png
offline.png (439 Bytes) Viewed 3023 times
Refresh template of your style.

Demo:
Attachments
onoff.png
Last edited by all4phone on 06 Dec 2011, 22:04, edited 1 time in total.
User avatar
all4phone
BBCoder IV
BBCoder IV
Posts: 150
Joined: 11 Feb 2011, 13:50
BBCodes: 28
Favourite BBCode: Random text signature
Favourite MOD: BBCode Strikethrough MOD
Location: Poland
Contact:

[Snippet] Online/Offline images Info

Post by all4phone »

Sorry for the twice posting, but only three attachments was not enough to show what I wanted
Additionally, you can remove the standard status icon:
icon_user_online.gif
icon_user_online.gif (423 Bytes) Viewed 3018 times
Open: style/your_style/theme/colours.css
Find and remove:

Code: Select all

.online {
	background-image: url("{T_IMAGESET_LANG_PATH}/icon_user_online.gif");
}
Find and remove in styles/prosilver/imageset/your_language directory,
icon_user_online.gif file.
User avatar
Sniper_E
BBCoder II
BBCoder II
Posts: 44
Joined: 04 Dec 2011, 06:30
BBCodes: 1
Contact:

[Snippet] Online/Offline images Info

Post by Sniper_E »

That would create a CSS error to remove the .online class from the colours.css file.
IF you are going to remove the online image for this snippet...
I would suggest removing the online class from the viewtopic_body.html template instead.
Find

Code: Select all

	<div id="p{postrow.POST_ID}" class="post <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_IGNORE_POST --> online<!-- ENDIF -->">
InLine Remove

Code: Select all

<!-- IF postrow.S_ONLINE and not postrow.S_IGNORE_POST --> online<!-- ENDIF -->
User avatar
all4phone
BBCoder IV
BBCoder IV
Posts: 150
Joined: 11 Feb 2011, 13:50
BBCodes: 28
Favourite BBCode: Random text signature
Favourite MOD: BBCode Strikethrough MOD
Location: Poland
Contact:

[Snippet] Online/Offline images Info

Post by all4phone »

Sniper_E wrote:IF you are going to remove the online image for this snippet...
I would suggest removing the online class from the viewtopic_body.html template instead.
@Sniper_E, thanks for your suggestion, it works perfectly :thumb: .
Locked