The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Number of new members statistic on forum home Details »» | |||||||||||||||||||||||||||
Number of new members statistic on forum home
Developer Last Online: Oct 2023
I wanted to show potential advertisers as well as potential forum members how many people are registering to use our forums every day.
So I wrote this hack to display a 30 day average in the stats box of the forum home. It counts the number of people in user group 2 - registered members, ignoring those people who haven't activated their accounts, yet. It's very easy, takes just a few minutes and requires 1 additional query. You can see it working at www.avforums.com. Please click Install if you use it. Thanks to Bryan Ex for doing a bit of bug fixing help Show Your Support
|
Comments |
#22
|
||||
|
||||
Good idea... I never thought to try that. Running just the query returned a count of 85.77. Just wondering if anyone else has actually installed this and has it working? Not sure how I could screw up two lines of code but if it works for someone else then I at least know it's specific to me and not the code itself.
|
#23
|
||||
|
||||
That's an impressive registration rate. If the query is working ok then all you've got to do is get that returned value into the right variable available on the home page.
Can you 'read' php? Have a look at the code to see if it looks right. The code I used in the installation notes came copied from my installation which works perfectly. |
#24
|
||||
|
||||
The part I don't understand is that in functions_databuild it refers to $avgregs = yet that variable is not referenced anywhere else - like in index.php for example. Is that correct? If I follow the data process for my site $avgregs would equal 85.77 but what calls that data to index.php? It's as if there's a part missing or something.
|
#25
|
||||
|
||||
I think I know what's missing. I believe there should also be an edit to the array in functions_databuild.php...
// make a little array with the data $values = array( 'numbermembers' => $members['users'], 'newusername' => $newuser['username'], 'newuserid' => $newuser['userid'] ); |
#26
|
||||
|
||||
This is what I thought it should be but it still isn't right. Could you check your functions_databuild file for this array?
PHP Code:
|
#27
|
||||
|
||||
Many apologies - yes you are right.
I omitted that part and have updated the text instructions. Anyone installing so far will need to amend that bit. Thanks for your help. |
#28
|
||||
|
||||
Just to confirm... it's now working fine for me. Thanks Spinball.
|
#29
|
||||
|
||||
This is strange indeed. I do have a member count showing now but it is incorrect and any changes I make to the query doesn't seem to affect it. For example I changed the user group ID but the same count as before shows or I changed (userid)/30 to /60 which should drop the number by half, again no change. I then thought maybe it's cached somewhere so cleared my temp files and manually ran all board maintenance tasks with no luck. I believe it's really close... but something still isn't quite right unless I'm missing something obvious. Any ideas or suggestions Spinball?
(Can you tell I really want to get this working? LOL) |
#30
|
||||
|
||||
It's COUNT(userid)/30 as regcount. What should it be and what is it via the hack?
If you change the 30 to 60 you need to do it in 3 places. The 2 in the SQL statement and the 1 in the phrase. |
#31
|
||||
|
||||
Yep, understand that part. What I was getting at was that the stats were not being dynamically updated but I think I now know why. Any changes I make to the query do not take affect until the next person joins. In other words, something has to happen before the number updates (a simple page refresh makes no difference). I think I'm sorted out now so just ignore my ramblings...lol.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|