Exemple #1
0
function showgraph($date, $xsize = "640", $ysize = "480Â", $type, $interval)
{
    include "cfg/nmcgraph_cfg.php";
    $minscale = null;
    $maxscale = null;
    $imagefilename = dirname(__FILE__) . "/../cache/daily/daily_{$date}.png";
    $imagepath = "/cache/daily/daily_{$date}.png";
    $altimage = $type . " namecoin graph for date {$date}";
    $permalink = $siteurl . "/daily/nmc_daily.php?day=" . $date;
    $title = $type . " namecoin historic data graph for date {$date}";
    $graphgendate = "";
    $cached = null;
    $message = "daily graph is cached one hour";
    //echo $imagefilename; exit;
    if ($graphgendate = checkcache($imagefilename)) {
        $cached = true;
    } else {
        $cached = false;
        /* Create and populate the pData object */
        $MyData = new pData();
        load_nmc_data($MyData, $date, $type, $minscale, $maxscale);
        //var_dump($MyData);
        //printf("minscale: $minscale maxscale: $maxscale <br />\n");
        $graphgendate = buildgraph($MyData, $xsize, $ysize, $title, $minscale, $maxscale, $date, $type, $imagefilename);
    }
    $html_code = "<img alt=\"" . $altimage . "\" src=\"" . $imagepath . "\" />";
    return $html_code;
}
Exemple #2
0
    exit;
}
if (isset($_GET["hour"])) {
    hour();
    exit;
}
if (isset($_GET["today"])) {
    today();
    exit;
}
if (isset($_GET["week"])) {
    week();
    exit;
}
if (isset($_GET["buildgraph"])) {
    buildgraph();
    exit;
}
kav4_traffic_per_min();
exit;
function kav4_traffic_per_min()
{
    $page = CurrentPageName();
    $q = new mysql();
    $tpl = new templates();
    $title = $tpl->_ENGINE_parse_body("{APP_KAV4PROXY}:: {traffic_per_min} MB");
    $sql = "SELECT DATE_FORMAT(zDate,'%h:%i') as tdate, traffic_per_min FROM kav4proxy_av_stats WHERE zDate>=DATE_SUB(NOW(),INTERVAL 2 HOUR) ORDER BY zDate";
    $results = $q->QUERY_SQL($sql, "artica_events");
    if (mysql_num_rows($results) < 2) {
        return;
    }
Exemple #3
0
    } else {
        $ysize = 600;
    }
}
$minscale = null;
$maxscale = null;
$type = "daily";
$interval = "1-hour";
$imagefilename = "../cache/daily/daily_{$date}.png";
$imagepath = "/cache/daily/daily_{$date}.png";
$altimage = $type . " namecoin graph for date {$date}";
$permalink = $siteurl . "/daily/nmc_daily.php?day=" . $date;
$link_daybefore = $siteurl . "/daily/nmc_daily.php?day=" . $date_daybefore;
$link_nextday = $siteurl . "/daily/nmc_daily.php?day=" . $date_nextday;
$navigation = "<a href=" . $link_daybefore . ">Day before</a> - <a href=" . $link_nextday . ">Next day</a>";
$title = $type . " namecoin historic data graph for date {$date}";
$graphgendate = "";
$cached = null;
$message = "daily graph is cached one hour";
if ($graphgendate = checkcache($imagefilename)) {
    $cached = true;
} else {
    $cached = false;
    /* Create and populate the pData object */
    $MyData = new pData();
    load_nmc_data($MyData, $date, $type, $minscale, $maxscale);
    //var_dump($MyData);
    //printf("minscale: $minscale maxscale: $maxscale <br />\n");
    $graphgendate = buildgraph($MyData, $xsize, $ysize, $title, $minscale, $maxscale, $date, $type, $imagefilename);
}
renderpage($title, $permalink, $altimage, $imagepath, $graphgendate, $message, $cached, $navigation);