Exemple #1
0
    require_once "../inc/common.inc";
} elseif (file_exists("inc/common.inc")) {
    require_once "inc/common.inc";
} elseif (file_exists("common.inc")) {
    require_once "common.inc";
}
require_once BASEPATH . "/qcn/inc/inc/utils.inc";
require_once BASEPATH . "/qcn/inc/qcn_auto_detect.inc";
page_top();
$show_mg = $_GET["show_mag"];
//require_once(BASEPATH . "/qcnwp/earthquakes/inc/gmt_quakes.inc");
//gmt_quake_map();   // Generate the earthquake map.
echo "<p><h1>Earthquake Statistics:</h1></p>\n";
echo "<p align=\"justify\">The Quake-Catcher Network now locates earthquakes based on the data collected through volunteer distrbuted computing. Below are some plots describing our detections.</p>";
echo "<hr/>\n";
if ($f_age = file_age($file_name = BASEPATH . "/qcnwp/earthquakes/images/earthquake_through_time_hist.jpg") > 5 * 60) {
    make_quake_stats();
}
show_quake_stats();
show_viewed_on();
// Show the date page viewed on
page_end();
function file_age($file_name)
{
    if (file_exists($file_name)) {
        return time() - filemtime($file_name);
    } else {
        return null;
    }
}
function show_stats_figure($figure, $blurb)
/**
 * Create a link to a file, annotated with when it was last updated
 *
 * @param $filename - what file are we checking?
 * @param $description - what should the link say
 */
function file_link($filename, $description)
{
    printf("<a href='%s'>%s</a> (%s) ", $filename, htmlspecialchars($description), file_age($filename));
}