Author Topic: [MOD] Hide Admin/Moderator Accounts from People Page  (Read 1918 times)

videosforkids

  • V3 Beta Tester
  • Full Member
  • *
  • Posts: 279
[MOD] Hide Admin/Moderator Accounts from People Page
« on: February 10, 2010, 06:53:34 PM »
This question was asked in the Support board and I was glad to see it, because I had not thought of this before but it's a nice little mod to hide the admin account from the main member list on the People page.

Easy mod but backup people.php just in case.

Open people.php

Find:

Code: [Select]
//query for all members
$sqlquery = "SELECT * FROM member_profile WHERE account_status = 'active' ORDER BY user_id DESC";

Change to:

Code: [Select]
//query for all members
$sqlquery = "SELECT * FROM member_profile WHERE account_status = 'active' AND user_group = 'member' ORDER BY user_id DESC";

chejugu

  • Newbie
  • *
  • Posts: 7
Re: [MOD] Hide Admin/Moderator Accounts from People Page
« Reply #1 on: February 27, 2010, 09:05:55 PM »
hi, nice trick!! ::)
my people.php file looks like this:
include_once ('classes/config.php');

include_once ('classes/sessions.php');



// this is per template from config.inc.php advanced config settings

$page_display_small_width   = $config['general_medium_thumb_width'];

$page_title            = $lang_browse_members . ' ' . $lang_on .  ' ' . $site_name;

$submitted             = $_POST['submitted'];

$limit             = 20;



$sql                = "SELECT user_id FROM member_profile";

$members_total          = number_format( @mysql_num_rows( mysql_query( $sql ) ) );



$which_one            = mysql_real_escape_string($_GET['load']);





//CHECK IF FORM SUBMITTED

if ($_POST['submitted'] == 'yes') {



   //check for search fields and buld sql query

       if ($_POST['firstname'] != "") {

          $query_1 = " AND first_name = '" . mysql_real_escape_string($_POST['firstname']) ."' ";

       }



       if ($_POST['surname'] != "") {

         $query_2 = "AND last_name = '" . mysql_real_escape_string($_POST['surname']) ."' ";

       }



       if ($_POST['username'] != "") {

         $query_3 = "AND user_name = '" . mysql_real_escape_string($_POST['username']) ."' ";

       }



       if ($_POST['home_country'] != "") {

         $query_4 = "AND current_country = '" . mysql_real_escape_string($_POST['home_country']) ."' ";

       }



   $sqlquery = "SELECT * FROM member_profile WHERE account_status ='active'" . $query_1 . $query_2 . $query_3 . $query_4;


wich query needs to be changed?
Thanx

xtjoeywx

  • Newbie
  • *
  • Posts: 11
Re: [MOD] Hide Admin/Moderator Accounts from People Page
« Reply #2 on: March 01, 2010, 03:58:08 AM »
I'm trying to do the same thing but my people.php looks like chejugu's too. What do we change to make this work?

epinett

  • Guest
Re: [MOD] Hide Admin/Moderator Accounts from People Page
« Reply #3 on: March 01, 2010, 06:10:00 AM »
I'm trying to do the same thing but my people.php looks like chejugu's too. What do we change to make this work?

change this:  $sqlquery = "SELECT * FROM member_profile WHERE account_status ='active'" . $query_1 . $query_2 . $query_3 . $query_4;


to:

 $sqlquery = "SELECT * FROM member_profile WHERE account_status ='active' AND user_group = 'member' " . $query_1 . $query_2 . $query_3 . $query_4;

xtjoeywx

  • Newbie
  • *
  • Posts: 11
Re: [MOD] Hide Admin/Moderator Accounts from People Page
« Reply #4 on: March 06, 2010, 01:56:40 AM »
@sol5m

I changed this:

$sqlquery = "SELECT * FROM member_profile WHERE account_status ='active'" . $query_1 . $query_2 . $query_3 . $query_4;

To this:

 $sqlquery = "SELECT * FROM member_profile WHERE account_status ='active' AND user_group = 'member' " . $query_1 . $query_2 . $query_3 . $query_4;


Like you said.. But my admin account still shows up on the people page. Please go to www.weeklyfame.com/people to see what I mean. My admin account is called weeklyfa.

Did I do something wrong or did I not do enough?

Thanks!

chejugu

  • Newbie
  • *
  • Posts: 7
Re: [MOD] Hide Admin/Moderator Accounts from People Page
« Reply #5 on: March 11, 2010, 02:03:45 PM »
it didn't work for me either!  ???

keyshawn

  • Newbie
  • *
  • Posts: 27
Re: [MOD] Hide Admin/Moderator Accounts from People Page
« Reply #6 on: April 02, 2010, 12:56:23 AM »
This mod works your just not going down far enough. Look for //Show all members then under that you will see //query for all members. Only difference is instead of DESC it has ASC.

Is there anyway to just hide the admin profile and not the mods? That is what I need.

sbcjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6247
    • PHPmotion Mods
Re: [MOD] Hide Admin/Moderator Accounts from People Page
« Reply #7 on: April 02, 2010, 03:32:27 AM »
This mod works your just not going down far enough. Look for //Show all members then under that you will see //query for all members. Only difference is instead of DESC it has ASC.

Is there anyway to just hide the admin profile and not the mods? That is what I need.

You could use something like: AND user_group != 'admin'

keyshawn

  • Newbie
  • *
  • Posts: 27
Re: [MOD] Hide Admin/Moderator Accounts from People Page
« Reply #8 on: April 02, 2010, 07:29:36 AM »

You could use something like: AND user_group != 'admin'

Thanks that worked perfectly :)

pakmotion

  • Jr. Member
  • **
  • Posts: 108
Re: [MOD] Hide Admin/Moderator Accounts from People Page
« Reply #9 on: June 19, 2010, 10:24:16 PM »
Very nice mod Thanks for sharing

pakmotion

  • Jr. Member
  • **
  • Posts: 108
Re: [MOD] Hide Admin/Moderator Accounts from People Page
« Reply #10 on: November 20, 2010, 03:14:18 PM »
This mod works your just not going down far enough. Look for //Show all members then under that you will see //query for all members. Only difference is instead of DESC it has ASC.

Is there anyway to just hide the admin profile and not the mods? That is what I need.

You could use something like: AND user_group != 'admin'
Its not works for me i change that ASC into DESC and my admin account went at the end of member list mean its still shows and if i use ASC then the result is that my admin account came at 1st postion
and i'm useing this method
Code: [Select]
$sqlquery = "SELECT * FROM member_profile WHERE account_status ='active'AND user_group = 'member'" . $query_1 . $query_2 . $query_3 . $query_4;

pakmotion

  • Jr. Member
  • **
  • Posts: 108
Re: [MOD] Hide Admin/Moderator Accounts from People Page
« Reply #11 on: November 20, 2010, 03:33:57 PM »
This mod works your just not going down far enough. Look for //Show all members then under that you will see //query for all members. Only difference is instead of DESC it has ASC.

Is there anyway to just hide the admin profile and not the mods? That is what I need.

You could use something like: AND user_group != 'admin'
Its not works for me i change that ASC into DESC and my admin account went at the end of member list mean its still shows and if i use ASC then the result is that my admin account came at 1st postion
and i'm useing this method
Code: [Select]
$sqlquery = "SELECT * FROM member_profile WHERE account_status ='active'AND user_group = 'member'" . $query_1 . $query_2 . $query_3 . $query_4;

Got it work change line
Code: [Select]
$sqlquery = 'SELECT * FROM member_profile ORDER BY user_id ASC';into  this
Code: [Select]
$sqlquery = "SELECT * FROM member_profile WHERE account_status = 'active' AND user_group = 'member' ORDER BY user_id ASC";and now i want to know if there is anyway that only admin can see evry member