Ejemplo n.º 1
0
}
usort($popular_pages, 'compare_content');
$popular_pages = array_slice($popular_pages, 0, 10);
$start_time = PageViews::$time - 7 * 24 * 60 * 60;
$end_time = PageViews::$time - 1 * 24 * 60 * 60;
$start_month = date('M', $start_time);
$start_day = date('j', $start_time);
$end_month = date('M', $end_time);
$end_day = date('j', $end_time);
$year = date('Y', $end_time);
if ($start_month == $end_month) {
    $days_text = "{$start_month} {$start_day}-{$end_day}, {$year}";
} else {
    $days_text = "{$start_month} {$start_day}-{$end_month} {$end_day}, {$year}";
}
$today_total = PageViews::getToday();
require "templates/{$prefix}/statistics.html";
$page->output();
function f($count)
{
    $count_str = (string) $count;
    if (strlen($count_str) <= 3) {
        return $count_str;
    } else {
        return f(substr($count_str, 0, -3)) . ',' . substr($count_str, -3);
    }
}
function per_cent($part, $total)
{
    return round(100 * $part / $total);
}