Пример #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);
}
Пример #2
0
		echo $sg->getSite();
		exit;
	}
*/
//Make a general useable stat request
$unique = 0;
//For testing only
$startTime = 0;
//For testing only
$endTime = time();
//For testing only
$statReq = new CollectiveStatRequest('', $unique, $startTime, $endTime);
//Currently this class only supports data from total
$statReq->setGroupby('total');
//Instantierer statistiksiden og angiver typen p� statistiksiden.
if (array_key_exists('type', $ind)) {
    $statSite = new CollectiveStatSite($siteContext, $ind['type']);
} else {
    $statSite = new CollectiveStatSite($siteContext, '');
}
/*----Selve programmet----*/
//Sender headers til browseren om at siden ikke m� caches.
$lib->outputNoCacheHeaders();
//Genererer HTML'en
$side = $statSite->generateSite($statReq);
$statSite->outputHeaders();
//Fort�ller browseren hvor meget HTML der er.
header("Content-Length: " . strlen($side));
//Sender HTML'en.
echo $side;