Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
brentnhunter
Client



Joined: Sep 10, 2004
Posts: 166

PostPosted: Wed Dec 01, 2004 10:40 am Reply with quote

Hi Raven,

I just noticed that the # of new members registered yesterday on my site is showing like ten 10 times what it should be showing, but just for yesterday.... it seemed to be working just fine up until now. Do you know if there are any problems with that part of the code?

Thanks!

Brent [ Only registered users can see links on this board! Get registered or login! ]
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Dec 01, 2004 11:14 am Reply with quote

Laughing - So does mine. It must have something to do with the date routine. I'll look into it.
 
View user's profile Send private message
brentnhunter







PostPosted: Wed Dec 01, 2004 11:16 am Reply with quote

OK, thank you!
 
Raven







PostPosted: Wed Dec 01, 2004 11:50 am Reply with quote

BTW, this is original nuke code, not mine. It has always, and still does, have an error in the Yesterday routine. I had tried to patch it before and it apparently was working on all days except the first. I will attempt once again. Replace this section of code with this
Code:
$Today = getdate();

//Formatting Current Date
$month = $Today['month'];
$mday = $Today['mday'];
$year = $Today['year'];
//Formatting Previous Date
$pmonth = $Today['month'];
$pmday = $Today['mday'];
//$pmday = $mday-1;
$pyear = $Today['year'];
//Month conversion into numeric mode
if ($pmonth=="January") { $pmonth=1; } else
if ($pmonth=="February") { $pmonth=2; } else
if ($pmonth=="March") { $pmonth=3; } else
if ($pmonth=="April") { $pmonth=4; } else
if ($pmonth=="May") { $pmonth=5; } else
if ($pmonth=="June") { $pmonth=6; } else
if ($pmonth=="July") { $pmonth=7; } else
if ($pmonth=="August") { $pmonth=8; } else
if ($pmonth=="September") { $pmonth=9; } else
if ($pmonth=="October") { $pmonth=10; } else
if ($pmonth=="November") { $pmonth=11; } else
if ($pmonth=="December") { $pmonth=12; };
$test = mktime (0,0,0,$pmonth,$pmday,$pyear,1);

//Creating SQL parameter
$curDate2 = "%".$month[0].$month[1].$month[2]."%".$mday."%".$year."%";
$preday = strftime ("%d",$test);
$premonth = strftime ("%B",$test);
$preyear = strftime ("%Y",$test);
$curDateP = "%".$premonth[0].$premonth[1].$premonth[2]."%".$preday."%".$preyear."%";

//Executing SQL Today
$row = $db->sql_fetchrow($db->sql_query("SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDate2'"));
$userCount = $row['userCount'];
//end

//Executing SQL Yesterday
$row2 = $db->sql_fetchrow($db->sql_query("SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDateP'"));
$userCount2 = $row2['userCount'];
//end
 
brentnhunter







PostPosted: Wed Dec 01, 2004 11:58 am Reply with quote

Awesome, that seems to do the trick. Thanks Raven!

Brent
 
Raven







PostPosted: Wed Dec 01, 2004 11:59 am Reply with quote

If it is still okay tomorrow I will update the download.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©