Beispiel #1
0
            $result = DB_query("SELECT COUNT(*) AS num_pages FROM {$temp_table['name']} WHERE DAYOFMONTH( date ) = {$day}");
            $row = DB_fetchArray($result, FALSE);
            $pages += $row['num_pages'];
            $T->set_var('pages', $row['num_pages']);
            $date_compare = GUS_get_date_comparison('date', $year, $month, $day);
            $result = DB_query("SELECT COUNT(*) AS num_stories FROM {$_TABLES['stories']} WHERE {$date_compare}");
            $row = DB_fetchArray($result, FALSE);
            $stories += $row['num_stories'];
            $T->set_var('stories', $row['num_stories']);
            $result = DB_query("SELECT COUNT(*) AS num_comments FROM {$_TABLES['comments']} WHERE {$date_compare}");
            $row = DB_fetchArray($result, FALSE);
            $comments += $row['num_comments'];
            $T->set_var('comments', $row['num_comments']);
            $result = DB_query("SELECT COUNT(*) AS num_links FROM {$temp_table['name']}\n\t\t\t\t\t\t\t\tWHERE page LIKE '%portal.php' AND query_string <> '' AND DAYOFMONTH( date ) = {$day}");
            $row = DB_fetchArray($result, FALSE);
            $linksf += $row['num_links'];
            $T->set_var('linksf', $row['num_links']);
            $T->Parse('ABlock', 'ROW', TRUE);
        }
    }
    $T->set_var(array('period' => $LANG_GUS00['total'], 'anon' => $anon, 'reg' => $reg, 'pages' => $pages, 'stories' => $stories, 'comments' => $comments, 'linksf' => $linksf, 'google_paging' => $navlinks));
    $title = date('F Y - ', mktime(0, 0, 0, $month, 1, $year)) . $LANG_GUS00['daily_title'];
    $display = GUS_template_finish($T, $title);
    if ($_GUS_cache and date('Yn') !== $year . $month) {
        GUS_writecache($display);
    }
    GUS_remove_temp_table($temp_table);
}
echo COM_siteHeader($_GUS_CONF['show_left_blocks']);
echo $display;
echo COM_siteFooter($_GUS_CONF['show_right_blocks']);
Beispiel #2
0
function GUS_get_ua_counts()
{
    global $_TABLES, $_GUS_UA_IGNORE, $_GUS_table_prefix;
    if (count($_GUS_UA_IGNORE) === 0) {
        return array('list' => array(), 'list_len' => 0, 'entry_count' => 0);
    }
    $tmp_name = $_GUS_table_prefix . 'temp_ua_table';
    $temp_table = GUS_create_temp_table($tmp_name, "SELECT DISTINCT ua_id, user_agent\n\t\t\t\tFROM {$_TABLES['gus_user_agents']} ua, {$_TABLES['gus_ignore_ua']} iua \n\t\t\t\tWHERE ua.user_agent LIKE iua.ua");
    $result = DB_query("SELECT DISTINCT( user_agent ), COUNT( * ) AS entries\n\t\t\t\t\t\tFROM {$_TABLES['gus_userstats']} ua JOIN {$temp_table['name']} tmp ON ua.ua_id = tmp.ua_id\n\t\t\t\t\t\tGROUP BY user_agent");
    $id_list = GUS_create_item_list_for_count($result, 'user_agent');
    GUS_remove_temp_table($temp_table);
    return $id_list;
}