1

Topic: Block admin group from showing in latest_visitors

I have added m.member_group_id!='1' to the DB query for the latest_visitors extension but it is not doing what I thought it would. I am trying to have everybody in group one hidden from the scrip output.

Help getting this to working would be appreciated.

Below is the code that is not working:

    {
        $result = $DB->query("SELECT m.*, d.*
                              FROM " . DB_PREFIX . "members AS m, " . DB_PREFIX . "members_data AS d, " . DB_PREFIX . "visitors AS v
                              WHERE v.member_id=" . intval($member_id) . " AND m.member_group_id!='1' AND v.visitor_id=m.member_id AND m.member_id=d.data_id AND m.active='1' $gender $picturesonly
                              ORDER BY v.visitdate DESC
                              LIMIT " . intval($max));
    }
    else
    {
        $result = $DB->query("SELECT m.*, d.*
                              FROM " . DB_PREFIX . "members AS m, " . DB_PREFIX . "members_data AS d
                              WHERE m.member_id=d.data_id AND m.member_group_id!='1' AND m.active='1' $gender $picturesonly
                              ORDER BY m.lastvisit DESC
                              LIMIT " . intval($max));
    }

Last edited by geoff (2007-07-26 21:18:41)

2

Re: Block admin group from showing in latest_visitors

It should be m.group_id!=1 (not member_group_id).

Developer

3

Re: Block admin group from showing in latest_visitors

Thanks vlad. That is what I was looking for. I have also upgraded to the most recent version of that ext and added the changes to that.

Here are the changes for others if they want to use them:

In latest_visitors.php (around line 75)

Look for:

WHERE m.member_id=d.data_id AND m.active='1' AND m.pending='0'

and replace it with:

WHERE m.group_id!=1 AND m.member_id=d.data_id AND m.active='1' AND m.pending='0'

4

Re: Block admin group from showing in latest_visitors

I would like to do the same, however this post is quite old so I´m wondering if the equivalent for 2.5.5 is:

File:
includes/lib/lib.account_visitors.php

...and code:

$result = $DB->query("SELECT v.visitor_id, v.visitdate, m.*
                          FROM " . DB_PREFIX . "members AS m, " . DB_PREFIX . "visitors AS v
                          WHERE v.member_id='" . $SESSION->conf['member_id'] . "' AND v.visitor_id=m.member_id AND m.active='1'
                          ORDER BY v.visitdate DESC
                          LIMIT " . (($page - 1) * $PREFS->conf['visitors_per_page']) . ", " . $PREFS->conf['visitors_per_page']);


1) If yes, which changes do I need to make in order to hide Admin group members?

2) How can I do the same for "Latest members" in the sidebar?


Thanks.

5

Re: Block admin group from showing in latest_visitors

1) Instead of just not displaying saved record, I would just not save profile visit:

Open lib.member_profile.php and find:

if (!$profile_preview && $PREFS->conf['enable_visitors']

add right after it

&& $SESSION->conf['group_id'] != 1

2) Just use groups param for {members:} extension and pass all active group ids besides admins group id.
{members:....,groups="5|7"}

www.vldMagic.com - first choice customizations help desk
www.vldCrowd.com - vldPersonals admins community