Remove Banned Users From Memberlist

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
1
50%
Very Good
0
No votes
Good
1
50%
Fair
0
No votes
Poor
0
No votes
 
Total votes: 2

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 29038
Joined: Sat Aug 16, 2003 7:36 am

Remove Banned Users From Memberlist

Post by Extensions Robot »

MOD Name: Remove Banned Users From Memberlist
Author: alexi02
MOD Description: Removes banned users from being displayed on the memberlist

MOD Version: 1.0.2 (Updated 11/15/06)
Tested on phpBB Version: 2.0.21

Download File: remove_banned_users_from_memberlist_v1.0.2.mod
mods overview page: View
File Size: 6298 Bytes



Support for this MOD needs to be asked within this topic. The phpBB Teams are not responsible or required to give anyone support for this MOD. By installing this MOD, the phpBB Support Team or phpBB MODifications Team may not be able to provide support.

This MOD has only been tested by the phpBB MOD Team with the phpBB version listed in the topic. It may not work in any other versions of phpBB.
Last edited by Extensions Robot on Mon Apr 30, 2007 12:29 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

MOD Validated/Released

Notes:
A very simple MOD to remove banned users from forum's memberlist. However, this MOD might not work on all DBMSs phpBB supports.
Last edited by ycl6 on Wed Nov 15, 2006 12:33 pm, edited 1 time in total.
alexi02
Registered User
Posts: 271
Joined: Fri Mar 05, 2004 2:15 am
Location: Australia
Contact:

Post by alexi02 »

Thanks for validating :)
harpman
Registered User
Posts: 35
Joined: Thu Sep 16, 2004 8:30 pm

Post by harpman »

Nice, simple mod, and something a few of my users were clamouring for after we got attacked by impotent pill sellers and porn people.

One small niggle - it does nothing for the pagination list on the memberlist. So, I'm being offered a list of 5 pages of member and pages 3-5 are completely blank.
[ Do I understand your question? Is it hopeless and forlorn? ]
User avatar
Ladysarajane
Registered User
Posts: 441
Joined: Sat Feb 18, 2006 10:05 pm

Post by Ladysarajane »

Okay, simple to install I thought but somewhere I goofed and cannot find it....this is the error message I get when I click on Memberlist:

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'u.WHERE user_id <> -1 AND ISNULL( b.ban_userid ) ORDER BY use

SELECT u.username, u.user_id, u.user_viewemail, u.user_posts, u.user_regdate, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_msnm, u.user_avatar, u.user_avatar_type, u.user_allowavatar, b.ban_userid FROM phpbb_users u LEFT JOIN phpbb_banlist b ON u.user_id = b.ban_userid u.WHERE user_id <> -1 AND ISNULL( b.ban_userid ) ORDER BY user_regdate ASC LIMIT 0, 50

Line : 151
File : memberlist.php

Any ideal where I goofed editing the php?
alexi02
Registered User
Posts: 271
Joined: Fri Mar 05, 2004 2:15 am
Location: Australia
Contact:

Post by alexi02 »

Ladysarajane: I think you just need to get rid of the u. part from u.WHERE.

You basically want to change this:

Code: Select all

$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar
        FROM " . USERS_TABLE . "
        WHERE user_id <> " . ANONYMOUS . "
        ORDER BY $order_by";
into this:

Code: Select all

$sql = "SELECT u.username, u.user_id, u.user_viewemail, u.user_posts, u.user_regdate, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_msnm, u.user_avatar, user_avatar_type, u.user_allowavatar, b.ban_userid 
	FROM " . USERS_TABLE . " u LEFT JOIN " . BANLIST_TABLE . " b ON u.user_id = b.ban_userid
	WHERE u.user_id <> " . ANONYMOUS . " AND ISNULL( b.ban_userid ) 
        ORDER BY $order_by";
alexi02
Registered User
Posts: 271
Joined: Fri Mar 05, 2004 2:15 am
Location: Australia
Contact:

Post by alexi02 »

harpman: Thanks for finding that bug, I didn't notice it :P

I'll submit the updated v1.0.2 to the MODDB.
In the meantime, you can get v1.0.2 here or update from v1.0.1 here.
User avatar
Ladysarajane
Registered User
Posts: 441
Joined: Sat Feb 18, 2006 10:05 pm

Post by Ladysarajane »

alexi02 wrote: Ladysarajane: I think you just need to get rid of the u. part from u.WHERE.

You basically want to change this:

Code: Select all

$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar
        FROM " . USERS_TABLE . "
        WHERE user_id <> " . ANONYMOUS . "
        ORDER BY $order_by";
into this:

Code: Select all

$sql = "SELECT u.username, u.user_id, u.user_viewemail, u.user_posts, u.user_regdate, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_msnm, u.user_avatar, user_avatar_type, u.user_allowavatar, b.ban_userid 
	FROM " . USERS_TABLE . " u LEFT JOIN " . BANLIST_TABLE . " b ON u.user_id = b.ban_userid
	WHERE u.user_id <> " . ANONYMOUS . " AND ISNULL( b.ban_userid ) 
        ORDER BY $order_by";



Thanks, I did misplace that u.... :oops: It works now and deletes the member from the member list, but now the last member to registered is still showing the banned member, And if you click on the name it shows their profile. Is there a way for the last registered not to show the banned member or profile?
alexi02
Registered User
Posts: 271
Joined: Fri Mar 05, 2004 2:15 am
Location: Australia
Contact:

Post by alexi02 »

So your saying you don't want the banned user to appear if they are "The newest registered user" then do this following change in includes/functions.php.

Find

Code: Select all

case 'newestuser':
                        $sql = "SELECT user_id, username
                                FROM " . USERS_TABLE . "
                                WHERE user_id <> " . ANONYMOUS . "
                                ORDER BY user_id DESC
                                LIMIT 1";
                        break;
Replace with

Code: Select all

case 'newestuser':
                        $sql = "SELECT u.user_id, u.username
                                FROM " . USERS_TABLE . " u LEFT JOIN " . BANLIST_TABLE . " b ON u.user_id = b.ban_userid
                                WHERE u.user_id <> " . ANONYMOUS . " AND ISNULL( b.ban_userid )
                                ORDER BY u.user_id DESC
                                LIMIT 1";
                        break;
User avatar
Ladysarajane
Registered User
Posts: 441
Joined: Sat Feb 18, 2006 10:05 pm

Post by Ladysarajane »

That worked Great! :D

Thank you so much!!!

You should add that as an option in the mod, so people won't look up the banned users profile, if they happened to be the last user to sign up.
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

MOD Updated to version 1.0.2
See first post for Download Link
Flob
Registered User
Posts: 5
Joined: Mon Nov 07, 2005 1:03 pm

Post by Flob »

Will or Can this mod also prevent non-active (new registrations) from being listed?

I want to prevent the spammers from listing before I get the chance to ban/delete them.

Regards
Flob
notubes_pete
Registered User
Posts: 3
Joined: Wed May 17, 2006 3:57 pm

Post by notubes_pete »

Flob wrote: Will or Can this mod also prevent non-active (new registrations) from being listed?

I want to prevent the spammers from listing before I get the chance to ban/delete them.

Regards
Flob

use this mod
http://www.phpbb.com/phpBB/viewtopic.php?t=450832
NiGGa92
Registered User
Posts: 5
Joined: Wed Sep 20, 2006 1:16 pm

Post by NiGGa92 »

i'm having some problems:

Parse error: syntax error, unexpected T_IF in /mnt/136/sdb/2/0/jovenspt/forum/memberlist.php on line 302

around line 302:


Code: Select all

	$sql = "SELECT count(*) AS total
		FROM " . USERS_TABLE . " u LEFT JOIN " . BANLIST_TABLE . " b ON u.user_id = b.ban_userid
		WHERE u.user_id <> " . ANONYMOUS . " AND ISNULL( b.ban_userid )"

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql);
	}
i've try without (") but it returns me an error at line 309:

Code: Select all

	if ( $total = $db->sql_fetchrow($result) )
	{
		$total_members = $total['total'];

		$pagination = generate_pagination("memberlist.$phpEx?mode=$mode&order=$sort_order", $total_members, $board_config['topics_per_page'], $start). '&nbsp;';
	}
	$db->sql_freeresult($result);

If someone has a solution.. plz tell me how to do.

thx
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52967
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf »

NiGGa92 wrote: unexpected T_IF

Code: Select all

		WHERE u.user_id <> " . ANONYMOUS . " AND ISNULL( b.ban_userid )"

	if ( !($result = $db->sql_query($sql)) )
	


You are missing the ";" at the end of that statement before the IF
Post Reply

Return to “[2.0.x] MOD Database Releases”