示例#1
0
// external include files
if (isset($g_aConfig["includes"]) == true && strlen($g_aConfig["includes"]) > 0) {
    $aIncludes = explode(",", $g_aConfig["includes"]);
    foreach ($aIncludes as $sInclude) {
        include $sInclude;
    }
}
// select configuraton
$g_sConfig = GetConfig();
$g_aConfig = $aConfig[$g_sConfig];
if (isset($_GET["part"])) {
    $g_sConfig = $g_sConfig . "." . $_GET["part"];
}
// get date range and valid log file
$g_dtStatsMonth = ValidateDate(isset($_GET["year"]) ? $_GET["year"] : null, isset($_GET["month"]) ? $_GET["month"] : null);
$g_aLogFiles = GetLogList($g_sConfig, $g_aConfig["statspath"], $g_aConfig["statsname"]);
// create xml
$aXML = array();
$aXML[] = "<data>";
$iYear = date("Y", $g_aLogFiles[count($g_aLogFiles) - 1][0]);
$iMonth = date("n", $g_aLogFiles[count($g_aLogFiles) - 1][0]);
$iMaxLastUpdate = 0;
for ($iIndex = count($g_aLogFiles) - 1; $iIndex >= 0; $iIndex--) {
    $dtNextMonth = mktime(0, 0, 0, $iMonth + 1, 0, $iYear);
    $clsAWStats = new clsAWStats($g_sConfig, $g_aConfig["statspath"], isset($g_aConfig["statsname"]) ? $g_aConfig["statsname"] : null, date("Y", $g_aLogFiles[$iIndex][0]), date("n", $g_aLogFiles[$iIndex][0]));
    if ($clsAWStats->dtLastUpdate > $iMaxLastUpdate) {
        $iMaxLastUpdate = $clsAWStats->dtLastUpdate;
    }
    // sum pages, hits & bandwidth
    $aTemp = $clsAWStats->GetSection("DAY");
    $iPages = 0;
示例#2
0
文件: index.php 项目: renzg/JAWStats
$g_aConfig = $aConfig[$g_sConfig];
$sLanguageCode = SetTranslation();
// external include files
if (isset($g_aConfig["includes"]) == true && strlen($g_aConfig["includes"]) > 0) {
    $aIncludes = explode(",", $g_aConfig["includes"]);
    foreach ($aIncludes as $sInclude) {
        include $sInclude;
    }
}
// get date range and valid log file
$year = array_key_exists("year", $_GET) ? $_GET["year"] : NULL;
$month = array_key_exists("month", $_GET) ? $_GET["month"] : NULL;
$statsname = array_key_exists("statsname", $g_aConfig) ? $g_aConfig["statsname"] : NULL;
$parts = array_key_exists("parts", $g_aConfig) ? $g_aConfig["parts"] : NULL;
$g_dtStatsMonth = ValidateDate($year, $month);
$g_aLogFiles = GetLogList($g_sConfig, $g_aConfig["statspath"], $statsname, $parts);
$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");
    }
}
$clsPage = new clsPage($GLOBALS["g_aConfig"]["type"]);