$navlinks = COM_printPageNavigation($base_url, $curpage, $num_pages); for ($i = 0; $i < $rnum; $i++) { $A = DB_fetchArray($rec); if ($i >= ($curpage - 1) * $_GUS_months and $i < $curpage * $_GUS_months) { $GUS_MONTHS[] = $A; } } // First check for cached version if ($curpage != $num_pages and file_exists(GUS_cachefile())) { $display = GUS_getcache(); } else { // no cached version found do it. if (SEC_inGroup('Root') or SEC_hasRights('gus.view')) { $T = GUS_template_start('index.thtml'); } else { $T = GUS_template_start('index-a.thtml'); } $T->set_block('page', 'MONTH', 'ABlock'); $T->set_var(array('stats_name' => 'gus', 'site_url' => $_CONF['site_url'], 'month_title' => $LANG_GUS00['month_title'], 'anon_title' => $LANG_GUS00['anon_title'], 'reg_title' => $LANG_GUS00['reg_title'], 'page_title' => $LANG_GUS00['page_title'], 'story_title' => $LANG_GUS00['new_stories'], 'comm_title' => $LANG_GUS00['new_comments'], 'link_title' => $LANG_GUS00['link_title'], 'hour_title' => $LANG_GUS00['hour_title'], 'referer_title' => $LANG_GUS00['referer_title'], 'country_title' => $LANG_GUS00['country_title'], 'browser_title' => $LANG_GUS00['browser_title'], 'platform_title' => $LANG_GUS00['platform_title'])); $anon = 0; $reg = 0; $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) {
exit; } require_once './include/sql.inc'; require_once './include/util.inc'; /* * Main Function */ // Check for cached file if (file_exists(GUS_cachefile()) and date('Yn') !== $year . $month) { $display = GUS_getcache(); } else { // no cached version found - generate page if (SEC_inGroup('Root') or SEC_hasRights('gus.view')) { $T = GUS_template_start('daily.thtml'); } else { $T = GUS_template_start('daily-a.thtml'); } $T->set_var('additional_nav', GUS_make_nav($day, $month, $year)); $T->set_block('page', 'ROW', 'ABlock'); $T->set_var(array('stats_name' => 'gus', 'site_url' => $_CONF['site_url'], 'period_title' => $LANG_GUS00['day_title'], 'anon_title' => $LANG_GUS00['anon_title'], 'reg_title' => $LANG_GUS00['reg_title'], 'page_title' => $LANG_GUS00['page_title'], 'story_title' => $LANG_GUS00['new_stories'], 'comm_title' => $LANG_GUS00['new_comments'], 'link_title' => $LANG_GUS00['link_title'])); $anon = 0; $reg = 0; $pages = 0; $stories = 0; $comments = 0; $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($totalrows / $_GUS_limit); if (!isset($_GET['page']) or empty($_GET['page'])) { $curpage = 1; } else { $curpage = (int) $_GET['page']; } $header_url = GUS_create_url('sort') . $sort_sep; $base_url = GUS_create_url('page'); $navlinks = COM_printPageNavigation($base_url, $curpage, $num_pages); // limit to the sql $offset = ($curpage - 1) * $_GUS_limit; $sql .= " LIMIT " . $offset . ', ' . $_GUS_limit; $rec = DB_query($sql); $nrows = DB_numRows($rec); // template calls $T = GUS_template_start(); $T->set_var('additional_nav', GUS_make_nav($day, $month, $year)); $T->set_block('page', 'COLUMN', 'CBlock'); $T->set_block('page', 'ROW', 'BBlock'); $T->set_block('page', 'TABLE', 'ABlock'); $nav_down = "<br><img src=\"{$_CONF['site_url']}/gus/images/nav_down.gif\" width=\"13\" height=\"11\" alt=\"{$LANG_GUS00['sortDESC']}\" border=\"0\">"; $nav_up = "<img src=\"{$_CONF['site_url']}/gus/images/nav_up.gif\" width=\"13\" height=\"11\" alt=\"{$LANG_GUS00['sortASC']}\" border=\"0\">"; $T->set_var(array('colclass' => 'col_right', 'data' => '<div align="center">' . $LANG_GUS00['page_views'] . ' <a href="' . $header_url . 'sort=viewsDESC">' . $nav_down . '</a><a href="' . $header_url . 'sort=viewsASC">' . $nav_up . '</a></div>')); $T->parse('CBlock', 'COLUMN', FALSE); $T->set_var(array('colclass' => 'col_left', 'data' => '<div align="center">' . $LANG_GUS00['user'] . ' <a href="' . $header_url . 'sort=usernameDESC">' . $nav_down . '</a><a href="' . $header_url . 'sort=usernameASC">' . $nav_up . '</a></div>')); $T->parse('CBlock', 'COLUMN', TRUE); $T->set_var('data', '<div align="center">' . $LANG_GUS00['host'] . ' <a href="' . $header_url . 'sort=hostDESC">' . $nav_down . '</a><a href="' . $header_url . 'sort=hostASC">' . $nav_up . '</a></div>'); $T->parse('CBlock', 'COLUMN', TRUE); $T->set_var('data', '<div align="center">' . ($day == 0 ? $LANG_GUS00['datetime'] : $LANG_GUS00['time']) . ' <a href="' . $header_url . 'sort=dateDESC">' . $nav_down . '</a><a href="' . $header_url . 'sort=dateASC">' . $nav_up . '</a></div>'); $T->parse('CBlock', 'COLUMN', TRUE); $T->set_var('data', '<div align="center">' . $LANG_GUS00['referer'] . ' <a href="' . $header_url . 'sort=refererDESC">' . $nav_down . '</a><a href="' . $header_url . 'sort=refererASC">' . $nav_up . '</a></div>');