Days of month Table show incorrect data when open old log.

If you found an error, please report it here.

Days of month Table show incorrect data when open old log.

Postby kloster » 09 May 2010 01:55

I install BetterAWstats 1.0 on my stats server and process all of my logfiles (new and old).
I saw some incorrect data when i open the old statistic.
I think it will display incorrect data when i open log is similar to the current month to month.
In my picture was captured when i opened stats on May 2009. It should be show stats from 1 May 2009 to 31 May 2009.
The date that i captured in picture is 9 May 2010.
How should I correct this bug?
Attachments
baws-bug1.jpg
Days of month table wrong display
baws-bug1.jpg (172.05 KiB) Viewed 115 times
kloster
 
Posts: 2
Joined: 09 May 2010 01:34

Re: Days of month Table show incorrect data when open old log.

Postby Oliver » 09 May 2010 13:33

Hi,

Thanks for the report.

Please try the following:

in index.php, search for this text:

Code: Select all
if (isset($_GET['month'])) {
    $BAW_CURR['month'] = $_GET['month'];
} else {
    $BAW_CURR['month'] = date('m');
}


right after it, please insert

Code: Select all
$BAW_CURR['dateset'] = false;
if ($BAW_CURR['year'] != date('Y') or $BAW_CURR['month'] != date('m')) {
    $BAW_CURR['dateset'] = true;
}


then in core/display.inc.php search for this text:

Code: Select all
    if ($BAW_CURR['month'] == $current_month) { // if we have the current month, get some data from the last month
        $daydiff = abs($current_day - $daysofmonth); // calculate how many days are missing
    }


and then change it to this here:

Code: Select all
    if ($BAW_CURR['month'] == $current_month && !$BAW_CURR['dateset']) { // if we have the current month, get some data from the last month
        $daydiff = abs($current_day - $daysofmonth); // calculate how many days are missing
    }


hope this fixes it!
Oliver
BetterAWStats Creator/Admin
User avatar
Oliver
Site Admin
 
Posts: 147
Joined: 10 Mar 2008 19:09

Re: Days of month Table show incorrect data when open old log.

Postby kloster » 10 May 2010 03:51

Thank you so much for your prompt response.
Now, it's work. :mrgreen:

Wait for your next version.
Kloster.
kloster
 
Posts: 2
Joined: 09 May 2010 01:34


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest