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 4: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
Yarp #218327 10/22/2008 6: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 6:26 PM.

[Linked Image from siemons.org]

Link Copied to Clipboard
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Disaster!!! Files became empty.. Please advise.
by Morgan - 07/27/2020 2:38 PM
Unable to Update Censor List
by BOTCuser - 07/22/2020 9:15 AM
7.7.4 error on rebuilders
by Ruben - 07/21/2020 3:06 PM
[STOCK] UBB.threads Group Image Pack
by isaac - 07/19/2020 9:03 PM
Who's Online Now
3 members (Ruben, Gizmo, 1 invisible), 71 guests, and 57 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
Powered by UBB.threads™ PHP Forum Software 7.7.5
(Snapshot build 20200804)