Esempio n. 1
0
function pageviews_table($_where_clause, $_filters = array())
{
    $config =& SlimStatConfig::get_instance();
    $thead = array("first" => array($config->i18n->hits), "last" => array($config->i18n->percentage));
    $tbody = array();
    $total_visits = SlimStat::get_visits($_where_clause, $_filters);
    $data = SlimStat::get_pageviews_data($_where_clause, $_filters);
    $i = 0;
    foreach (array_keys($data) as $hits) {
        $p = number_format($data[$hits] / $total_visits * 100);
        $row = array("first" => array($hits), "last" => array(($p < 1 ? "&lt;1" : $p) . "%"));
        $tbody[] = $row;
        $i++;
        if ($i == $config->rows) {
            break;
        }
    }
    return SlimStat::render_table($thead, $tbody);
}