vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Members who have registered today (https://vborg.vbsupport.ru/showthread.php?t=72972)

Thug 02-09-2005 12:52 PM

this is the code i used
is it right

// ### Registered Today ##
$newusers = $DB_site->query_first('
SELECT COUNT(*) AS count
FROM ' . TABLE_PREFIX . 'user
WHERE joindate >= "' . strtotime("-1day") . '"
');
$newmembers = number_format($newusers['count']);
// ### Registered Today ##

ericgtr 02-09-2005 01:05 PM

That's right, looks exactly like what I posted. If you use that and the other instructions I mentioned it should work. What exactly isn't working for you?

yoyoyoyo 02-09-2005 01:45 PM

is there anyway to make the phrase in the forum home stats only show up if there are registrations? If there is a day with no registrations it would be nice to not have it say anything instead of "Registered today: 0" :D

ericgtr 02-09-2005 02:26 PM

Quote:

Originally Posted by yoyoyoyo
is there anyway to make the phrase in the forum home stats only show up if there are registrations? If there is a day with no registrations it would be nice to not have it say anything instead of "Registered today: 0" :D

From what I can gather at first glance, I would have to completely rework the code for that and would take more time to learn how than I have right now. :)

Thug 02-10-2005 12:33 PM

so my code is ok? it doesnt reset at 0:00am

eva01_ 02-10-2005 12:36 PM

i believe it resets 24hrs after you installed it and that is the zero hour. at least thats my thought, or it is based off the creators timezone

David Bott 02-16-2005 11:03 AM

Not sure...but using Pauls M. revision produces...

Fatal error: Call to undefined function: vbmktime() in /home/avsforum/www.tivocommunity.com/tivo-vb/index.php on line 436

For me.

Paul M 02-16-2005 11:13 AM

Oh yeah - I hadn't noticed the require line is missing (for the file that includes the vbmktime() function);

add ;

PHP Code:

require_once('./includes/functions_misc.php'); 

above ;

PHP Code:

$cutoff vbmktime(000vbdate('m'$nowfalsefalse), vbdate('d'$now

Original post updated.

David Bott 02-16-2005 11:48 AM

LOL...Hi Paul! Boy, two helps from you in a day! Thank you for the support!

BTW...You also mention something about replacing "$whousers" in one line. So you know, or maybe you do, it is used in TWO places.

Can we please get a complete update to your fine code on in one post?

Paul M 02-16-2005 02:16 PM

Quote:

Originally Posted by David Bott
LOL...Hi Paul! Boy, two helps from you in a day! Thank you for the support!


BTW...You also mention something about replacing "$whousers" in one line. So you know, or maybe you do, it is used in TWO places.

Can we please get a complete update to your fine code on in one post?

I've checked the code in Post 18 and all the little bug fixes should now be in it - If you are using this version I suggest you replace your existing code with what's now in this post. :)

David Bott 02-16-2005 02:20 PM

Thank you once again Paul. Very kind of you.

David Bott 02-17-2005 02:31 PM

Hi Paul:

Well I have tried both $newmembers and $newusers and both give me wrong results. $newusers at this time shows me 8 and in the ADMIN Stats it say 35. If I use $newmembers it shows me a number in the thousands.

Strange.

Paul M 02-17-2005 04:14 PM

The user that shows 8 - what timezone are they in ? (the hack takes into account your TZ settings, afaik, the ACP does not).

$newmembers is not used (as per the original hack) - I don't know why, maybe becasue the number format function screws it up ?

David Bott 02-17-2005 04:24 PM

My personal TimeZone is GMT -5 for New York. Showed 8 new members but after a new name showed up as registering, it still showed 8 which is what made me start to wonder. (I had them reversied before with the counts I mentioned)

If I use $newusers and it shows...83479

If I use $newmembers it shows...8

It is weird for the numbers have not changed from this morning.

I am using your code in post 18.

Code:

// Who Regeistered Today - using Paul Marsden's code
require_once('./includes/functions_misc.php');
$cutoff = vbmktime(0, 0, 0, vbdate('m', $now, false, false), vbdate('d', $now, false, false), vbdate('Y', $now, false, false));
// $cutoff = $now - 86400 ;  // Uncomment this line if you want a rolling last 24 hours.
$newusers = $DB_site->query_first('
SELECT COUNT(*) AS count
FROM ' . TABLE_PREFIX . 'user
WHERE joindate >= ' .$cutoff. '
');
$newmembers = number_format($newusers['count']);
// Who Regeistered Today - using Paul Marsden's code


Paul M 02-17-2005 04:48 PM

Okay - as I said originally - it might work - I have never tested it - I'll try it out in a bit and see whats going on. :)

Edit: Actually, scrap that - I can see what's wrong with it - another line is missing - this is what happens when code is copied from one place to another.

The missing line is
Code:

$now = TIMENOW ;
I have added it to post 18.

David Bott 02-17-2005 04:53 PM

Ok, as I have said before....thanks Paul. ;)

This is how it was done in a VB2 hack...

Code:

$numbersregmembers=$DB_site->query_first("SELECT COUNT(*) AS todayreg FROM user WHERE joindate > " . mktime(0,0,0,date("m"),date("d"),date("Y")) ."");
$numberregmembers=number_format($numbersregmembers['todayreg']);


Paul M 02-17-2005 04:56 PM

Damn - you posted before I finished > see edit above. :)

David Bott 02-17-2005 05:38 PM

Well...Hummm....

Registered Today: 8

Still the same as before. Bummmer and I thought that was it!

Paul M 02-17-2005 06:53 PM

That was it - it works fine here - I have tested it on my system.

David Bott 02-17-2005 08:28 PM

Well it has went up to 9 now. Not sure what it is actually doing the math on. Are we sure it is not per hour? We do over a hundred a day.

David Bott 02-18-2005 09:05 PM

Well Paul, I have tried and tried but I can not get this code to work. I just get numbers that look like they reset reach hour or something. (I can not place any logic on what I am seeing.) More or less we get over 100 new members a day and it shows me single digits. I just went to the site today for the first time from 7:00AM and it showed me 1 when in hte AM it was 7. Just weird.

Code:

// Who Regeistered Today - using Paul Marsden's code
$now = TIMENOW ;
require_once('./includes/functions_misc.php');
$cutoff = vbmktime(0, 0, 0, vbdate('m', $now, false, false), vbdate('d', $now, false, false), vbdate('Y', $now, false, false));
// $cutoff = $now - 86400 ;  // Uncomment this line if you want a rolling last 24 hours.
$newusers = $DB_site->query_first('
SELECT COUNT(*) AS count
FROM ' . TABLE_PREFIX . 'user
WHERE joindate >= ' .$cutoff. '
');
$newmembers = number_format($newusers['count']);
// Who Regeistered Today - using Paul Marsden's code

Thank you for trying...But I am lost with it.

Paul M 02-18-2005 09:18 PM

Quote:

Originally Posted by David Bott
Thank you for trying...But I am lost with it.

I cannot really do anymore without access to the site, I could then load up a test page and see what's going on.

David Bott 02-19-2005 01:22 PM

Hi Paul....Yes, Iam as lost as you are on this one. It just seems it should work, but yet the strange numbers. I am actually surprised this is not in VB already actually as a stat on the main page.

lefthome 03-09-2005 11:03 AM

I would like to install this hack. Currently I am using vb 3.06 and will upgrade to vb3.07 this weekend. Does this hack work in vb3.07?

ecfcgraham 03-24-2005 10:03 AM

Installed sucessfully, nice mod. :)

ericgtr 03-24-2005 04:32 PM

Quote:

Originally Posted by lefthome
I would like to install this hack. Currently I am using vb 3.06 and will upgrade to vb3.07 this weekend. Does this hack work in vb3.07?

I don't see why it wouldn't but haven't tested it yet. It's pretty easy to yank if it doesn't though :)

KanyeWest 03-24-2005 05:43 PM

Quote:

Originally Posted by lefthome
I would like to install this hack. Currently I am using vb 3.06 and will upgrade to vb3.07 this weekend. Does this hack work in vb3.07?

Yes it works in 3.0.7 why wouldnt it?

ramprage 04-06-2005 05:32 PM

It wasn't workign for me, I didn't notice you need to ADD A PHRASE.
Secondly the split SQL code between lines wasn't working, I had to change it to this:

PHP Code:

// ### Registered Today ## 
$newusers $DB_site->query_first(' SELECT COUNT(*) AS count FROM ' TABLE_PREFIX 'user WHERE joindate >= "' strtotime("-1day") . '" '); 
$newmembers number_format($newusers['count']); 
// ### Registered Today ## 

Now its working fine on 3.07 :D

Mokster 04-07-2005 12:13 AM

can you make it so that it lists the new users in the last 24 hours?

RaceJunkie 09-24-2005 04:50 AM

I have it installed and it seems to be working. The only thing is that the number does not have Registered Today to the left of it Any idea what i did wrong?

Code in the Forum Home:
Code:

<div>$vbphrase[reged_today]: $newusers[count], $vbphrase[threads]: $totalthreads, $vbphrase[posts]: $totalposts, $vbphrase[members]: $numbermembers</div>

www.localracechat.com

Q-v-n-s-Q 09-25-2005 05:02 AM

Quote:

Originally Posted by RaceJunkie
I have it installed and it seems to be working. The only thing is that the number does not have Registered Today to the left of it Any idea what i did wrong?

Code in the Forum Home:
Code:

<div>$vbphrase[reged_today]: $newusers[count], $vbphrase[threads]: $totalthreads, $vbphrase[posts]: $totalposts, $vbphrase[members]: $numbermembers</div>

www.localracechat.com

well you can add new phrase or change the below code

Code:

<div>$vbphrase[reged_today]:
change it to
PHP Code:

<div>Today's Register : 

wait a minutes this is weird, the number support to going up isnt?, but mine is going down,,,,,,,,,

RaceJunkie 09-26-2005 03:01 AM

Code:

<div>Today's Register :
Worked Great Thank You :nervous:

DJRavine 04-02-2008 02:47 PM

hey all... at first this wasn't working for me on vb v3.6.8...
so i had to look up alot of the code changes...
and this is what i got for the index.php code...
i hope it helps other ppl out...

and kudos to ericgtr for the mod.. ;)
** marks as installed **

PHP Code:

// ### Registered Today ##
$newmembers $db->query_first('
SELECT COUNT(*) AS count FROM ' 
TABLE_PREFIX 
'user WHERE joindate >= "' strtotime("-1day") . '"');
$newusers vb_number_format($newmembers['count']);
// ### Registered Today ## 



All times are GMT. The time now is 12:51 AM.

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.01460 seconds
  • Memory Usage 1,826KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (5)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (33)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete