Previous Thread
Next Thread
Print Thread
Hop To
[FIXED for 7.4.1] [7.4] online/offline indicator on profile pages is always online #218315 10/22/2008 3:41 PM
Joined: Aug 2006
Posts: 1,356
Yarpâ„¢ Offline OP
veteran
OP Offline
veteran
Joined: Aug 2006
Posts: 1,356
The change log says:
Feature: Added the online/offline indicator to the profile pages.

Well, we might have the mood icon there, but there is no code whatsoever in the script that generates the page that acually looks if a user is online/offline smile


[Linked Image from siemons.org]
Re: [7.4] online/offline indicator on profile pages is always online [Re: Yarpâ„¢] #218327 10/22/2008 5:25 PM
Joined: Aug 2006
Posts: 1,356
Yarpâ„¢ Offline OP
veteran
OP Offline
veteran
Joined: Aug 2006
Posts: 1,356
For anyone interested, this is the fix I implemented on my board to have it actually display an online indicator.

/scripts/showprofile.inc.php
find:
PHP Code

	$mood_alt = preg_replace("#.(gif|jpg|png)$#","",$mood); 

Replace with:
PHP Code

	$extraquery = "";
	if (!$config['DISABLE_ONLINE_INVISIBLE'] && ($user['USER_MEMBERSHIP_LEVEL'] != "Administrator" && !preg_match("/Moderator/",$user['USER_MEMBERSHIP_LEVEL']))) {
		$extraquery = "AND t2.USER_VISIBLE_ONLINE_STATUS = 'YES'";	
	}
	$query = "
		SELECT count( t1.USER_ID )
		FROM ubbt_ONLINE AS t1, ubbt_USER_PROFILE AS t2
		WHERE t1.USER_ID = t2.USER_ID
		AND t1.USER_ID = ?
		$extraquery
	";
	$sth = $dbh->do_placeholder_query($query,array($User),__LINE__,__FILE__);
	list($isonline) = $dbh -> fetch_array($sth);	
	if (!$isonline) {
		$mood = "offline.gif";
		$mood_alt = $ubbt_LANG['OFFLINE'];
	} else {
		$mood_alt = "{$ubbt_LANG['ONLINE']}   ".preg_replace("#.(gif|jpg|png)$#","",$mood);
	}
 

/templates/default/showprofile.tpl

find
Code
<img src="{$config.BASE_URL}/images/{$style_array.mood}/{$mood}" alt="{$lang.ONLINE}   {$mood_alt}" title="{$lang.ONLINE}   {$mood_alt}" />

replace with:
Code
<img src="{$config.BASE_URL}/images/{$style_array.mood}/{$mood}" alt="{$mood_alt}" title="{$mood_alt}" />

Last edited by blaaskaak; 10/22/2008 5:26 PM.

[Linked Image from siemons.org]

Link Copied to Clipboard
Forum Search
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Subscriptions Question
by Ruben - 01/14/2020 12:11 PM
Page won't load after 7.7.3 Update
by Jim0421 - 01/08/2020 11:11 AM
Ubb 7.7.3 winkey emoji shortcut issue
by Ruben - 01/07/2020 4:04 PM
testing winkey emoji shortcut
by Ruben - 01/06/2020 2:36 PM
Very strange problem
by Baldeagle - 01/05/2020 1:22 PM
Who's Online Now
0 members (), 71 guests, and 381 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Amusing Terain Scenics
Amusing Terain Scenics
by isaac, August 19
Sky places
Sky places
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Snapshot build 20200106)