Gossamer Forum
Quote Reply
Re: [gotze] if group In reply to
Could probably do it with something like this;

Code:
sub {

my $id = '3';

my $table = $DB->table('UserGroup');
my $chk = $table->count( { group_id_fk => $id, user_id_fk => $USER->{user_id} } ) || 0;

if ($chk > 0) {
return 1;
} else {
return 0;
}

# Basically, the query is:
# SELECT COUNT(*) FROM forum_UserGroup user_id_fk => $USER->{user_id} group_id_fk= 5
# This checks to see if the user is a member of the group specified
}

Call with;

<%global_name%>, and it should pick up their user_id if they are logged in :)

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread if group gotze 3118 Apr 28, 2002, 1:53 PM
Post Re: [gotze] if group
Andy 2709 Sep 27, 2004, 6:02 AM