Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Bug Fixes
Author Message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17086

PostPosted: Thu Jul 21, 2005 11:24 am Reply with quote

Well, I managed to introduce a bug in all my fiddling Laughing. the previous day's registration got screwed up again, so I have rewritten th whole routine. I have corrected the download, but you can do the following to correct your v2.0.0 code.

Correct version number to 2.0.1 from 2.0.0
In block-UserInfo.php
FIND
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=="'"._JAN."'") $pmonth=1;
elseif ($pmonth=="'"._FEB."'") $pmonth=2;
elseif ($pmonth=="'"._MAR."'") $pmonth=3;
elseif ($pmonth=="'"._APR."'") $pmonth=4;
elseif ($pmonth=="'"._MAY."'") $pmonth=5;
elseif ($pmonth=="'"._JUN."'") $pmonth=6;
elseif ($pmonth=="'"._JUL."'") $pmonth=7;
elseif ($pmonth=="'"._AUG."'") $pmonth=8;
elseif ($pmonth=="'"._SEP."'") $pmonth=9;
elseif ($pmonth=="'"._OCT."'") $pmonth=10;
elseif ($pmonth=="'"._NOV."'") $pmonth=11;
elseif ($pmonth=="'"._DEC."'") $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 For Today and Yesterday
$userCount  = 0;
$userCount2 = 0;
$sql = "SELECT user_regdate, COUNT(user_regdate) FROM ".$user_prefix."_users WHERE user_regdate LIKE '$curDate2' OR user_regdate LIKE '$curDateP' GROUP BY user_regdate LIMIT 0,2";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
   if ($row[0]==substr($month,0,3).' '.$mday.', '.$year) $userCount = $row[1];
   else $userCount2 = $row[1];
}

REPLACE WITH
Code:
//Executing SQL For Today and Yesterday

$userCount  = 0;
$userCount2 = 0;
$Today = date('M d, Y',time());
$Yesterday = date('M d, Y',time()-86400);
$sql = "SELECT user_regdate, COUNT(user_regdate) FROM ".$user_prefix."_users where user_regdate IN('$Today', '$Yesterday') GROUP BY user_regdate LIMIT 0,2";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
   if ($row[0]==$Today) $userCount = $row[1];
   else $userCount2 = $row[1];
}


In language/lang-english.php
FIND AND DELETE
Code:
define("_JAN","January");

define("_FEB","February");
define("_MAR","March");
define("_APR","April");
define("_MAY","May");
define("_JUN","June");
define("_JUL","July");
define("_AUG","August");
define("_SEP","September");
define("_OCT","October");
define("_NOV","November");
define("_DEC","December");
 
View user's profile Send private message
Raven
PostPosted: Sat Jul 23, 2005 11:44 pm Reply with quote

Bump one time Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Bug Fixes

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 ©