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";
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 wrote: Ladysarajane: I think you just need to get rid of the u. part from u.WHERE.
You basically want to change this:
into 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";
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";
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;
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;
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
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);
}
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). ' ';
}
$db->sql_freeresult($result);
NiGGa92 wrote: unexpected T_IFCode: Select all
WHERE u.user_id <> " . ANONYMOUS . " AND ISNULL( b.ban_userid )" if ( !($result = $db->sql_query($sql)) )