View Full Version : Total Members (Registrations) Hack
Kaelon
06-16-2003, 10:00 PM
TOTAL MEMBERS (REGISTRATIONS) HACK
Version 1.0 ~ 17 June 2003
This is a really elementary hack, but I was surprised that no one had publicized it for people who know little/nothing about PHP to use. (I did several extensive searches and found no mention of this. If someone else has already posted this, please just let me know and I'll defer appropriately.) This is also the first hack that I've decided to publish on vBulletin.org, even though I'm capable of a bit more complex, but probably because I was fairly certain of what I was doing here. ;)
What does it do?
The Total Members (Registrations) Hack will display the total number of people who have ever registered an account, at one time or another, on your forums, next to your forumhome Members count.
Why is this useful?
If you run a very large forum, with tens of thousands of registrations, but you like keeping your database's users table pruned to reflect only active members (e.g., we regularly prune members who don't post every x days and have less than x number of posts), you can still display the total number of people that have ever registered, at one time or another, on your forums.
What is involved?
1 php file edit (index.php) and 1 template edit (forumhome)
Will this slow down my forumhome?
No. It adds only one calculation and adds only one variable, both of which are expunged by vBulletin after use.
Screenshot posted below. Enjoy!
Regards,
Kaelon
www.Alleria.com
Kaelon
06-17-2003, 08:43 PM
Screenshot.
monstergamer
06-18-2003, 04:21 AM
it says on the pic above members= 4,070
but the active says 9,152
why?
wickedfate
06-18-2003, 05:07 AM
because its says that because of how many ACTIVE users at your forums that post on a regular basis ...
Oblivion Knight
06-18-2003, 06:41 AM
Nice idea.. :)
Installed and running perfectly.
-Sidekick-
06-18-2003, 11:50 AM
If members signed up on your forums, then later were pruned, then signed up again, it would throw your numbers off.
Mephisteus
06-18-2003, 01:51 PM
And why is that?
Velocd
06-18-2003, 03:02 PM
This hack could throw users off into thinking the "total ever registered" was actually "the total amount ever existent on the forum at the same time," which of course is false. So unless you label it more specifically, users could get confused (unless that is what you're trying to do). ;)
Kaelon
06-18-2003, 03:35 PM
The labeling is simply a matter of personal preference, and should reflect your patterns of pruning. For instance, since we prune all people who have 0 posts, then we could call it (with Non-Posters).
Kaelon
S.Shady
06-18-2003, 04:01 PM
-- edit kicked self in ass --
i see it now. good hack, will use when forums get bigger
---------------------------------
Today at 01:21 AM monstergamer said this in Post #3 (https://vborg.vbsupport.ru/showthread.php?postid=410169#post410169)
it says on the pic above members= 4,070
but the active says 9,152
why?
i wasl also confused but then i noticed if you put a comma right after (active) it will all make sence
Albasoul
06-18-2003, 05:30 PM
This hack is not a good idea to install on your boards, especially busy ones, because any sql query that uses select count(*) degrades mysql performance by counting a large number of rows from the user table.
I like the idea, i just don't like to install this because I am sure it will kill performance.
Crinos
06-18-2003, 05:42 PM
I regularly prune my member database every month for inactive members who 1.) have never made a post + 2.) have not visited the site in 3 months ... so I probably won't need this hack ... good idea tho, congrats ;)
Kaelon
06-18-2003, 06:21 PM
This hack is not a good idea to install on your boards, especially busy ones, because any sql query that uses select count(*) degrades mysql performance by counting a large number of rows from the user table.
Did you even look at the code? There are no added queries in this hack. Specifically, it uses a query already needed by forumhome (the one that generates the newuserid) and simply formats that number using an in-the-box routine.
Our forum has hundreds of simultaneous users, and we have experienced no increase in server load.
Kaelon
Hehe, I did this in my 4th hack I think, it's really amazing that no one did do it separately. In my hack I did the same for threads and posts (shows posts posted total and threads posted total) and I've done the same for vB3.
Nice work Kaelon, hopefully people will use it, because it should technically be standard vBulletin, to show members total, registered, but that's just my opinion.
Dean C
06-18-2003, 08:59 PM
I'm still a little confused as to what this does *confused*? :)
- miSt
S.Shady
06-18-2003, 10:36 PM
Today at 05:59 PM Mist said this in Post #15 (https://vborg.vbsupport.ru/showthread.php?postid=410504#post410504)
I'm still a little confused as to what this does *confused*? :)
- miSt
i wasl also confused but then i noticed if you put a comma right after (active) it will all make sence
ok if your forum has had a total of 1,287 members since you opend total.
and you prune 500 off because of inactivity
this hac will say
Current Active # of Members: 787
Total To date reg. members 1,287
Kaelon
06-19-2003, 04:19 AM
S.Shady is correct; it essentially takes the $newuserid variable and runs it through the format_number routine, and displays it. This gives users an idea of how many accounts have ever been created on a forum (since $newuserid is sequential).
This, of course, means different things for different forums. For my forum, it represents the number of total members registered, but not pruned due to inactivity (since we regularly prune thousands of inactive accounts).
Kaelon
Floris
06-21-2003, 04:30 PM
I don't want to spoil your fun, but ... why does this require source code hacking ?
The 'welcome to our latest member' .. his userid is the last one in the database, and therefor also the total amount you want to get right ? Just display that.
Total registrations, ever: $newuserid
Total active members: $numbermembers
csidlernet
06-21-2003, 09:04 PM
You have a point: xiphoid, but I guess you still could call this a hack as it does involve file editing.
Floris
06-21-2003, 11:03 PM
Then I will rephrase my point: It is an obsolete hack!
vBulletin's forumhome already lets you have this number, why stress the server to re-calculate it ?
Just modify the template and you are done. This way upgrading doesn't have to bother you. The variable is currently the same in vb3 too.
Kaelon
06-22-2003, 03:25 PM
Xiphoid:
Actually, you need to run the value through the number_format parcer, otherwise, it won't properly display large numbers (> 999).
Cheers,
Kaelon
Nitesh
06-23-2003, 04:24 PM
thank you xiphoid, works fine. Only problem is that it doesnt display the comma ',' but I can live without that lol
Floris
06-24-2003, 07:36 AM
Kaelon, it doesn't ?
I am nearing 1000 registrations, so we will find out :)
Kaelon
06-24-2003, 12:03 PM
Today at 04:36 AM xiphoid said this in Post #23 (https://vborg.vbsupport.ru/showthread.php?postid=412141#post412141)
Kaelon, it doesn't ?
I am nearing 1000 registrations, so we will find out :)
Hi, Xiphoid,
Nope - you need to run it through the number_format parser in order to have it properly add commas for text display of the userid value, otherwise, it'll simply show up as a numerical string completely different from your other value strings.
On a totally different note, I just wanted to let you know that I visited your forum and it looks like vB3 handles user visits differently; I was visiting it and it said that there were 0 members and 0 guests online; I had to refresh a couple of times before the system actually picked me up. I'm guessing deferred guestvisits, a la Jujubee's system?
Kaelon
Flogger
06-29-2003, 04:44 PM
great hack
snakes1100
06-29-2003, 06:38 PM
Well, for our board it is a nice hack, a big thank you also.
Server load didn't rise either that i can see.
Kaelon
06-30-2003, 02:39 PM
Glad that it works well for you! Since there are no added queries, you'll find that there's no shift in performance. :)
Kaelon
Ludelover
07-19-2003, 09:33 PM
How would you do the total posts & total threads for the message board? If you were to update the counters would that make this not work?
Kaelon
07-28-2003, 10:45 PM
How would you do the total posts & total threads for the message board? If you were to update the counters would that make this not work?
Total Posts & Total Threads for the message board are already included, but admittedly, you point out a good situation - it only shows the current total posts and current total threads that still exist on the forum (active). Regrettably, you'd have to add two more queries to forumhome to get the latestthreadid and latestpostid - and that makes for a not-so-great hack.
That being said, others have done this before ("Thread Statistics Hacks on Forumhome"), but I advise against using those hacks because only Total Users has already been queried in the stock vBulletin install (when it shows you the newest member); you'd have to do two more unique queries for latest thread and latest post. Not advisable.
Glad that everyone enjoys this relatively easy/simple hack.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.