![]() |
Total Members (Registrations) Hack
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 |
Screenshot.
|
it says on the pic above members= 4,070
but the active says 9,152 why? |
because its says that because of how many ACTIVE users at your forums that post on a regular basis ...
|
Nice idea.. :)
Installed and running perfectly. |
If members signed up on your forums, then later were pruned, then signed up again, it would throw your numbers off.
|
And why is that?
|
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). ;)
|
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 |
-- edit kicked self in ass --
i see it now. good hack, will use when forums get bigger --------------------------------- Quote:
i wasl also confused but then i noticed if you put a comma right after (active) it will all make sence |
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. |
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 ;)
|
Quote:
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. |
I'm still a little confused as to what this does *confused*? :)
- miSt |
Quote:
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 |
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 |
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 |
You have a point: xiphoid, but I guess you still could call this a hack as it does involve file editing.
|
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. |
Xiphoid:
Actually, you need to run the value through the number_format parcer, otherwise, it won't properly display large numbers (> 999). Cheers, Kaelon |
thank you xiphoid, works fine. Only problem is that it doesnt display the comma ',' but I can live without that lol
|
Kaelon, it doesn't ?
I am nearing 1000 registrations, so we will find out :) |
Quote:
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 |
great hack
|
Well, for our board it is a nice hack, a big thank you also.
Server load didn't rise either that i can see. |
Glad that it works well for you! Since there are no added queries, you'll find that there's no shift in performance. :)
Kaelon |
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?
|
very good 10/10
|
Quote:
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. |
All times are GMT. The time now is 07:22 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|