예제 #1
0
function ValidateConfig()
{
    // core values
    if (ValidateView($GLOBALS["sConfigDefaultView"]) != true) {
        Error("BadConfig", "sConfigDefaultView");
    }
    if (is_bool($GLOBALS["bConfigChangeSites"]) != true) {
        Error("BadConfig", "bConfigChangeSites");
    }
    if (is_bool($GLOBALS["bConfigUpdateSites"]) != true) {
        Error("BadConfig", "bConfigUpdateSites");
    }
}
예제 #2
0
파일: index.php 프로젝트: xsnxj/jqawstats
$g_iThisLog = -1;
for ($iIndex = 0; $iIndex < count($g_aLogFiles); $iIndex++) {
    if ($g_dtStatsMonth == $g_aLogFiles[$iIndex][0] && $g_aLogFiles[$iIndex][1] == true) {
        $g_iThisLog = $iIndex;
        break;
    }
}
if ($g_iThisLog < 0) {
    if (count($g_aLogFiles) > 0) {
        $g_iThisLog = 0;
    } else {
        Error("NoLogsFound");
    }
}
// validate current view
if (ValidateView($_GET["view"]) == true) {
    $sCurrentView = $_GET["view"];
} else {
    $sCurrentView = $sConfigDefaultView;
}
// create class
$clsAWStats = new clsAWStats($g_sConfig, $g_aConfig["statspath"], date("Y", $g_aLogFiles[$g_iThisLog][0]), date("n", $g_aLogFiles[$g_iThisLog][0]));
if ($clsAWStats->bLoaded != true) {
    Error("CannotOpenLog");
}
// days in month
if ($clsAWStats->iYear == date("Y") && $clsAWStats->iMonth == date("n")) {
    $iDaysInMonth = abs(date("s", $clsAWStats->dtLastUpdate));
    $iDaysInMonth += abs(date("i", $clsAWStats->dtLastUpdate)) * 60;
    $iDaysInMonth += abs(date("H", $clsAWStats->dtLastUpdate)) * 60 * 60;
    $iDaysInMonth = abs(date("j", $clsAWStats->dtLastUpdate) - 1) + $iDaysInMonth / (60 * 60 * 24);