vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   COUNT'ing usergroups... (https://vborg.vbsupport.ru/showthread.php?t=58142)

Tryfwar 10-24-2003 12:31 PM

COUNT'ing usergroups...
 
Is there a way that i can have the total number of members belonging to a usergroup displayed in the header of each usergorup table listed in showgroups.php ?

I don't want to create a seperate SQL query for every instance of a usergroup, but would rather somehow have a variable placed in the WHERE clause which is then later defined.

Thanks

assassingod 10-24-2003 02:03 PM

This is easy but since your forums is vB3, you'll have to wait til vB3 hacking is allowed

Tryfwar 10-24-2003 02:40 PM

aarrrrrrrrrrrrgggg! lol

Could you e-mail me?

nick@mortalis.com I would greatly appreciate any help :D

Its really only MySQL syntax that i need, not template or anything vB specific.

Heres what i have atm for a custom script (based on showgroups.php) which produces this : http://www.mortalis.com/?mainDiv=/forums/rollcall.php

As you can see i have a created 3 queries to produce the totals for active, inactive & all, but have not been able to think up a count query for each of the classes.

NickPR 06-01-2004 04:35 PM

bump ! been a while and vB3 is out now. Anyone able to help me still?

Xenon 06-01-2004 05:04 PM

if you open showgroups.php

you'll find that line:
PHP Code:

        eval('$usergroups .= "' fetch_template('showgroups_usergroup') . '";'); 

before that add:
PHP Code:

$num_users count($users); 

now you just have to add $num_users into the showgroups_usergroup template, where you want to ahve it :)

NickPR 06-01-2004 05:21 PM

it just returns 1. I have to admit that im using a very customised version of the showgroups.php and your probably not supposed to support me :p Its based on an older vb too now. So ill modify it so that it resembles the v3 more and try again.

Thanks for your reply :)

the Sandman 06-01-2004 05:31 PM

This works great... except the count is incorrect for the "Moderators" category that includes everyone who is assigned to Moderate Forums regardless of usergroup. Any way to get that number correct? :)

Xenon 06-01-2004 07:26 PM

for the moderators sections you have to use
PHP Code:

$num_users count($modcache); 

it should work i'd say

the Sandman 06-01-2004 07:28 PM

Quote:

Originally Posted by Xenon
for the moderators sections you have to use
PHP Code:

$num_users count($modcache); 

it should work i'd say

Where?

Xenon 06-01-2004 07:32 PM

before that:
PHP Code:

        exec_switch_bg();
        eval(
'$moderatorbits .= "' fetch_template('showgroups_usergroupbit') . '";'); 



All times are GMT. The time now is 03:41 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01121 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete