// load from cache if file less than 480 seconds old $filename = 'report-click-pings-cache.html'; if (file_exists($filename)) { if (time() - filectime($filename) < 480) { readfile($filename); exit; } } // start buffering output ob_start(); // load popular link data require('poplink.php'); $pop = new Poplink(); $popular = $pop->get_popular_links(100); // build popular link report $pop_output = ""; for ($i = 0; $i < count($popular); $i++) { $p = $popular[$i]; $pop_output .= "
$pop_output