Exemplo n.º 1
0
/**
 * cron_siteDiagnostic_update()
 *
 * @return
 */
function cron_siteDiagnostic_update()
{
    $Diagnostic = new NukeViet\Client\Diagnostic();
    $cacheFile = $Diagnostic->currentCache;
    $updtime = 0;
    if (file_exists($cacheFile)) {
        $updtime = @filemtime($cacheFile);
    }
    $currentMonth = mktime(0, 0, 0, date('m', NV_CURRENTTIME), 1, date('Y', NV_CURRENTTIME));
    if ($updtime < $currentMonth) {
        $info = $Diagnostic->process(1);
    }
    return true;
}
Exemplo n.º 2
0
    die('Stop!!!');
}
$xtpl = new XTemplate('siteDiagnostic.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
$xtpl->assign('NV_NAME_VARIABLE', NV_NAME_VARIABLE);
$xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE);
$xtpl->assign('LANG', $lang_module);
if ($nv_Request->isset_request('i', 'get')) {
    $i = $nv_Request->get_string('i', 'get');
    if ($i == 'process' or $i == 'refresh') {
        $thead = array($lang_module['diagnosticDate'], $lang_module['diagnosticGPR'], $lang_module['diagnosticATR'], $lang_module['diagnosticGBL'], $lang_module['diagnosticABL'], $lang_module['diagnosticBBL'], $lang_module['diagnosticGID'], $lang_module['diagnosticBID']);
        foreach ($thead as $r) {
            $xtpl->assign('THEAD', $r);
            $xtpl->parse('scontent.thead');
        }
        if (!isset($Diagnostic) or !is_object($Diagnostic)) {
            $Diagnostic = new NukeViet\Client\Diagnostic();
        }
        $info = $i == 'process' ? $Diagnostic->process() : $Diagnostic->process(300);
        $refresh = 0;
        $imgs = array();
        $a = 1;
        $info_item = $info['item'];
        krsort($info_item);
        foreach ($info_item as $inf) {
            $refresh = strtotime($inf['date']);
            $class_PageRank = (isset($imgs['PageRank']) and $imgs['PageRank'] > $inf['PageRank']) ? 'down' : ((isset($imgs['PageRank']) and $imgs['PageRank'] < $inf['PageRank']) ? 'up' : 'pix');
            $class_AlexaRank = (isset($imgs['AlexaRank']) and $imgs['AlexaRank'] < $inf['AlexaRank']) ? 'down' : ((isset($imgs['AlexaRank']) and $imgs['AlexaRank'] > $inf['AlexaRank']) ? 'up' : 'pix');
            $class_GoogleBackLink = (isset($imgs['GoogleBackLink']) and $imgs['GoogleBackLink'] > $inf['GoogleBackLink']) ? 'down' : ((isset($imgs['GoogleBackLink']) and $imgs['GoogleBackLink'] < $inf['GoogleBackLink']) ? 'up' : 'pix');
            $class_AlexaBackLink = (isset($imgs['AlexaBackLink']) and $imgs['AlexaBackLink'] > $inf['AlexaBackLink']) ? 'down' : ((isset($imgs['AlexaBackLink']) and $imgs['AlexaBackLink'] < $inf['AlexaBackLink']) ? 'up' : 'pix');
            $class_BingBackLink = (isset($imgs['BingBackLink']) and $imgs['BingBackLink'] > $inf['BingBackLink']) ? 'down' : ((isset($imgs['BingBackLink']) and $imgs['BingBackLink'] < $inf['BingBackLink']) ? 'up' : 'pix');
            $class_GoogleIndexed = (isset($imgs['GoogleIndexed']) and $imgs['GoogleIndexed'] > $inf['GoogleIndexed']) ? 'down' : ((isset($imgs['GoogleIndexed']) and $imgs['GoogleIndexed'] < $inf['GoogleIndexed']) ? 'up' : 'pix');