Bugfix: Error displaying data (new year and new quarter)

0 views
Skip to first unread message

sawall

unread,
Jan 9, 2007, 2:00:28 PM1/9/07
to simpleness
Slight learning curve on php and using the date() command. I used the
following to determine if it was the first quarter and to set the
previous quarter variable if there is no data for the current quarter.

#set the current quarter based on month
if(date("n") == 1 || date("n") == 2 || date("n") == 3) {$qrtr = "1Q";
$prevqrtr = "4Q".date("y")-1;}

It has become apparent that I can not just add the "-1" to the date
command. So I had to modify the constants.php file to account for
this. The following is a direct replacement for the line in question
(line 30).

#set the current quarter based on month
if(date("n") == 1 || date("n") == 2 || date("n") == 3)
{
$qrtr = "1Q";
$oldyear = date("y")-"1";
if($oldyear < 10) {$prevqrtr = "4Q0".$oldyear;}
else {$prevqrtr = "4Q".$oldyear;}
}

If you'd like to simply replace your current constants.php file, you
can download the corrected file here:
http://tech.stlsawall.com/docs/nessus/constants_1.2_fix2.tar.gz

Simply overwrite the existing file. There are no user modifiable
parameters in this file. Please let me know if you have any questions
at all.

Thanks,
Chris

Reply all
Reply to author
Forward
0 new messages