예제 #1
0
function cron_config()
{
    global $_SGLOBAL;
    //下次执行cron时间
    $query = $_SGLOBAL['db']->query("SELECT nextrun FROM " . tname('cron') . " WHERE available>'0' ORDER BY nextrun LIMIT 1");
    $nextrun = $_SGLOBAL['db']->result($query, 0);
    if (empty($nextrun)) {
        $nextrun = 0;
    }
    //更新config
    inserttable('config', array('var' => 'cronnextrun', 'datavalue' => $nextrun), 0, true);
    include_once S_ROOT . './source/function_cache.php';
    config_cache(false);
}
예제 #2
0
*/
if (!defined('IN_UCHOME') || !defined('IN_ADMINCP')) {
    exit('Access Denied');
}
//Ȩ��
if (!checkperm('managecache')) {
    cpmessage('no_authority_management_operation');
}
$turl = 'admincp.php?ac=cache';
//���»���
if (submitcheck('cachesubmit')) {
    include_once S_ROOT . './source/function_cp.php';
    include_once S_ROOT . './source/function_cache.php';
    //ϵͳ����
    if (empty($_POST['cachetype']) || in_array('database', $_POST['cachetype'])) {
        config_cache();
        usergroup_cache();
        profilefield_cache();
        profield_cache();
        censor_cache();
        block_cache();
        eventclass_cache();
        magic_cache();
        click_cache();
        task_cache();
        ad_cache();
        creditrule_cache();
        userapp_cache();
        app_cache();
        network_cache();
    }
예제 #3
0
            config_cache(false);
            cpmessage('my_register_sucess', 'admincp.php?ac=userapp');
        } else {
            //更新成功
            $_SGLOBAL['db']->query("REPLACE INTO " . tname('config') . " (var, datavalue) VALUES ('my_status', '1')");
            config_cache(false);
            cpmessage('do_success', 'admincp.php?ac=userapp');
        }
    }
} else {
    if (submitcheck('closemysubmit')) {
        //启用成功
        $res = my_site_close($_SCONFIG['my_siteid'], $_SCONFIG['my_sitekey']);
        $_SGLOBAL['db']->query("REPLACE INTO " . tname('config') . " (var, datavalue) VALUES ('my_status', '0')");
        include_once S_ROOT . './source/function_cache.php';
        config_cache(false);
        if ($res['errCode']) {
            //启用失败
            cpmessage('my_register_error', '', 1, array($res['errCode'], $res['errMessage']));
        } else {
            cpmessage('do_success', 'admincp.php?ac=userapp');
        }
    }
}
$uch_prefix = getsiteurl() . 'admincp.php?ac=userapp';
$uch_suffix = '';
$uchUrl = $uch_prefix . $uch_suffix;
//manyou
$my_prefix = 'http://uchome.manyou.com';
$my_suffix = urlencode($_GET['my_suffix']);
if (!$my_suffix) {
예제 #4
0
function getstatistics()
{
    global $_SGLOBAL, $_SC, $_SCONFIG;
    $dbsize = 0;
    $query = $_SGLOBAL['db']->query("SHOW TABLE STATUS LIKE '{$_SC['tablepre']}%'", 'SILENT');
    while ($table = $_SGLOBAL['db']->fetch_array($query)) {
        $dbsize += $table['Data_length'] + $table['Index_length'];
    }
    $sitekey = trim($_SCONFIG['sitekey']);
    if (empty($sitekey)) {
        $sitekey = mksitekey();
        $_SGLOBAL['db']->query("REPLACE INTO " . tname('config') . " (var, datavalue) VALUES ('sitekey', '{$sitekey}')");
        include_once S_ROOT . './source/function_cache.php';
        config_cache(false);
    }
    $statistics = array('sitekey' => $sitekey, 'version' => X_VER, 'release' => X_RELEASE, 'php' => PHP_VERSION, 'mysql' => $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT VERSION()"), 0), 'dbsize' => $dbsize, 'charset' => $_SC['charset'], 'sitename' => preg_replace('/[\'\\"\\s]/s', '', $_SCONFIG['sitename']), 'feednum' => getcount('feed', array()), 'blognum' => getcount('blog', array()), 'albumnum' => getcount('pic', array()), 'threadnum' => getcount('thread', array()), 'sharenum' => getcount('share', array()), 'commentnum' => getcount('comment', array()), 'myappnum' => getcount('myapp', array()), 'spacenum' => getcount('space', array()));
    $statistics['update'] = rawurlencode(serialize($statistics)) . '&h=' . substr(md5($_SERVER['HTTP_USER_AGENT'] . '|' . implode('|', $statistics)), 8, 8);
    return $statistics;
}