Ejemplo n.º 1
0
if (count($dateInfo) === 0) {
    //instantiate the stat site with the default type.
    $indexSite = new CollectiveIndex($siteContext, '');
    //Generate HTML
    $pageHtml = $indexSite->generateSiteCached();
    $indexSite->outputHeaders();
    //Tell the browser much there is.
    header("Content-Length: " . strlen($pageHtml));
    //And send it.
    echo $pageHtml;
    exit(0);
} else {
    //Make a general useable stat request.
    $unique = 0;
    //Show non unique visits.
    $startTime = $dateInfo['time'];
    $endTime = $dateInfo['end'];
    $statReq = new CollectiveStatRequest('', $unique, $startTime, $endTime);
    //Currently this class only supports data from total
    $statReq->setGroupby('total');
    //instantiate the stat site with the default type.
    $statSite = new CollectiveStatSite($siteContext, '');
    //Generate HTML
    $pageHtml = $statSite->generateSiteCached($statReq);
    $statSite->outputHeaders();
    //Tell the browser much there is.
    header("Content-Length: " . strlen($pageHtml));
    //And send it.
    echo $pageHtml;
    exit(0);
}