$linksf = 0; $days = Date('t', mktime(0, 0, 0, $month, 1, $year)); // special case for this month - don't show days in the future $today = getdate(); if ($today['year'] == $year and $today['mon'] == $month) { $days = min($days, $today['mday']); } $num_pages = ceil($days / $_GUS_days); if (!isset($_GET['page']) or empty($_GET['page'])) { $curpage = 1; } else { $curpage = (int) $_GET['page']; } $base_url = GUS_create_url('page'); $navlinks = COM_printPageNavigation($base_url, $curpage, $num_pages); $temp_table = GUS_create_temp_userstats_table($year, $month); for ($day = 1; $day <= $days; $day++) { if ($day > ($curpage - 1) * $_GUS_days and $day <= $curpage * $_GUS_days) { $day_of_week = date('l', mktime(0, 0, 0, $month, $day, $year)); $date_formatted = date('l d', mktime(0, 0, 0, $month, $day, $year)); $T->set_var('day_display', $date_formatted); $T->set_var(array('day' => $day, 'mon' => $month, 'year' => $year)); if ($day % 2) { $T->set_var('rowclass', 'row1'); } else { $T->set_var('rowclass', 'row2'); } $result = DB_query("SELECT COUNT( DISTINCT ip ) AS num_anon FROM {$temp_table['name']} WHERE uid = '1' AND DAYOFMONTH( date ) = {$day}"); $row = DB_fetchArray($result, FALSE); $anon += $row['num_anon']; $T->set_var('anon', $row['num_anon']);
$pages = 0; $stories = 0; $comments = 0; $linksf = 0; $referers = 0; $countries = 0; $rowNum = 1; foreach ($GUS_MONTHS as $res) { $T->set_var(array('display_month' => $res['display_month'], 'year' => $res['year'], 'month' => $res['month'])); if ($rowNum % 2) { $T->set_var('rowclass', 'row1'); } else { $T->set_var('rowclass', 'row2'); } $rowNum++; $temp_table = GUS_create_temp_userstats_table($res['year'], $res['month']); $result = DB_query("SELECT COUNT( DISTINCT ip ) AS num_anon FROM {$temp_table['name']} WHERE uid='1'"); $row = DB_fetchArray($result, FALSE); $anon += $row['num_anon']; $T->set_var('anon', $row['num_anon']); $result = DB_query("SELECT COUNT( DISTINCT uid ) AS num_registered FROM {$temp_table['name']} WHERE uid>'1'"); $row = DB_fetchArray($result, FALSE); $reg += $row['num_registered']; $T->set_var('reg', $row['num_registered']); $result = DB_query("SELECT COUNT(*) AS num_pages FROM {$temp_table['name']}"); $row = DB_fetchArray($result, FALSE); $pages += $row['num_pages']; $T->set_var('pages', $row['num_pages']); $date_compare = GUS_get_date_comparison('date', $res['year'], $res['month']); $result = DB_query("SELECT COUNT(*) AS num_stories FROM {$_TABLES['stories']} WHERE {$date_compare}"); $row = DB_fetchArray($result, FALSE);