I'm trying to have a global check if a post author is in a particular group, and then assign them a particular color if they are, but it's behaving oddly. When I do just <%user_groupcheck($user_id)%> it correctly returns what I need it to, either 1 or 0. However, when I use it as I need to, within an if statement, it acts as though it's always false.
<%if user_groupcheck($user_id)%><%grouphtml%><%endif%>
The global I have is:
'user_groupcheck' => 'sub {
my $uid = shift;
my $count = $DB->table("UserGroup")->count({
group_id_fk => 18,
user_id_fk => $uid
});
return ($count and $count > 0);
}',
Realiiity.com Forums
<%if user_groupcheck($user_id)%><%grouphtml%><%endif%>
The global I have is:
'user_groupcheck' => 'sub {
my $uid = shift;
my $count = $DB->table("UserGroup")->count({
group_id_fk => 18,
user_id_fk => $uid
});
return ($count and $count > 0);
}',
Realiiity.com Forums