Example #1
0
function save_config($type = 'ini')
{
    return configure_save();
    global $INI;
    $q = ZSystem::GetSaveINI($INI);
    if (strtoupper($type) == 'INI') {
        if (!is_writeable(SYS_INIFILE)) {
            return false;
        }
        return write_ini_file($q, SYS_INIFILE);
    }
    if (strtoupper($type) == 'PHP') {
        if (!is_writeable(SYS_PHPFILE)) {
            return false;
        }
        return write_php_file($q, SYS_PHPFILE);
    }
    return false;
}
Example #2
0
		else $u = Table::Fetch('user', $username, 'username');
		if ($u && $credit) {
			ZCredit::Create($credit, $u['id'], 'charge', 0);
            log_admin('credit', $u['username'].'用户积分充值',$u);
			redirect(null, '用户积分充值成功!');
		}
	}
	else if ( 'settings' == $action ) {
		$INI['credit']['register'] = abs(intval($_POST['credit']['register']));
		$INI['credit']['login'] = abs(intval($_POST['credit']['login']));
		$INI['credit']['invite'] = abs(intval($_POST['credit']['invite']));
		$INI['credit']['buy'] = abs(intval($_POST['credit']['buy']));
		$INI['credit']['pay'] = 0 + ($_POST['credit']['pay']);
		$INI['credit']['charge'] = 0 + ($_POST['credit']['charge']);
        $INI['credit']['comment'] = abs(intval($_POST['credit']['comment']));
		configure_save('credit');
        log_admin('credit', '设置积分规则',$_POST);
		redirect(null, '设置积分规则成功!');
	}
}

$INI['credit']['register'] = abs(intval($INI['credit']['register']));
$INI['credit']['login'] = abs(intval($INI['credit']['login']));
$INI['credit']['invite'] = abs(intval($INI['credit']['invite']));
$INI['credit']['buy'] = abs(intval($INI['credit']['buy']));
$INI['credit']['comment'] = abs(intval($INI['credit']['comment']));
$INI['credit']['pay'] = 0 + ($INI['credit']['pay']);
$INI['credit']['charge'] = 0 + ($INI['credit']['charge']);

include template('manage_credit_settings');