// | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to the Free Software Foundation, | // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ require_once './include/security.inc'; if (!GUS_HasAccess()) { 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;
/* * Main Function */ // IF nothing is set THEN use today if ($day == 0 and $month == 0 and $year == 0) { $year = date('Y'); $month = date('n'); $day = date('j'); $sort_sep = '?'; } else { $sort_sep = '&'; } $sort = isset($_GET['sort']) ? $_GET['sort'] : ''; $anon = isset($_GET['anon']) ? $_GET['anon'] : ''; // check for cached file if (file_exists(GUS_cachefile()) and date('dMY') !== $day . $month . $year) { $display = GUS_getcache(); } else { // no cached version //main sql option $date_compare = GUS_get_date_comparison('date', $year, $month, $day); $date_format = $day == 0 ? 'CONCAT( DATE_FORMAT( date, \'%d %b - \' ), TIME_FORMAT( time, \'%H:%i\' ) )' : 'TIME_FORMAT( time, \'%H:%i\' )'; $order_by = GUS_get_order_by($sort); $sql = "SELECT COUNT(*) AS views, uid, username, ip, host, referer, date, time, \n\t\t\t{$date_format} AS date_formatted \n\t\t\tFROM {$_TABLES['gus_userstats']}\n\t\t\tWHERE {$date_compare} "; // anon or uid if ($anon == '1') { $sql .= " AND uid = '1'"; } else { if ($anon == '2') { $sql .= " AND uid > '1'"; }
if ($_GET['page'] === 'latest') { $curpage = $num_pages; } else { $curpage = (int) $_GET['page']; } } $base_url = GUS_create_url('page'); $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;
// | along with this program; if not, write to the Free Software Foundation, | // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ require_once './include/security.inc'; if (!GUS_HasAccess()) { exit; } require_once './include/sql.inc'; require_once './include/util.inc'; /* * Main Function */ // check for cached file $today = date('MY'); if (file_exists(GUS_cachefile()) and $today !== $month . $year) { $display = GUS_getcache(); } else { // no cached version $T = GUS_template_start(); $T->set_block('page', 'COLUMN', 'CBlock'); $T->set_block('page', 'ROW', 'BBlock'); $T->set_block('page', 'TABLE', 'ABlock'); $T->set_var(array('colclass' => 'col_left', 'data' => $LANG_GUS00['browser'])); $T->parse('CBlock', 'COLUMN', FALSE); $T->set_var('data', $LANG_GUS00['version']); $T->parse('CBlock', 'COLUMN', TRUE); $T->set_var(array('colclass' => 'col_right', 'data' => $LANG_GUS00['page_views'])); $T->parse('CBlock', 'COLUMN', TRUE); $T->set_var(array('colclass' => 'col_right', 'data' => '%')); $T->parse('CBlock', 'COLUMN', TRUE);