1 (edited by Globox 2005-05-17 17:56)

Topic: Information by user group

Hello everyone, I have the following working code:

<?php if ($pun_user['is_guest'])
 echo "Guest";
           else echo "Member" ?>

Obviously I stripped it down to the basics to show what it does, but what I want it to do now is only echo "Member" if the currently logged in user is in a certain group. Let's call it "Member2".

How can I do this? I looked in extern.php and found the following block of code:

// Define a few commonly used constants
define('PUN_UNVERIFIED', 32000);
define('PUN_ADMIN', 1);
define('PUN_MOD', 2);
define('PUN_GUEST', 3);
define('PUN_MEMBER', 4);

And added this to the end of it:

define('PUN_MEMBER2', 5);

But I don't know what that did! Lol. Anyway, any help would be GREATLY appreciated.

Re: Information by user group

Come on, I know there's got to be a way to do this. Something like "$pun_usergroup['is_member2']" for example is what I'm looking for.

Re: Information by user group

Also, I'm not able to display latest forum posts/topics on the main page that are taken from a protected forum (one that denies permissions to everyone except a certain group). I want these posts to be shown only to this group, and I really need a way to check their group on the main page so I can display different information for different groups.

Re: Information by user group

to checkthe usergroup use $pun_user['g_id'] for their group id

Re: Information by user group

I'm afraid that doens't work for me, Connorhd, I get an undefined index error.

Notice: Undefined index: g_5

Re: Information by user group

no $pun_user['g_id'] returns the current users id e.g. $pun_user['g_id'] == 5 not $pun_user['g_5']

Re: Information by user group

Got it, thanks for the help.