Posted on: 02/09/05 06:02pm
By: ronack
I wanted a simple count of the amount of users so I created this block function which displays "Total Members: #".
Place the following in your lib-custom.php
function phpblock_usercount(){
GLOBAL $_TABLES, $_USER;
$result = mysql_query( "SELECT * FROM {$_TABLES["users"]} WHERE uid <> '0' ");
$usercount = mysql_num_rows($result);
$return = "Total Members: ";
$return .= $usercount;
return $return;
}
Then create the php block phpblock_usercount you can call it what you want I called it Members.
Total Members Block
Posted on: 02/09/05 07:13pm
By: TechSys
Nice little addition there. Just added it to my site (very little users though) and it worked like a charm.
Total Members Block
Posted on: 02/09/05 10:15pm
By: ronack
I have one site with about 85 and another with about 45. The hope here is that people will see the site as popular and register.
Total Members Block
Posted on: 02/12/05 12:30am
By: r_f_o_t
Nice little block. I did make one small change so it would not count anon users.
changed
WHERE uid <> '0' ");
to
WHERE uid > '1' ");
Thanks,
Chuck