當前位置: 首頁>>代碼示例>>PHP>>正文


PHP saveSetting函數代碼示例

本文整理匯總了PHP中saveSetting函數的典型用法代碼示例。如果您正苦於以下問題:PHP saveSetting函數的具體用法?PHP saveSetting怎麽用?PHP saveSetting使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了saveSetting函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testQuery

    public function testQuery()
    {
        $florence_eleve = EleveQuery::create()->findOneByLogin('Florence Michu');
         
        saveSetting('abs2_saisie_par_defaut_sans_manquement','n');
        $traitements = AbsenceEleveTraitementQuery::create()->filterByManquementObligationPresence(true)
        ->useJTraitementSaisieEleveQuery()->useAbsenceEleveSaisieQuery()
        ->filterByEleve($florence_eleve)->filterByPlageTemps(new DateTime(VENDREDI_s40j5),new DateTime(DIMANCHE_s42j7.' 23:59:59'))
        ->endUse()->endUse()->find();
        $this->assertEquals(12,$traitements->count());
        $traitements = AbsenceEleveTraitementQuery::create()->filterByManquementObligationPresence(false)
        ->useJTraitementSaisieEleveQuery()->useAbsenceEleveSaisieQuery()
        ->filterByEleve($florence_eleve)->filterByPlageTemps(new DateTime(VENDREDI_s40j5),new DateTime(DIMANCHE_s42j7.' 23:59:59'))
        ->endUse()->endUse()->find();
        $this->assertEquals(7,$traitements->count());

        saveSetting('abs2_saisie_par_defaut_sans_manquement','y');
        $traitements = AbsenceEleveTraitementQuery::create()->filterByManquementObligationPresence(true)
        ->useJTraitementSaisieEleveQuery()->useAbsenceEleveSaisieQuery()
        ->filterByEleve($florence_eleve)->filterByPlageTemps(new DateTime(VENDREDI_s40j5),new DateTime(DIMANCHE_s42j7.' 23:59:59'))
        ->endUse()->endUse()->find();
        $this->assertEquals(10,$traitements->count());

        saveSetting('abs2_saisie_par_defaut_sans_manquement','n');
    }
開發者ID:rhertzog,項目名稱:lcs,代碼行數:25,代碼來源:AbsenceEleveTraitementTest.php

示例2: on_install

 function on_install()
 {
     $query = DB::query('SHOW TABLES');
     $tables = array();
     while ($table = DB::fetch($query)) {
         $tables[] = implode('', $table);
     }
     if (!in_array('x_meizi_a', $tables)) {
         DB::query("create table if not exists x_meizi_a(id int(10) unsigned not null auto_increment primary key,uid int(10) unsigned not null,votetype tinyint(1) unsigned not null,userid int(12) unsigned NOT NULL,fid int(12) unsigned not null,name varchar(32) not null,kw varchar(128) not null,statue text not null) ENGINE=InnoDB DEFAULT CHARSET=utf8");
         DB::query("create table if not exists x_meizi_b(id int(10) unsigned not null auto_increment primary key,uid int(10) unsigned not null,islogin tinyint(1) not null default 0,userid int(12) unsigned not null,name varchar(32) not null,cookie text not null,voted tinyint(1) unsigned not null default 0) ENGINE=InnoDB DEFAULT CHARSET=utf8");
         DB::query("create table if not exists x_meizi_log(id int(10) unsigned not null,uid int(10) unsigned NOT NULL, date int(11) not null DEFAULT 0, status tinyint(1) NOT NULL DEFAULT 0, success int(4) NOT NULL DEFAULT 0, failed int(4) NOT NULL DEFAULT 0,UNIQUE KEY id (id,date),KEY uid (uid)) ENGINE=InnoDB DEFAULT CHARSET=utf8");
         DB::query("replace into cron (`id`, `enabled`, `nextrun`, `order`) values ('x_meizi_daily',1,0, 96),('x_meizi_vote',1,0,97)");
         saveSetting('x_mz_nowid', '0');
         saveSetting('x_mz_nextrun', '0');
         saveSetting('x_meizi', $this->nowversion);
         showmessage("妹紙刷票插件" . substr($this->nowversion, 0, 5) . "版安裝成功");
     }
     $version = getSetting('x_meizi');
     switch ($version) {
         case '0.1.0_13-12-03':
             DB::query("alter table x_meizi_a add votetype tinyint(1) unsigned not null default 1");
             DB::query("alter table x_meizi_log_a add votenum int(4) NOT NULL DEFAULT 0");
         case '0.1.1_13-12-04':
             DB::query("drop table x_meizi_log_b");
             DB::query("alter table x_meizi_log_a rename to x_meizi_log");
             DB::query("alter table x_meizi_log change votenum success int(4) not null default 0");
             DB::query("alter table x_meizi_log add failed int(4) not null default 0");
             DB::query("alter table x_meizi_b add voted tinyint(1) unsigned not null default 0");
         case '0.1.2_13-12-05':
             saveSetting('x_mz_nextrun', '0');
         default:
             saveSetting('x_meizi', $this->nowversion);
             showmessage('妹紙刷票插件已升級到' . substr($this->nowversion, 0, 5) . '版!');
     }
 }
開發者ID:myhloli,項目名稱:Tieba_Sign,代碼行數:35,代碼來源:plugin.class.php

示例3: on_config

 function on_config()
 {
     if ($_POST['limit']) {
         saveSetting('ip_reglimit', $_POST['limit']);
         showmessage('設置已經保存!');
     } else {
         return '<p>單個 IP 注冊上限:<input type="text" name="limit" value="' . getSetting('ip_reglimit') . '" /></p>';
     }
 }
開發者ID:dfc643,項目名稱:tieba-sign-mod,代碼行數:9,代碼來源:plugin.class.php

示例4: showSettingsGUI

function showSettingsGUI()
{
    // adminpage, stop here if not logged in/right access-level
    if (!isValidAdmin()) {
        echo getString("not_valid_admin", "Administratorside, du må logge inn for å få tilgang her");
        return;
    }
    if (isset($_REQUEST['module'])) {
        $module = $_REQUEST['module'];
    } else {
        $module = "";
    }
    if (isset($_REQUEST['key'])) {
        $key = $_REQUEST['key'];
    } else {
        $key = "";
    }
    h3(getString("settings_header", "Innstillinger"));
    // mulighet til å velge andre moduler:
    showModulesDropDown($module);
    if (isset($_REQUEST['save'])) {
        if ($_REQUEST['save'] == true && $key != "") {
            // check if we got a value, if we did not, it's a unchecked checkbox.'
            // did we get a value to save?
            if (isset($_REQUEST['setting'])) {
                $value = $_REQUEST['setting'];
                // "bugfix" kind of
                if (getSettingType($key) == "boolean") {
                    // check if it is an checkbox, if so, its value is "on"
                    if ($value == "on") {
                        $value = "true";
                    }
                }
            } else {
                // setting the value to false, as this probably is an unchecked checkbox.
                $value = "false";
            }
            // save
            $result = saveSetting($key, $value);
            div_open();
            // success? reset key.
            if ($result == true) {
                // reset
                $key = "";
                echo getString("settings_saved_setting", "Innstilling lagret!");
            } else {
                echo getString("settings_could_not_save_setting", "Greide ikke å lagre innstilling!");
            }
            div_close();
        }
    }
    // if chosen, show the settings
    if ($module) {
        showModuleSettings($module, $key);
    }
}
開發者ID:arewold,項目名稱:calcuttagutta,代碼行數:56,代碼來源:settingsGUI.php

示例5: checkLastGuid

function checkLastGuid()
{
    global $log, $cronlog, $db, $settings;
    $mylog = null;
    if (isset($cronlog) && $cronlog instanceof FroxlorLogger) {
        $mylog = $cronlog;
    } else {
        $mylog = $log;
    }
    $group_lines = array();
    $group_guids = array();
    $update_to_guid = 0;
    $froxlor_guid = 0;
    $result = $db->query_first("SELECT MAX(`guid`) as `fguid` FROM `" . TABLE_PANEL_CUSTOMERS . "`");
    $froxlor_guid = $result['fguid'];
    $g_file = '/etc/group';
    if (file_exists($g_file)) {
        if (is_readable($g_file)) {
            if (true == ($groups = file_get_contents($g_file))) {
                $group_lines = explode("\n", $groups);
                foreach ($group_lines as $group) {
                    $group_guids[] = explode(":", $group);
                }
                foreach ($group_guids as $idx => $group) {
                    /**
                     * nogroup | nobody have very high guids
                     * ignore them
                     */
                    if ($group[0] == 'nogroup' || $group[0] == 'nobody') {
                        continue;
                    }
                    $guid = isset($group[2]) ? (int) $group[2] : 0;
                    if ($guid > $update_to_guid) {
                        $update_to_guid = $guid;
                    }
                }
                if ($update_to_guid < $froxlor_guid) {
                    $update_to_guid = $froxlor_guid;
                    if ($update_to_guid != $settings['system']['lastguid']) {
                        $mylog->logAction(CRON_ACTION, LOG_NOTICE, 'Updating froxlor last guid to ' . $update_to_guid);
                        saveSetting('system', 'lastguid', $update_to_guid);
                        $settings['system']['lastguid'] = $update_to_guid;
                    }
                }
            } else {
                $mylog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
            }
        } else {
            $mylog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
        }
    } else {
        $cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group does not exist; cannot check for latest guid');
    }
}
開發者ID:Alkyoneus,項目名稱:Froxlor,代碼行數:54,代碼來源:function.checklastguid.php

示例6: enregistre

 private function enregistre($nom)
 {
     if (isset($_POST[$nom])) {
         $temp = 'yes';
     } else {
         $temp = 'no';
     }
     if (!saveSetting($nom, $temp)) {
         $msg .= "Erreur lors de l'enregistrement de " . $nom . " avec la valeur " . $temp . " !<br />";
     }
 }
開發者ID:rhertzog,項目名稱:lcs,代碼行數:11,代碼來源:class_droit_acces_template.php

示例7: storeSettingField

/**
 * This file is part of the SysCP project.
 * Copyright (c) 2003-2009 the SysCP Team (see authors).
 *
 * For the full copyright and license information, please view the COPYING
 * file that was distributed with this source code. You can also view the
 * COPYING file online at http://files.syscp.org/misc/COPYING.txt
 *
 * @copyright  (c) the authors
 * @author     Florian Lippert <flo@syscp.org>
 * @license    GPLv2 http://files.syscp.org/misc/COPYING.txt
 * @package    Functions
 * @version    $Id$
 */
function storeSettingField($fieldname, $fielddata, $newfieldvalue)
{
    if (is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] != '' && isset($fielddata['varname']) && $fielddata['varname'] != '') {
        if (saveSetting($fielddata['settinggroup'], $fielddata['varname'], $newfieldvalue) != false) {
            return array($fielddata['settinggroup'] . '.' . $fielddata['varname'] => $newfieldvalue);
        } else {
            return false;
        }
    } else {
        return false;
    }
}
開發者ID:HobbyNToys,項目名稱:SysCP,代碼行數:26,代碼來源:function.storeSettingField.php

示例8: storeSettingIpAddress

/**
 * This file is part of the SysCP project.
 * Copyright (c) 2003-2009 the SysCP Team (see authors).
 *
 * For the full copyright and license information, please view the COPYING
 * file that was distributed with this source code. You can also view the
 * COPYING file online at http://files.syscp.org/misc/COPYING.txt
 *
 * @copyright  (c) the authors
 * @author     Florian Lippert <flo@syscp.org>
 * @license    GPLv2 http://files.syscp.org/misc/COPYING.txt
 * @package    Functions
 * @version    $Id$
 */
function storeSettingIpAddress($fieldname, $fielddata, $newfieldvalue)
{
    $returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
    if ($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'system' && isset($fielddata['varname']) && $fielddata['varname'] == 'ipaddress') {
        $mysql_access_host_array = array_map('trim', explode(',', getSetting('system', 'mysql_access_host')));
        $mysql_access_host_array[] = $newfieldvalue;
        $mysql_access_host_array = array_unique(array_trim($mysql_access_host_array));
        $mysql_access_host = implode(',', $mysql_access_host_array);
        correctMysqlUsers($mysql_access_host_array);
        saveSetting('system', 'mysql_access_host', $mysql_access_host);
    }
    return $returnvalue;
}
開發者ID:HobbyNToys,項目名稱:SysCP,代碼行數:27,代碼來源:function.storeSettingIpAddress.php

示例9: loadRoomList

function loadRoomList()
{
    include_once dirname(__FILE__) . '/yaml/spyc.php';
    $settings = loadSettings();
    $areas = getAreaList();
    $rooms = array();
    foreach ($areas as $k => $l) {
        $array = Spyc::YAMLLoad($settings['base_game'] . '/entities/areas/' . $k . '/rooms.yml');
        foreach ($array as $a) {
            $rooms[$a['location']] = array('title' => $a['title']['en'], 'area' => $k);
        }
    }
    saveSetting('rooms', $rooms);
}
開發者ID:seanohue,項目名稱:ranviermud-console,代碼行數:14,代碼來源:ranvier.php

示例10: storeSettingApsPhpExtensions

/**
 * This file is part of the Froxlor project.
 * Copyright (c) 2003-2009 the SysCP Team (see authors).
 * Copyright (c) 2010 the Froxlor Team (see authors).
 *
 * For the full copyright and license information, please view the COPYING
 * file that was distributed with this source code. You can also view the
 * COPYING file online at http://files.froxlor.org/misc/COPYING.txt
 *
 * @copyright  (c) the authors
 * @author     Florian Lippert <flo@syscp.org> (2003-2009)
 * @author     Froxlor team <team@froxlor.org> (2010-)
 * @license    GPLv2 http://files.froxlor.org/misc/COPYING.txt
 * @package    Functions
 *
 */
function storeSettingApsPhpExtensions($fieldname, $fielddata, $newfieldvalue)
{
    $returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
    if ($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'aps' && isset($fielddata['varname']) && $fielddata['varname'] == 'php-extension') {
        $newfieldvalue_array = explode(',', $newfieldvalue);
        if (in_array('mcrypt', $newfieldvalue_array)) {
            $functions = 'mcrypt_encrypt,mcrypt_decrypt';
        } else {
            $functions = '';
        }
        if ($functions != getSetting('aps', 'php-function')) {
            saveSetting('aps', 'php-function', $functions);
        }
    }
    return $returnvalue;
}
開發者ID:Alkyoneus,項目名稱:Froxlor,代碼行數:32,代碼來源:function.storeSettingApsPhpExtensions.php

示例11: do_register

 public static function do_register()
 {
     global $siteurl;
     list($id, $key) = self::_get_id_and_key();
     if ($id && $key) {
         return true;
     }
     $ret = kk_fetch_url(self::API_ROOT . 'register.php', 0, 'url=' . bin2hex(authcode($siteurl, 'ENCODE', 'CLOUD-REGISTER')));
     if (!$ret) {
         return false;
     }
     list($errno, $sid, $key) = explode("\t", $ret);
     if ($errno != 1) {
         throw new Exception('Fail to register in cloud system.');
     }
     saveSetting('cloud', authcode("{$sid}\t{$key}", 'ENCODE', '-TiebaSignAPI-'));
 }
開發者ID:wsunxa,項目名稱:Tieba_Sign-1,代碼行數:17,代碼來源:cloud.php

示例12: storeSettingApsWebserverModules

/**
 * This file is part of the SysCP project.
 * Copyright (c) 2003-2009 the SysCP Team (see authors).
 *
 * For the full copyright and license information, please view the COPYING
 * file that was distributed with this source code. You can also view the
 * COPYING file online at http://files.syscp.org/misc/COPYING.txt
 *
 * @copyright  (c) the authors
 * @author     Florian Lippert <flo@syscp.org>
 * @license    GPLv2 http://files.syscp.org/misc/COPYING.txt
 *
 * @version    $Id$
 */
function storeSettingApsWebserverModules($fieldname, $fielddata, $newfieldvalue)
{
    if (is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'aps' && isset($fielddata['varname']) && $fielddata['varname'] == 'webserver-module') {
        $newfieldvalue_array = explode(',', $newfieldvalue);
        if (in_array('mod_rewrite', $newfieldvalue_array)) {
            // Don't have to guess if we have to remove the leading comma as mod_rewrite is set anyways when we're here...
            $newfieldvalue .= ',mod_rewrite.c';
        }
        if (in_array('htaccess', $newfieldvalue_array)) {
            $htaccess = 'htaccess';
        } else {
            $htaccess = '';
        }
        if ($htaccess != getSetting('aps', 'webserver-htaccess')) {
            saveSetting('aps', 'webserver-htaccess', $htaccess);
        }
    }
    return storeSettingField($fieldname, $fielddata, $newfieldvalue);
}
開發者ID:markc,項目名稱:syscp,代碼行數:33,代碼來源:function.storeSettingApsWebserverModules.php

示例13: _ops_logo_update

function _ops_logo_update()
{
    // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
    // of $_FILES.
    if (!isset($_POST['logosite'])) {
        redirect('mgmt_website/website', "error missing logosite value");
    }
    $site = $_POST['logosite'];
    if ($_FILES['logo']['error'] != UPLOAD_ERR_OK) {
        $error_code = $_FILES['logo']['error'];
        redirect('mgmt_website/website', file_upload_error_message($error_code));
    } else {
        $fileName = $site . "-" . $_FILES['logo']['name'];
        //  . '' .$_FILES['logo']['type'];
        move_uploaded_file($_FILES['logo']['tmp_name'], "img/" . $fileName);
        saveSetting("\$SETTINGS_" . $site . "_LOGO", $fileName);
    }
    // _checkCreditials
    redirect('mgmt_website/website', "logo updated");
}
開發者ID:brata-hsdc,項目名稱:brata.masterserver,代碼行數:20,代碼來源:ops_logo_update.php

示例14: check_token

    check_token();
    $prefixe_url = isset($_POST['prefixe_url']) ? $_POST['prefixe_url'] : array();
    $suppr_prefixe_url = isset($_POST['suppr_prefixe_url']) ? $_POST['suppr_prefixe_url'] : array();
    $tab_deja = array();
    $url_absolues_gepi = "";
    for ($loop = 0; $loop < count($prefixe_url); $loop++) {
        $prefixe_url[$loop] = preg_replace("|/{1,}\$|", "", $prefixe_url[$loop]);
        if ($prefixe_url[$loop] != "" && !in_array($prefixe_url[$loop], $suppr_prefixe_url) && !in_array($prefixe_url[$loop], $tab_deja)) {
            if ($url_absolues_gepi != "") {
                $url_absolues_gepi .= "|";
            }
            $url_absolues_gepi .= $prefixe_url[$loop];
            $tab_deja[] = $prefixe_url[$loop];
        }
    }
    if (saveSetting("url_absolues_gepi", $url_absolues_gepi)) {
        $msg = "Enregistrement effectué.<br />";
    } else {
        $msg = "ERREUR lors de l'enregistrement.<br />";
    }
}
$eff_parcours = 5;
//**************** EN-TETE *****************
$titre_page = "Cahier de textes - Notices avec docs joints en URL absolues";
require_once "../lib/header.inc.php";
//**************** FIN EN-TETE *************
//debug_var();
echo "<p class='bold'><a href='../cahier_texte_admin/index.php'><img src='../images/icons/back.png' alt='Retour' class='back_link'/> Retour</a>";
$url_absolues_gepi = getSettingValue("url_absolues_gepi");
if (!isset($mode)) {
    if ($url_absolues_gepi != "") {
開發者ID:alhousseyni,項目名稱:gepi,代碼行數:31,代碼來源:correction_notices_url_absolues_docs_joints.php

示例15: Setting

Save a Setting (k/v) and redirect to URI u
***************************************************************/
include "connect.inc.php";
include "settings.inc.php";
include "utilities.inc.php";
$k = getreq('k');
$v = getreq('v');
$u = getreq('u');
if ($k == 'currentlanguage') {
    unset($_SESSION['currenttextpage']);
    unset($_SESSION['currenttextquery']);
    unset($_SESSION['currenttexttag1']);
    unset($_SESSION['currenttexttag2']);
    unset($_SESSION['currenttexttag12']);
    unset($_SESSION['currentwordpage']);
    unset($_SESSION['currentwordquery']);
    unset($_SESSION['currentwordstatus']);
    unset($_SESSION['currentwordtext']);
    unset($_SESSION['currentwordtag1']);
    unset($_SESSION['currentwordtag2']);
    unset($_SESSION['currentwordtag12']);
    unset($_SESSION['currentarchivepage']);
    unset($_SESSION['currentarchivequery']);
    unset($_SESSION['currentarchivetexttag1']);
    unset($_SESSION['currentarchivetexttag2']);
    unset($_SESSION['currentarchivetexttag12']);
    saveSetting('currenttext', '');
}
saveSetting($k, $v);
header("Location: " . $u);
exit;
開發者ID:russell359,項目名稱:lwt,代碼行數:31,代碼來源:save_setting_redirect.php


注:本文中的saveSetting函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。