Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

New 'user' groups added OK but how do I ...

Quote Reply
New 'user' groups added OK but how do I ...
OK I've had no problems with the added 'groups' in my Forums...
That is... I've added 'extra' groups on top of the 'validated', 'registered',
'administrators' etc.

Now... How do I add info to the STATS page to show how many 'users'
are in those 'new' catagories of members. I have a 'Full Member'
and 'Charter Member' catagory, that I'd like to have show up in on the
STATS page right below the the 'registered' users number.

I've lloked at the templated (admin editable) but my problem is where do
I find, and or what are, the variables that would identify the numbers of users
in these new groups.

I see the num_registered variable and such, but where do I find what the variable
name is to use to have the new groups number of members show
up?

How where do I find the standards for the naming conventions of variable used
throughout the Fourm coding?
Quote Reply
Re: [ptegler] New 'user' groups added OK but how do I ... In reply to
The easiest way will be with a global of some sort. Try something like this:

extra_group_counts:
Code:
sub {
my $tables = $DB->table('UserGroup', 'Grouping');
$tables->select_options("GROUP BY group_id_fk");
my %group = $tables->select('group_id', 'COUNT(*)')->fetchall_list;
for (keys %group) { $group{"group_count_$_"} = delete $group{$_} }
\%group;
}

Now, in the template, it's just a matter of doing something like the following, replacing 123 and 456 with the appropriate group ID's:

<%extra_group_counts%>
Special group members: <%group_count_123%>
Other group members: <%group_count_456%>
Quote Reply
Re: [Jagerman] New 'user' groups added OK but how do I ... In reply to
Well now I just feel stupid. Tongue

I understand the global. I added it and the sub as described.

I went into the tool_stats.html template and added in my groups
I wanted to list. I added my Full Member: and Charter Member:
groups right under the Administrators: and before the Registered Users:
listings.

BUT... when adding in the variable/globals as as described.... all I end up
with is errors telling me the variables are undefined!

Why can't I do it via a noraml GT call liek the other variables?
Aren't they new groups I add, handled the same way as the rest of them?
Quote Reply
Re: [ptegler] New 'user' groups added OK but how do I ... In reply to
Hi,

Did you add the global to the "admin" template set globals file, or the "default" one?


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] New 'user' groups added OK but how do I ... In reply to
Duh...Crazy I did say I felt stupid... I had a feeling it was something
THAT simple. Thanks again Jag... and you too Pug. That worked
as expected, after I placed the global i nthe admin_editable template
group.Smile