Exemplo n.º 1
0
            // Parse template to buffer
            $buffer .= $itemDailyStatistics->parse();
        }
        // Fill in content template variables
        $content->setVar(array('daily_statistics', 'month', 'day', 'start', 'end', 'year'), array($buffer, $monthNames[$month - 1], $day, $start, $end, $year));
        break;
    default:
        header('Location: index.php');
        exit;
}
// Fill in content template variables
$content->setVar(array('client_id', 'entry_pages', 'exit_pages', 'exit_targets', 'hosts', 'pages', 'referers', 'operating_systems', 'user_agents', 'search_engines', 'search_keywords', 'total_entry_pages', 'total_exit_pages', 'total_exit_targets', 'total_hosts', 'total_pages', 'total_referers', 'total_operating_systems', 'total_user_agents', 'total_search_engines', 'total_search_keywords', 'total_pi', 'total_visitors', 'limit'), array($clientID, isset($top['entry_pages']['top_items']) ? $top['entry_pages']['top_items'] : '', isset($top['exit_pages']['top_items']) ? $top['exit_pages']['top_items'] : '', isset($top['exit_targets']['top_items']) ? $top['exit_targets']['top_items'] : '', isset($top['hosts']['top_items']) ? $top['hosts']['top_items'] : '', isset($top['pages']['top_items']) ? $top['pages']['top_items'] : '', isset($top['referers']['top_items']) ? $top['referers']['top_items'] : '', isset($top['operating_systems']['top_items']) ? $top['operating_systems']['top_items'] : '', isset($top['user_agents']['top_items']) ? $top['user_agents']['top_items'] : '', isset($top['search_engines']['top_items']) ? $top['search_engines']['top_items'] : '', isset($top['search_keywords']['top_items']) ? $top['search_keywords']['top_items'] : '', isset($top['entry_pages']['unique_items']) ? $top['entry_pages']['unique_items'] : 0, isset($top['exit_pages']['unique_items']) ? $top['exit_pages']['unique_items'] : 0, isset($top['exit_targets']['unique_items']) ? $top['exit_targets']['unique_items'] : 0, isset($top['hosts']['unique_items']) ? $top['hosts']['unique_items'] : 0, isset($top['pages']['unique_items']) ? $top['pages']['unique_items'] : 0, isset($top['referers']['unique_items']) ? $top['referers']['unique_items'] : 0, isset($top['operating_systems']['unique_items']) ? $top['operating_systems']['unique_items'] : 0, isset($top['user_agents']['unique_items']) ? $top['user_agents']['unique_items'] : 0, isset($top['search_engines']['unique_items']) ? $top['search_engines']['unique_items'] : 0, isset($top['search_keywords']['unique_items']) ? $top['search_keywords']['unique_items'] : 0, isset($totalPageImpressions) ? $totalPageImpressions : 0, isset($totalVisitors) ? $totalVisitors : 0, $limit));
// Merge content template into layout template
$layout->setVar(array('content', 'client', 'pot_version'), array($content->parse(), $clients[$clientID], PHPOPENTRACKER_VERSION));
// Parse and output layout template
$layout->pparse();
function searchEngines($clientID, $start, $end, $limit)
{
    $searchEngines = '';
    $searchKeywords = '';
    $totalSearchEngines = 0;
    $totalSearchKeywords = 0;
    if (phpOpenTracker_API::pluginLoaded('search_engines')) {
        $result = phpOpenTracker::get(array('client_id' => $clientID, 'api_call' => 'search_engines', 'what' => 'top_search_engines', 'start' => $start, 'end' => $end, 'limit' => $limit));
        $totalSearchEngines = $result['unique_items'];
        for ($i = 0; $i < sizeof($result['top_items']); $i++) {
            // Get item template
            $item = new MyTemplate('templates/item.htm');
            // Fill in item template variables
            $item->setVar(array('rank', 'count', 'percent', 'string'), array($i + 1, $result['top_items'][$i]['count'], $result['top_items'][$i]['percent'], $result['top_items'][$i]['string']));
            $searchEngines .= $item->parse();