Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Hide user in online panel

Asked Modified Viewed 2,332 times
L
Liliplanet
L
  • Member, joined since
  • Contributed 89 posts on the community forums.
  • Started 26 threads in the forums
  • Started this discussions
asked
Member

Hi,

Please, how do I hide the Administrator in Users Online? Basically it seems I'm on the site all the time (which I am), and don't want users to feel they are being watched by 'Big Sister'.

Look forward to any reply.

Sincere regards,
Lilian
0 replies

14 posts

W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

Try to edit last_seen_users_panel.php:

$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id > '1' AND user_lastvisit>'0' AND user_status='0' ORDER BY user_lastvisit DESC LIMIT 0,10");


By adding the user_id > '1' the superamin should not be listed.

Oops added missing AND.
Edited by WEC on 20-01-2007 15:06,
0 replies
L
Liliplanet
L
  • Member, joined since
  • Contributed 89 posts on the community forums.
  • Started 26 threads in the forums
  • Started this discussions
answered
Member

absolutely fabulous! thank you WEC!
0 replies
S
Shaihulud
S
....sometimes dead is better....
  • Junior Member, joined since
  • Contributed 35 posts on the community forums.
  • Started 8 threads in the forums
answered
Junior Member

Wec do you have any idea how to do this on an individual basis ... hide user status ??
so a user can log in "hidden" some kind of an option for them ??
0 replies
W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

You can add a variable like the user_hide_email to the ".$db_prefix."users table and then modify edit_profile.php and \includes\update_profile_include.php to give an option to hide online status in the \infusions\last_seen_users_panel\last_seen_users_panel.php.

Then edit the \infusions\last_seen_users_panel\last_seen_users_panel.php like this:

$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_lastvisit>'0' AND user_hide_online = '0' AND user_status='0' ORDER BY user_lastvisit DESC LIMIT 0,10");


The attached is a quick test of this.

If you find it useful and it's not been done before, then i'll post it on the beta site.
0 replies
S
Shaihulud
S
....sometimes dead is better....
  • Junior Member, joined since
  • Contributed 35 posts on the community forums.
  • Started 8 threads in the forums
answered
Junior Member

WEC I'm going to spend some time on this today... I also want to be able to display hidden members to the admins, but not the usual members ... similar to phpBB perhaps in a different color or something and italicized how tough of a time do you think we'd have doing that ??

also I was thinking , we'd have to display something at the bottom of the forums ...


Members view
Users online : blah, blah
Guests : 0
Hidden members : 2

admin view
Users online : blah, blah
Guests : 0
Hidden members :SOnSO,somone else


just a thought .....
Edited by Shaihulud on 21-01-2007 15:46,
0 replies
J
Jock
J
Jock 10
  • Member, joined since
  • Contributed 116 posts on the community forums.
  • Started 15 threads in the forums
answered
Member

Quote

WEC wrote:
Try to edit last_seen_users_panel.php:

$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id > '1' AND user_lastvisit>'0' AND user_status='0' ORDER BY user_lastvisit DESC LIMIT 0,10");


By adding the user_id > '1' the superamin should not be listed.

Oops added missing AND.
Nice but I want to hide not just owner of the site (superadmin) but also other admins? How to do that?
0 replies
W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

Jock,

You could use the zip posted and then only make the option to hide online status available to certain user levels if that is what you had in mind.

Shaihulud,

Almost anything will be possible, but i can't code all the various suggestions. I hope that the examples i posted will help you in the right direction to make what functionality each of you would like to have.

The Users Online panel would also have to be modified since it displays some of the same data as the Last Seen Users panel.
0 replies
S
Shaihulud
S
....sometimes dead is better....
  • Junior Member, joined since
  • Contributed 35 posts on the community forums.
  • Started 8 threads in the forums
answered
Junior Member

True enough WEC, I'm going to go through all of these things & see what I can do with this and then send you all the files to look them over , your original idea... your credit ... mention me ..I'll be happy...
0 replies
W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

This is an example based on the last_seen_users_panel.php from v6_00-hide-users-online-v0_10.zip where users with hidden status will not be hidden to admins and superadmins, but appear in red color. Users who has not set status as hidden will appear in normal color.

<?php
/*---------------------------------------------------+
| PHPFusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }

if (file_exists(INFUSIONS."last_seen_users_panel/locale/".$settings['locale'].".php")) {
   include INFUSIONS."last_seen_users_panel/locale/".$settings['locale'].".php";
} else {
   include INFUSIONS."last_seen_users_panel/locale/English.php";
}

openside($locale['lsup000']);
$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_lastvisit>'0' AND user_status='0' ORDER BY user_lastvisit DESC LIMIT 0,10");
echo "<table cellpadding='0' cellspacing='0' width='100%'>";
if (dbrows($result) != 0) {
   while ($data = dbarray($result)) {
      $lastseen = time() - $data['user_lastvisit'];
      $iW=sprintf("%2d",floor($lastseen/604800));
      $iD=sprintf("%2d",floor($lastseen/(60*60*24)));
      $iH=sprintf("%02d",floor((($lastseen%604800)%86400)/3600));
      $iM=sprintf("%02d",floor(((($lastseen%604800)%86400)%3600)/60));
      $iS=sprintf("%02d",floor((((($lastseen%604800)%86400)%3600)%60)));
      if ($lastseen < 60){
         $lastseen= $locale['lsup001'];
      } elseif ($lastseen < 360){
         $lastseen= $locale['lsup002'];
      } elseif ($iW > 0){
         if ($iW == 1) { $text = $locale['lsup003']; } else { $text = $locale['lsup004']; }
         $lastseen = $iW." ".$text;
      } elseif ($iD > 0){
         if ($iD == 1) { $text = $locale['lsup005']; } else { $text = $locale['lsup006']; }
         $lastseen = $iD." ".$text;
      } else {
         $lastseen = $iH.":".$iM.":".$iS;
      }
      if ($data['user_hide_online'] == '1' && (iADMIN || iSUPERADMIN)){
      echo "<tr>\n<td class='side-small' align='left'><img src='".THEME."images/bullet.gif' alt=''>\n";
      echo "<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' title='".$data['user_name']."' class='side'><font color='#FF0000'>\n";
      echo trimlink($data['user_name'], 15)."</a></td><td class='side-small' align='right'>".$lastseen."</font></td>\n</tr>\n";      
      }
      elseif ($data['user_hide_online'] == '0'){
      echo "<tr>\n<td class='side-small' align='left'><img src='".THEME."images/bullet.gif' alt=''>\n";
      echo "<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' title='".$data['user_name']."' class='side'>\n";
      echo trimlink($data['user_name'], 15)."</a></td><td class='side-small' align='right'>".$lastseen."</td>\n</tr>\n";      
      }
   }
}
echo "</table>";
closeside();
?>


The code is not complicated, so it should be easy to adjust to the functionality you like. As for adding code to forum, i would recommend that you just set the Last Seen Users panel as a L-Ctr panel in forum pages, then no need to modify forum. You can use the Custom Panels Control from the beta site to set panels on only certain pages.
0 replies
J
Jock
J
Jock 10
  • Member, joined since
  • Contributed 116 posts on the community forums.
  • Started 15 threads in the forums
answered
Member

Quote

WEC wrote:
Jock,

You could use the zip posted and then only make the option to hide online status available to certain user levels if that is what you had in mind.
It is true but I need code for that or least I need to hide two users id. User id=1 and user id=2.

How can I do that?

This is correct code for that or not?

$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id > '1' AND user_id>'2' AND user_lastvisit>'0' AND user_status='0' ORDER BY user_lastvisit DESC LIMIT 0,10");
Edited by Jock on 21-01-2007 23:12,
0 replies
W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

To hide users with id 1 and 2 you can use this:

$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id > '2' AND user_lastvisit>'0' AND user_status='0' ORDER BY user_lastvisit DESC LIMIT 0,10");


List is then only displayed for users with id larger than 2.
0 replies
S
Shaihulud
S
....sometimes dead is better....
  • Junior Member, joined since
  • Contributed 35 posts on the community forums.
  • Started 8 threads in the forums
answered
Junior Member

Wec I ran through this & had a couple of issues ...first off the SQL statement to set up the Users_hide_online is configured to set the online status to hidden as default.. I changed the "1" to "0" and it takes care of that no problem... buuuut...when you go into the edit profile .. whether you set Hidden status to yes or no ... it doesn't change ...at all. haven't a clue on what the issue is there...
0 replies
W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

Check if you uploaded the includes\update_profile_include.php

That's the only reason i can up with. It's working ok for me.
0 replies
S
Shaihulud
S
....sometimes dead is better....
  • Junior Member, joined since
  • Contributed 35 posts on the community forums.
  • Started 8 threads in the forums
answered
Junior Member

Yep that seemed to fix the issue. I'm still going to run the SQL on the active site with the default set to "0" for now ....I did all this on my Dev machine to verify everything... then I'm going to work on the footer in the forums .. I have the updated forum from Fuzed Themes... and I want to add the info on the bottom so it looks like this :


dead-central.com/whoseONLine.jpg
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 14 posts
  • Votes 0 votes
  • Topic users 4 members

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet