Previous Thread
Next Thread
Print Thread
Hop To
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
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]
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
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
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
spam issues
by ECNet - 03/19/2024 11:45 PM
Who's Online Now
1 members (Ruben), 802 guests, and 202 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)