View Full Version : small request plz
SilverBoy
04-03-2001, 11:51 PM
I wanna add numer of users of all titles to my index page, so can some one help me to do that ;) thx.
ex:
1 adminstrator
8 moderators
165 joniour member
78 member
15 senior member
and I wish I can add it too other php page too.
thx for help.
Swoosh
04-04-2001, 12:59 PM
Good suggestion, SilverBoy! :)
Would certainly make a useful small hack for lots of vBulletin users out there.
Could someone please create this hack? Thank you! :D
SilverBoy
04-05-2001, 02:41 PM
I want it plz make it to me.
SilverBoy
04-05-2001, 08:38 PM
u are gentel man. ;)
Swoosh
04-06-2001, 04:23 AM
Good luck with the hack, PeF! :)
SilverBoy
04-08-2001, 10:21 PM
Iam still waiting ?????? :D
Add this code to the page you want to show the user totals on: $users = $DB_site->query("SELECT usergroup.title, COUNT(userid) AS users
FROM usergroup
LEFT JOIN user USING(usergroupid)
GROUP BY usergroup.usergroupid");
while ($user = $DB_site->fetch_array($users)) {
$usertotals .= "$user[title] ($user[users])<br>";
} ...and then add $usertotals to an appropriate template.
Easy peasy :)
SilverBoy
04-09-2001, 10:43 AM
I will try it and replay later, thx ;)
SilverBoy
04-09-2001, 11:04 AM
thx Kier but I tried it on vb115 and work fine, but it is not what i want, I wanna to display usertitles not usergroups, sorry for bothering u but can u to modify it.;)
polgas
04-09-2001, 06:21 PM
Replace Kier's SQL query with this:
SELECT user.usertitle, COUNT(userid) AS users
FROM user
GROUP BY user.usertitle
Hope this helps.
jojo85
04-09-2001, 06:41 PM
Lol Pef,don't forget that Kier is the better php coder's of the World (for vbulletin ;) )
SilverBoy
04-09-2001, 08:03 PM
I have 4 users in my test board, and when I test it, it gived me a list without titles only numbers, and they was 3 numbers only, but I have 4 titles to those users, any help???:confused:
polgas
04-09-2001, 09:01 PM
try the sql query if you have this.
SilverBoy
04-09-2001, 11:35 PM
I didnt get ur meaning, sorry
polgas
04-10-2001, 03:55 PM
Do you know if you have phpmyAdmin access to your site? If you have, run the SELECT statement I posted and see if you get the result you wanted.
SilverBoy
04-11-2001, 10:03 AM
I checked in phpmyadmin and it was very nie, I think there are some modification in the rest of kier code to display every thing correctly in the index page, any help.
SilverBoy
04-12-2001, 11:15 AM
can u do it with new select statment?
trilizio
04-12-2001, 07:10 PM
$users = $DB_site->query("SELECT user.usertitle, COUNT(userid) AS users
FROM user
GROUP BY user.usertitle");
while ($user = $DB_site->fetch_array($users)) {
$usertotals .= "$user[usertitle] ($user[users])<br>";
}
I think this might work
not 100% sure.
SilverBoy
04-14-2001, 01:20 PM
it works fine now, thx for ur help all.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.