Topic: Figuring out if a username is banned?

What i'm trying to do is add another entry to the $user_info[] array on the file viewtopic.php, it shows what group they are on by adding a "Group: Blah Blah" below "Registered: Blah Blah" on each post.

What i have now works perfectly fine except for banned users. I need to know how to figure out if the user is banned or not, and if true the group is called "Banned", anyone wanna help?

Re: Figuring out if a username is banned?

It does that already though.

I don't HAVE a signature, ok?

Re: Figuring out if a username is banned?

creaturecorp wrote:

It does that already though.

No it doesn't, you probably didn't understand my question. I'll rephrase it:

I added "Group: blahblah" to show up on people's post, but if i ban someone the group shows up as members, i need it to show up as "Banned"... Understand now?

Re: Figuring out if a username is banned?

If you ban someone their Title changes to Banned

Re: Figuring out if a username is banned?

Connorhd wrote:

If you ban someone their Title changes to Banned

I know, but is there a specific variable or function that you can use to figure out if the user is banned?

This is the code i'm using on viewtopic.php:

if ($cur_post['g_id'] == '1')
$group = 'Administrators';

if ($cur_post['g_id'] == '2')
$group = 'Moderators';

if ($cur_post['g_id'] == '3')
$group = 'Guest';

if ($cur_post['g_id'] == '4')
$group = 'Members';

$user_info[] = '<dd>Group: '.$group;

I need something like:

if (user is banned) {
$group = 'Banned';
}

Understand what i'm doing now?

Re: Figuring out if a username is banned?

why don't you look how it currently works out if you are banned and use that?

Re: Figuring out if a username is banned?

Connorhd wrote:

why don't you look how it currently works out if you are banned and use that?

Because I didn't find it...

Re: Figuring out if a username is banned?

Sorry for the double post but can anyone please help me?

My MSN is xblueorbx@gmail.com if you wanna talk to me about this.

Re: Figuring out if a username is banned?

Why are you recreating something that is already built into punbb? If it's just the placement you want to change, do so.

Do you know how to make groups?

I don't HAVE a signature, ok?

Re: Figuring out if a username is banned?

creaturecorp wrote:

Why are you recreating something that is already built into punbb? If it's just the placement you want to change, do so.

Do you know how to make groups?

You probably didn't understand my question. I need to know if there's a variable or a function or something that would tell me if a certain user is banned so the $group variable would output "Banned" if the user that has posted is banned.

Re: Figuring out if a username is banned?

But that doesn't make sense, it DOES do that already.

Re: Figuring out if a username is banned?

No, i'm creating something where the user posts and below the "Registered: 00-00-00" it will output "Group: Members" or "Group: Administrators" but if the user is banned what would i use to make it say "Group: Banned"... that's my question.

Re: Figuring out if a username is banned?

He wants something like this:

Blueorb
Member
Group: Banned
Registered: 2005-06-25
Posts: 21

IS that so hard to understand?  God.

Re: Figuring out if a username is banned?

Stolen from get_title(), so it may not work perfectly

    global $pun_bans, $lang_common;
    static $ban_list;

    // If not already built in a previous call, build an array of lowercase banned usernames
    if (empty($ban_list))
    {
        $ban_list = array();

        foreach ($pun_bans as $cur_ban)
            $ban_list[] = strtolower($cur_ban['username']);
    }

    // If the user is banned
    if (in_array(strtolower($user['username']), $ban_list))
        $user_title = $lang_common['Banned'];

15 (edited by Blueorb 2005-12-21 21:16)

Re: Figuring out if a username is banned?

Thanks for finally understanding it, i'll test it and see if it works.

Edit: Nope, didn't work sad Anyone else think they can help me?