Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Number of new members statistic on forum home Details »»
Number of new members statistic on forum home
Version: 1.00, by Spinball Spinball is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 09-12-2004 Last Update: Never Installs: 12
 
No support by the author.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 09-15-2004, 06:00 AM
Bryan Ex's Avatar
Bryan Ex Bryan Ex is offline
 
Join Date: Feb 2004
Location: Canada
Posts: 233
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #23  
Old 09-15-2004, 06:25 AM
Spinball's Avatar
Spinball Spinball is offline
 
Join Date: Feb 2002
Location: Telford, England
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #24  
Old 09-15-2004, 06:43 AM
Bryan Ex's Avatar
Bryan Ex Bryan Ex is offline
 
Join Date: Feb 2004
Location: Canada
Posts: 233
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #25  
Old 09-15-2004, 07:13 AM
Bryan Ex's Avatar
Bryan Ex Bryan Ex is offline
 
Join Date: Feb 2004
Location: Canada
Posts: 233
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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']
);
Reply With Quote
  #26  
Old 09-15-2004, 07:51 AM
Bryan Ex's Avatar
Bryan Ex Bryan Ex is offline
 
Join Date: Feb 2004
Location: Canada
Posts: 233
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
    // make a little array with the data
    
$values = array(
        
'numbermembers' => $members['users'],
        
'newusername' => $newuser['username'],
        
'newuserid' => $newuser['userid'],
        
'averageregistrations' => $avgregs['regcount']
    ); 
Reply With Quote
  #27  
Old 09-15-2004, 12:48 PM
Spinball's Avatar
Spinball Spinball is offline
 
Join Date: Feb 2002
Location: Telford, England
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #28  
Old 09-15-2004, 01:13 PM
Bryan Ex's Avatar
Bryan Ex Bryan Ex is offline
 
Join Date: Feb 2004
Location: Canada
Posts: 233
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just to confirm... it's now working fine for me. Thanks Spinball.
Reply With Quote
  #29  
Old 09-15-2004, 02:48 PM
Bryan Ex's Avatar
Bryan Ex Bryan Ex is offline
 
Join Date: Feb 2004
Location: Canada
Posts: 233
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
Reply With Quote
  #30  
Old 09-15-2004, 02:58 PM
Spinball's Avatar
Spinball Spinball is offline
 
Join Date: Feb 2002
Location: Telford, England
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #31  
Old 09-15-2004, 04:09 PM
Bryan Ex's Avatar
Bryan Ex Bryan Ex is offline
 
Join Date: Feb 2004
Location: Canada
Posts: 233
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:24 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.11955 seconds
  • Memory Usage 2,306KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete