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
List of new members during last 24h Details »»
List of new members during last 24h
Version: 1.02, by Olsufr Olsufr is offline
Developer Last Online: Mar 2005 Show Printable Version Email this Page

Version: 3.0.6 Rating:
Released: 02-12-2005 Last Update: 03-21-2005 Installs: 14
 
No support by the author.

Simple hack to display new registered members during last 24 hours.

A very simple display of all members who have registered in the forum during last 24 hours.

It displays statistics and the list of new registered members (last 24h) on Forum Home
under the "Users online" display.

The list is now in chronological order (newest first, oldest last).

example:
" Welcome to our newest members: (18) name18, name17, name16, name15, name14, name13, name12, name11, name10, name9, name8, name7, name6, name5, name4, name3, name2, name1 "

There is no additional SQL query.

----------------------------------

Installation (there is in attached file)

Step 1

In includes/functions_databuild.php

Find:

PHP Code:
// ###################### Start saveuserstats #######################
// Save user count & newest user into template
function build_user_statistics()
{
    global 
$vboptions$DB_site;

    
// get total members
    
$members $DB_site->query_first("SELECT COUNT(*) AS users, MAX(userid) AS max FROM " TABLE_PREFIX "user");

    
// get newest member
    
$newuser $DB_site->query_first("SELECT userid, username FROM " TABLE_PREFIX "user WHERE userid = $members[max]");

    
// make a little array with the data
    
$values = array(
        
'numbermembers' => $members['users'],
        
'newusername' => $newuser['username'],
        
'newuserid' => $newuser['userid']
    );

    
// update the special template
    
build_datastore('userstats'serialize($values));


And replace by this code:

PHP Code:
// ###################### Start saveuserstats #######################
// Save user count & newest user into template
// Function is modified by Oleg Subel for STATISTICS AND LIST OF NEW REGISTERED MEMBERS 24h
function build_user_statistics()
{
    global 
$vboptions$DB_site;

    
// get total members
    
$members $DB_site->query_first("SELECT COUNT(*) AS users, MAX(userid) AS max FROM " TABLE_PREFIX "user");

    
// get last newest members 24h
    
$cattime24 TIMENOW 24 60 60;
    
$newusers $DB_site->query("SELECT joindate, userid, username FROM " TABLE_PREFIX "user WHERE joindate > $cattime24");
//    $newuser = $DB_site->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid = $members[max]");

    
$newusers24 = array();
    while (
$newuser $DB_site->fetch_array($newusers))
    {
        
$newusers24["{$newuser['joindate']}"] = array('id' => $newuser['userid'], 'name' => $newuser['username']);
    }
    
// reverse sort keys
    
krsort($newusers24);

    if (empty(
$newusers24[0]))
    {
        
$lastnewuser $DB_site->query_first("SELECT userid, username FROM " TABLE_PREFIX "user WHERE userid = $members[max]");
    }

    
// make a little array with the data
    
$values = array(
        
'numbermembers' => $members['users'],
        
'newusername' => ( (empty($newusers24[0])) ? $lastnewuser['username'] : $newusers24[0]['name'] ),
        
'newuserid' => ( (empty($newusers24[0])) ? $lastnewuser['userid'] : $newusers24[0]['id'] ),
        
'lastregusers24h' => $newusers24
    
);

    
// update the special template
    
build_datastore('userstats'serialize($values));


Step 2

In index.php

Find:

PHP Code:
// get total members and newest member from template
$userstats unserialize($datastore['userstats']);
$numbermembers vb_number_format($userstats['numbermembers']);
$newusername $userstats['newusername'];
$newuserid $userstats['newuserid']; 
And insert this code below:

PHP Code:
// ### STATISTICS AND LIST OF NEW REGISTERED MEMBERS 24h by Oleg Subel ####################

$lastregusers24 $userstats['lastregusers24h'];
$numbernewregusers24 0;
$newusers24 '';
$cattime24 TIMENOW 24 60 60;
if (
is_array($lastregusers24) && count($lastregusers24) > 0)
{
    foreach(
$lastregusers24 AS $regjoindate => $regnewuser)
    {
        if (
$regjoindate $cattime24)
        {
            
$numbernewregusers24++;
            eval(
'$newusers24 .= ", ' fetch_template('forumhome_regnewuser') . '";');
        }
    }
}
$newusers24 substr($newusers24 2); // get rid of initial comma

// ### End of STATISTICS AND LIST OF NEW REGISTERED MEMBERS 24h by Oleg Subel ############# 
Step 3

Add new phrase

Phrase Type: GLOBAL
Varname: welcome_to_our_newest_members
Text:
Code:
Welcome to our newest members

Step 4

Add new template (Title: forumhome_regnewuser):

Code:
<a href="member.php?$session[sessionurl]u=$regnewuser[id]">$regnewuser[name]</a>
Step 5

FORUMHOME template modification

Find:

Code:
			<div><phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div>
and replace with:

Code:
			<if condition="$numbernewregusers24"><div>$vbphrase[welcome_to_our_newest_members]: ($numbernewregusers24) $newusers24</div></if>

END

Now, if you want to have statistics more than for 24 hours (for example - 3 days)
you need:

1) to change line of this hack for includes/functions_databuild.php (see step 1 of installation):
PHP Code:
$cattime24 TIMENOW 24 60 60
to
PHP Code:
$cattime24 TIMENOW 324 60 60
and

2) to change line of this hack for index.php (see step 2 of installation):
PHP Code:
$cattime24 TIMENOW 24 60 60
to
PHP Code:
$cattime24 TIMENOW 324 60 60

Show Your Support

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

Comments
  #22  
Old 03-10-2005, 09:39 AM
TLCanna TLCanna is offline
 
Join Date: Feb 2003
Location: around here somewhere
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TLCanna
I added this hack and it's working fine, but now my latest new member isn't there (at the top). It says 'Welcome to our newest member, " but no name. How can I get that added back AND have this hack show at the bottom?

http://www.javajane.com/images/GAGscreen.gif

If the link doesn't work the first time clicking it, refresh and it should show up. It's just an image of the area I'm talking about.

Thanks
Hello... Hello... Echo }} Echo }}

Anyone? Anyone?

Can anyone answer my question above? Pretty please?

Reply With Quote
  #23  
Old 03-18-2005, 10:27 PM
TLCanna TLCanna is offline
 
Join Date: Feb 2003
Location: around here somewhere
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TLCanna
Hello... Hello... Echo }} Echo }}

Anyone? Anyone?

Can anyone answer my question above? Pretty please?

Nobody?

Aw well...
Reply With Quote
  #24  
Old 03-22-2005, 10:09 PM
Olsufr Olsufr is offline
 
Join Date: Feb 2003
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is new version of this hack 1.02.

Quote:
Originally Posted by TLCanna
I added this hack and it's working fine, but now my latest new member isn't there (at the top). It says 'Welcome to our newest member, " but no name. How can I get that added back AND have this hack show at the bottom?
TLCanna, this error is fixed now and
if you want to have statistics of latest new member and statistics by this hack at the same time
instead of step 5 you have to do next:

FORUMHOME template modification

Find:
Code:
			<div><phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div>
And insert this below:

Code:
			<if condition="$numbernewregusers24"><div>$vbphrase[welcome_to_our_newest_members]: ($numbernewregusers24) $newusers24</div></if>
Reply With Quote
  #25  
Old 03-29-2005, 04:28 PM
TLCanna TLCanna is offline
 
Join Date: Feb 2003
Location: around here somewhere
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Olsufr
<if condition="$numbernewregusers24"><div>$vbphrase[welcome_to_our_newest_members]: ($numbernewregusers24) $newusers24</div></if>

This didn't work.
Reply With Quote
  #26  
Old 08-20-2005, 11:35 PM
ma7room ma7room is offline
 
Join Date: Mar 2005
Location: Riyadh
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

me too. i can't see any change after install this hack. is it working with 3.07?
Reply With Quote
  #27  
Old 08-21-2005, 02:43 AM
Socomjunky.com Socomjunky.com is offline
 
Join Date: Aug 2004
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ma7room
me too. i can't see any change after install this hack. is it working with 3.07?

same happend to me
Reply With Quote
  #28  
Old 09-16-2005, 07:15 PM
xtreme-mobile xtreme-mobile is offline
 
Join Date: Jul 2004
Posts: 366
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ive installed this on my second board and all i get is loads of , , , , , ,, like that with no names in between

any ideas what ive done?

regards

dean
Reply With Quote
  #29  
Old 09-21-2005, 01:29 AM
Thug Thug is offline
 
Join Date: Feb 2004
Location: Sheffield : uk
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i installed it at http://www.oh-twadi.com/forum/index.php?styleid=63
and well it doesnt reset at 12 midnight uk time
can anyone help
Reply With Quote
  #30  
Old 09-21-2005, 03:04 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Thug
i installed it at http://www.oh-twadi.com/forum/index.php?styleid=63
and well it doesnt reset at 12 midnight uk time
can anyone help
Well since the hack says "List of new members during last 24h" its not likely to reset at midnight ....
Reply With Quote
  #31  
Old 09-21-2005, 10:27 AM
Thug Thug is offline
 
Join Date: Feb 2004
Location: Sheffield : uk
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

why not
from 12oclock to 12oclock is 24hours do ur maths mate
ok so looks like we are back at school rnt we
from 11:59pm on the 20th to 11:59pm on the 21st
how many hours is that mate 24

how many hours are in a day 24 mate,so why doesnt it reset after 24hours at midnight
from midnight to midnight it should count
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:42 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
  • Page Generation 0.04908 seconds
  • Memory Usage 2,364KB
  • 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
  • (6)bbcode_code
  • (8)bbcode_php
  • (6)bbcode_quote
  • (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