当前位置: 首页>>代码示例>>PHP>>正文


PHP load_settings函数代码示例

本文整理汇总了PHP中load_settings函数的典型用法代码示例。如果您正苦于以下问题:PHP load_settings函数的具体用法?PHP load_settings怎么用?PHP load_settings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了load_settings函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_prefs

function get_prefs($nick)
{
    $prefs = load_settings(WEATHER_PREFS_FILE);
    if (isset($prefs[$nick]) == True) {
        return unserialize($prefs[$nick]);
    } else {
        return False;
    }
}
开发者ID:cmn32480,项目名称:exec-irc-bot,代码行数:9,代码来源:weather_lib.php

示例2: __construct

	function __construct() {
		parent::__construct();
		if (file_exists(FCPATH . "config.php")) {
			$this->load->database();
			$this->load->library('session');
			$this->load->library('tank_auth');
			$this->load->library('datamapper');

			if (!$this->session->userdata('nation')) {
				// If the user doesn't have a nation set, let's grab it
				//
				require_once("assets/geolite/GeoIP.php");
				$gi = geoip_open("assets/geolite/GeoIP.dat", GEOIP_STANDARD);
				$remote_addr = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR']: '127.0.0.1';
				$nation = geoip_country_code_by_addr($gi, $remote_addr);
				geoip_close($gi);
				$this->session->set_userdata('nation', $nation);
			}
			
			// loads variables from database for get_setting()
			load_settings();
			
			$this->config->config['tank_auth']['allow_registration'] = !get_setting('fs_reg_disabled');

			$this->config->config['tank_auth']['email_activation'] = ((get_setting('fs_reg_email_disabled'))?FALSE:TRUE);
			
			$captcha_public = get_setting('fs_reg_recaptcha_public');
			if ($captcha_public != "") {
				$captcha_secret = get_setting('fs_reg_recaptcha_secret');
				if ($captcha_secret != "") {
					$this->config->config['tank_auth']['use_recaptcha'] = TRUE;
					$this->config->config['tank_auth']['recaptcha_public_key'] = $captcha_public;
					$this->config->config['tank_auth']['recaptcha_secret_key'] = $captcha_secret;
				}
			}
		}
	}
开发者ID:Nakei,项目名称:FoOlSlide,代码行数:37,代码来源:MY_Controller.php

示例3: exit

//
// Compatibilité avec les version < 2.3.x
//
if (!defined('WA_ROOTDIR')) {
    if (!isset($waroot)) {
        exit("Le répertoire de Wanewsletter n'est pas défini!");
    }
    define('WA_ROOTDIR', rtrim($waroot, '/'));
}
$default_error_reporting = error_reporting(E_ALL);
require WA_ROOTDIR . '/start.php';
require WA_ROOTDIR . '/includes/functions.validate.php';
if (!empty($language) && validate_lang($language)) {
    load_settings(array('admin_lang' => $language));
} else {
    load_settings();
}
$action = !empty($_REQUEST['action']) ? trim($_REQUEST['action']) : '';
$email = !empty($_REQUEST['email']) ? trim($_REQUEST['email']) : '';
$format = isset($_REQUEST['format']) ? intval($_REQUEST['format']) : 0;
$liste = isset($_REQUEST['liste']) ? intval($_REQUEST['liste']) : 0;
$message = '';
$code = '';
if (empty($action) && preg_match('/([a-z0-9]{20})(?:&|$)/i', $_SERVER['QUERY_STRING'], $match)) {
    $code = $match[1];
} else {
    if (!empty($action) && !empty($email) && strlen($code) == 32) {
        $code = substr($code, 0, 20);
    }
}
if (!empty($action) || !empty($code)) {
开发者ID:bibwho,项目名称:MATPbootstrap,代码行数:31,代码来源:newsletter.php

示例4: header

} else {
    header("Location: login.php\n\n");
    exit;
}
// default settings loaded, may be overwritten when preferences get loaded
// to handle older .wfmrc files
$personal["language"] = $default_lang;
$personal["prev_size"] = $editor_prefs["preview_size"];
$personal["edit_col"] = $editor_prefs["cols"];
$personal["edit_row"] = $editor_prefs["rows"];
$personal["show_hidden"] = FALSE;
// load users theme if allow_custom setting is on
if ($allow_custom) {
    // load the .wfmrc file, then load the appropriate theme
    // overwrites default settings set earlier
    $personal = array_merge($personal, load_settings($fp, $default_theme, $def_Display_Hidden, $numeric_val));
    // if the user specified to start in a different dir from his home dir
    if (compat_array_key_exists("start_dir", $personal) && $personal["start_dir"] != "") {
        $location = "Location: crossover.php?SID=" . session_id() . "&submit=CD&CHDIR={$personal['start_dir']}" . $lang_loc;
    }
}
$theme = find_theme($fp, $personal, $default_theme);
// Following variables are stored in an array in the session in this order
// user - user who is logging in
// pass - users encrypted (if supported) password
// server - server connected too
// port - port connected on
// dir - current directory
// warn - warning messagez
// IP - remote IP address
// level - warning severity level
开发者ID:BackupTheBerlios,项目名称:vhcs-svn,代码行数:31,代码来源:check_login.php

示例5: cron

 public function cron()
 {
     if ($this->tank_auth->is_admin()) {
         $last_check = get_setting('fs_cron_autoupgrade');
         // hourly cron
         if (time() - $last_check > 3600) {
             // update autoupgrade cron time
             $this->db->update('preferences', array('value' => time()), array('name' => 'fs_cron_autoupgrade'));
             // load model
             $this->load->model('upgrade_model');
             // check
             $versions = $this->upgrade_model->check_latest(TRUE);
             // if a version is outputted, save the new version number in database
             if ($versions[0]) {
                 $this->db->update('preferences', array('value' => $versions[0]->version . '.' . $versions[0]->subversion . '.' . $versions[0]->subsubversion), array('name' => 'fs_cron_autoupgrade_version'));
             }
             // remove one week old logs
             $files = glob($this->config->item('log_path') . 'log*.php');
             foreach ($files as $file) {
                 if (filemtime($file) < strtotime('-7 days')) {
                     unlink($file);
                 }
             }
             // reload the settings
             load_settings();
         }
     }
 }
开发者ID:KasaiDot,项目名称:FoOlSlide,代码行数:28,代码来源:Admin_Controller.php

示例6: dirname

 * manager_menu.php
 *
 * This file handles the menu (left) pane of the Solid State Manager application.
 *
 * @package Pages
 * @author John Diamond <jdiamond@solid-state.org>
 * @copyright John Diamond <jdiamond@solid-state.org>
 * @license http://www.opensource.org/licenses/gpl-license.php GNU Public License
 */
// Load config file
require_once dirname(__FILE__) . "/../config/config.inc.php";
// Load SolidWorks
require_once dirname(__FILE__) . "/../solidworks/solidworks.php";
// Load settings from database
require_once dirname(__FILE__) . "/../util/settings.php";
load_settings($conf);
require_once dirname(__FILE__) . "/../include/SolidStateMenu.class.php";
// Set the current theme
$theme = isset($_SESSION['client']['userdbo']) ? $_SESSION['client']['userdbo']->getTheme() : $conf['themes']['manager'];
$conf['themes']['current'] = $theme;
// Load the user's language preference
session_start();
$language = isset($_SESSION['client']['userdbo']) ? $_SESSION['client']['userdbo']->getLanguage() : null;
if ($language != null) {
    TranslationParser::load("language/" . $language);
    Translator::getTranslator()->setActiveLanguage($language);
}
// Change the charset to UTF-8
header("Content-type: text/html; charset=utf-8");
// Build the core menu
$menu = SolidStateMenu::getSolidStateMenu();
开发者ID:carriercomm,项目名称:NeoBill,代码行数:31,代码来源:manager_menu.php

示例7: _submit

	function _submit($post) {
		$this->load->library('form_validation');
		$this->form_validation->set_rules('db_type', _('Database type'), '');
		$this->form_validation->set_rules('db_hostname', _('Database hostname'), '');
		$this->form_validation->set_rules('db_name', _('Database name'), '');
		$this->form_validation->set_rules('db_username', _('Database username'), '');
		$this->form_validation->set_rules('db_password', _('Database password'), '');
		$this->form_validation->set_rules('db_prefix', _('Database prefix'), '');
		$this->form_validation->set_rules('username', _('Administrator username'), 'required|min_length[4]|max_length[20]');
		$this->form_validation->set_rules('password', _('Administrator password'), 'required|min_length[5]|max_length[20]');
		$this->form_validation->set_rules('email', _('Administrator email'), 'required|valid_email');

		if ($this->form_validation->run() == FALSE) {
			return false;
		}

		if (!is_writable('content') && is_writable('content/themes')) {
			return false;
		}

		$config["hostname"] = $post["db_hostname"];
		$config["database"] = $post["db_name"];
		$config["username"] = $post["db_username"];
		$config["password"] = $post["db_password"];
		$config["dbprefix"] = $post["db_prefix"];
		$config['dbdriver'] = $post["db_type"];
		$config['pconnect'] = FALSE;
		$config['db_debug'] = FALSE;
		$config['cache_on'] = FALSE;
		$config['cachedir'] = "";
		$config['char_set'] = "utf8";
		$config['dbcollat'] = "utf8_general_ci";
		$this->db = $this->load->database($config, TRUE);
		if ($this->db->conn_id == "") {
			// unable to connect
			set_notice('error', _('Connection with database not enstabilished: check the database fields.'));
			return false;
		}

		$config = read_file('assets/config.sample.php');
		$config = str_replace("\$db['default']['dbdriver'] = ''", "\$db['default']['dbdriver'] = '" . addslashes($post["db_type"]) . "'", $config);
		$config = str_replace("\$db['default']['hostname'] = 'localhost'", "\$db['default']['hostname'] = '" . addslashes($post["db_hostname"]) . "'", $config);
		$config = str_replace("\$db['default']['username'] = ''", "\$db['default']['username'] = '" . addslashes($post["db_username"]) . "'", $config);
		$config = str_replace("\$db['default']['password'] = ''", "\$db['default']['password'] = '" . addslashes($post["db_password"]) . "'", $config);
		$config = str_replace("\$db['default']['database'] = ''", "\$db['default']['database'] = '" . addslashes($post["db_name"]) . "'", $config);
		$config = str_replace("\$db['default']['dbprefix'] = 'fs_'", "\$db['default']['dbprefix'] = '" . addslashes($post["db_prefix"]) . "'", $config);

		$random_string = random_string(20);
		$this->config->set_item('encryption_key', $random_string);
		$config = str_replace("\$config['encryption_key'] = ''", "\$config['encryption_key'] = '" . addslashes($random_string) . "'", $config);

		$manual_config = FALSE;
		if (!write_file('config.php', $config)) {
			$manual_config = TRUE;
		}

		$this->load->library('migration');
		$this->migration->latest();
		$this->load->library('session');
		$this->load->library('tank_auth');
		$this->load->library('datamapper');
		load_settings();

		$user = $this->tank_auth->create_user($post["username"], $post["email"], $post["password"], FALSE);
		if ($user !== FALSE) {
			$profile = new Profile();
			$profile->where('user_id', $user['user_id'])->get();
			$profile->group_id = 1;
			$profile->save();
		}

		if (!is_dir('content/ads'))
			mkdir('content/ads');
		if (!is_dir('content/cache'))
			mkdir('content/cache');
		if (!is_dir('content/logs'))
			mkdir('content/logs');
		if (!is_dir('content/comics'))
			mkdir('content/comics');

		if ($manual_config) {
			$this->notices = array();
			$data["config"] = $config;
			$this->viewdata['main_content_view'] = $this->load->view("install/manual_config", $data, TRUE);
			$this->load->view("admin/default", $this->viewdata);
			return 'stop';
		}

		flash_notice('notice', _('FoOlSlide has installed successfully. Check the preferences and make sure you create a team entry for your own chapters.'));
		redirect('/admin/');
	}
开发者ID:Nakei,项目名称:FoOlSlide,代码行数:91,代码来源:install.php

示例8: _submit

 function _submit($post)
 {
     // validate the inputted data with the validation class
     $this->load->library('form_validation');
     $this->form_validation->set_rules('db_type', _('Database type'), '');
     $this->form_validation->set_rules('db_hostname', _('Database hostname'), '');
     $this->form_validation->set_rules('db_name', _('Database name'), '');
     $this->form_validation->set_rules('db_username', _('Database username'), '');
     $this->form_validation->set_rules('db_password', _('Database password'), '');
     $this->form_validation->set_rules('db_prefix', _('Database prefix'), '');
     $this->form_validation->set_rules('username', _('Administrator username'), 'required|min_length[4]|max_length[20]');
     $this->form_validation->set_rules('password', _('Administrator password'), 'required|min_length[5]|max_length[20]');
     $this->form_validation->set_rules('email', _('Administrator email'), 'required|valid_email');
     if ($this->form_validation->run() == FALSE) {
         return false;
     }
     if (!is_writable('content') && is_writable('content/themes')) {
         return false;
     }
     // we need to check database connection, and to do that we need to connect in first place
     $config["hostname"] = $post["db_hostname"];
     $config["database"] = $post["db_name"];
     $config["username"] = $post["db_username"];
     $config["password"] = $post["db_password"];
     $config["dbprefix"] = $post["db_prefix"];
     $config['dbdriver'] = $post["db_type"];
     $config['pconnect'] = FALSE;
     $config['db_debug'] = FALSE;
     $config['cache_on'] = FALSE;
     $config['cachedir'] = "";
     $config['char_set'] = "utf8";
     $config['dbcollat'] = "utf8_general_ci";
     // load the co
     $this->db = $this->load->database($config, TRUE);
     // without conn_id we're not connected to the database
     if ($this->db->conn_id == "") {
         // unable to connect
         set_notice('error', _('Connection with database not enstabilished: check the database fields.'));
         return false;
     }
     // pick the sample config and replace entries so we can insert the database
     $config = read_file('assets/config.sample.php');
     $config = str_replace("\$db['default']['dbdriver'] = ''", "\$db['default']['dbdriver'] = '" . addslashes($post["db_type"]) . "'", $config);
     $config = str_replace("\$db['default']['hostname'] = 'localhost'", "\$db['default']['hostname'] = '" . addslashes($post["db_hostname"]) . "'", $config);
     $config = str_replace("\$db['default']['username'] = ''", "\$db['default']['username'] = '" . addslashes($post["db_username"]) . "'", $config);
     $config = str_replace("\$db['default']['password'] = ''", "\$db['default']['password'] = '" . addslashes($post["db_password"]) . "'", $config);
     $config = str_replace("\$db['default']['database'] = ''", "\$db['default']['database'] = '" . addslashes($post["db_name"]) . "'", $config);
     $config = str_replace("\$db['default']['dbprefix'] = 'fs_'", "\$db['default']['dbprefix'] = '" . addslashes($post["db_prefix"]) . "'", $config);
     // create a random string of 20 letters and numbers for the encryption key
     $random_string = random_string(20);
     $this->config->set_item('encryption_key', $random_string);
     $config = str_replace("\$config['encryption_key'] = ''", "\$config['encryption_key'] = '" . addslashes($random_string) . "'", $config);
     // check if a manual config file must be made manually (due to no permissions on FoOlSlide root)
     $manual_config = FALSE;
     if (!write_file('config.php', $config)) {
         $manual_config = TRUE;
     }
     // load the necessary libraries
     // migrate to latest database
     $this->load->library('migration');
     $this->migration->latest();
     // load everything needed for a normal startup
     $this->load->library('session');
     $this->load->library('tank_auth');
     $this->load->library('datamapper');
     // load the settings from the now filled database
     load_settings();
     $user = $this->tank_auth->create_user($post["username"], $post["email"], $post["password"], FALSE);
     if ($user !== FALSE) {
         $profile = new Profile();
         $profile->where('user_id', $user['user_id'])->get();
         $profile->group_id = 1;
         $profile->save();
     }
     // create the generic dirs that you can find in content folder
     if (!is_dir('content/ads')) {
         mkdir('content/ads');
     }
     if (!is_dir('content/cache')) {
         mkdir('content/cache');
     }
     if (!is_dir('content/logs')) {
         mkdir('content/logs');
     }
     if (!is_dir('content/comics')) {
         mkdir('content/comics');
     }
     // if install can't make that config.php file, tell the user to do it manually
     if ($manual_config) {
         $this->notices = array();
         $data["config"] = $config;
         $this->viewdata['main_content_view'] = $this->load->view("install/manual_config", $data, TRUE);
         $this->load->view("install/default", $this->viewdata);
         return 'stop';
     }
     // a nice notice to tell that FoOlSlide install was a success
     flash_notice('notice', _('FoOlSlide has installed successfully. Check the preferences and make sure you create a team for your own chapters.'));
     redirect('/admin/');
 }
开发者ID:bonsoirval,项目名称:FoOlSlide,代码行数:99,代码来源:install.php

示例9: microtime

<?php

// part of orsee. see orsee.org
$debug__script_started = microtime();
include "../config/settings.php";
include "../config/system.php";
include "../config/requires.php";
require_once "../utils/general.php";
require_once "../utils/connections.php";
$proceed = true;
if ($proceed) {
    site__database_config();
    $settings = load_settings();
    $settings['style'] = $settings['orsee_public_style'];
    $color = load_colors();
    session_set_save_handler("orsee_session_open", "orsee_session_close", "orsee_session_read", "orsee_session_write", "orsee_session_destroy", "orsee_session_gc");
    session_start();
    $_REQUEST = strip_tags_array($_REQUEST);
}
if ($proceed) {
    if ($settings['stop_public_site'] == "y" && !isset($expadmindata['adminname']) && !(thisdoc() == "disabled.php")) {
        redirect("public/disabled.php");
    }
}
if ($proceed) {
    // with token-only, do not allow access to these pages
    $token_exclude = array("participant_reset_pw.php", "participant_change_pw.php", "participant_login.php", "participant_login_mob.php");
    if ($settings['subject_authentication'] == 'token' && in_array(thisdoc(), $token_exclude)) {
        redirect("public/");
    }
}
开发者ID:kfarr2,项目名称:psu-orsee,代码行数:31,代码来源:header.php

示例10: cid

  revive the comment submission script with ability to reply to a cid (get corresponding sid from mysql)
*/
ini_set("display_errors", "on");
require_once "lib.php";
require_once "lib_mysql.php";
require_once "feeds_lib.php";
define("COMMENTS_CID_FILE", "../data/comments_cid.txt");
define("COMMENTS_TOP_FILE", "../data/comments_top.txt");
define("COMMENTS_FILTERS_FILE", "../data/comments_filters.txt");
define("COMMENTS_TABLE", "sn_comments");
define("MAIN_FEED_CHANNEL", "#comments");
$trailing = trim($argv[1]);
$dest = strtolower(trim($argv[2]));
$nick = strtolower(trim($argv[3]));
$alias = strtolower(trim($argv[4]));
$filters = load_settings(COMMENTS_FILTERS_FILE, " ");
if ($filters == False) {
    $filters = array();
}
if ($alias == "~comments") {
    $parts = explode(" ", $trailing);
    delete_empty_elements($parts);
    if (count($parts) == 0) {
        privmsg("  syntax: ~comments filter-add|filter-delete|filter-list");
        return;
    }
    $action = strtolower($parts[0]);
    array_shift($parts);
    $trailing = trim(implode(" ", $parts));
    switch ($action) {
        case "feed":
开发者ID:cmn32480,项目名称:exec-irc-bot,代码行数:31,代码来源:comment_feed.php

示例11: trim

exec:~!|10|0|0|1|*||||php scripts/link.php %%trailing%% %%dest%% %%nick%% %%alias%%
*/
#####################################################################################################
require_once "lib.php";
# TODO: do something similar to the github feed; output 6 and then make the last item something like "25 more not shown"
$trailing = trim($argv[1]);
$dest = $argv[2];
$nick = $argv[3];
$alias = $argv[4];
if ($trailing == "") {
    privmsg("syntax to search: {$alias} %search%, set: {$alias} %id% %content%, delete: {$alias} %id% -");
    privmsg("can't use pipe (|) char, %id% can't contain spaces, but %content% can, %search% is a regexp pattern");
    privmsg("will return a list of one or more %id% => %content% if %search% matches either %id% or %content%");
    return;
}
$list = load_settings(DATA_PATH . "links", "|");
ksort($list);
$parts = explode(" ", $trailing);
if (count($parts) >= 2) {
    if (count($parts) == 2 and $parts[1] == "-") {
        if (isset($list[$parts[0]]) == True) {
            unset($list[$parts[0]]);
            privmsg("  └─ deleted " . $parts[0]);
        } else {
            privmsg("  └─ " . $parts[0] . " not found");
        }
    } else {
        $id = $parts[0];
        array_shift($parts);
        $content = implode(" ", $parts);
        if (strpos($id, "|") === False and strpos($content, "|") === False) {
开发者ID:cmn32480,项目名称:exec-irc-bot,代码行数:31,代码来源:link.php

示例12: handle_macros

function handle_macros($nick, $channel, $trailing)
{
    $reserved_triggers = array(".macro", ".macro-list");
    $reserved_commands = array("~restart-internal", "~q", "~ps", "~kill", "~killall", "~restart", "~rehash", "~dest-override", "~dest-clear", "~ignore", "~unignore", "~ignore-list", "~buckets-dump", "~eval", "~say", "~bucket", "~buckets-save", "~buckets-load", "~buckets-flush", "~buckets-list", "~exec-conflicts", "~exec-list", "~exec-timers", "~exec-errors", "~op", "~deop", "~voice", "~devoice", "~invite", "~kick", "~topic", "~exec-add", "~exec-del", "~exec-save", "<init>", "<quit>", "<startup>");
    $allowed = array("crutchy", "chromas", "TheMightyBuzzard", "Bytram", "arti", "paulej72", "mrcoolbp", "juggs");
    if ($nick == "" or $channel == "" or $trailing == "") {
        return;
    }
    if ($trailing == ".macro") {
        pm($channel, chr(3) . "02" . "  syntax to add: .macro <trigger> <chanlist> PRIVMSG|INTERNAL <command_template>");
        pm($channel, chr(3) . "02" . "  syntax to delete: .macro <trigger> -");
        #pm($channel,chr(3)."02"."  <chanlist> is comma-separated or * for any");
    }
    $macro_file = DATA_PATH . "exec_macros.txt";
    $macros = load_settings($macro_file, "=");
    if ($macros !== False and $trailing == ".macro-list") {
        foreach ($macros as $trigger => $data) {
            $data = unserialize($data);
            $cmd = "INTERNAL";
            if (isset($data["cmd"]) == True) {
                $cmd = $data["cmd"];
            }
            pm($channel, chr(3) . "13" . "  {$trigger} [" . $data["chanlist"] . "] {$cmd} " . $data["command"]);
        }
    }
    if ($macros === False) {
        $macros = array();
    }
    $parts = explode(" ", $trailing);
    delete_empty_elements($parts);
    if (count($parts) == 0) {
        return;
    }
    if (trim($parts[0]) == ".macro" and count($parts) > 2) {
        $account = users_get_account($nick);
        if (in_array($account, $allowed) == False) {
            return;
        }
        $trigger = trim($parts[1]);
        if (in_array($trigger, $reserved_triggers) == True) {
            privmsg(chr(3) . "02" . "  *** macro with trigger \"{$trigger}\" not permitted");
            return;
        }
        if (in_array($trigger, $reserved_commands) == True) {
            privmsg(chr(3) . "02" . "  *** macro with trigger \"{$trigger}\" not permitted");
            return;
        }
        $exec_list = unserialize(base64_decode(trim(get_bucket("<<EXEC_LIST>>"))));
        if (isset($exec_list[$trigger]) == True) {
            privmsg(chr(3) . "02" . "  *** error: macro with trigger that is the same as existing alias is not permitted");
            return;
        }
        $chanlist = trim($parts[2]);
        if ($chanlist == "-") {
            unset($macros[$trigger]);
            privmsg(chr(3) . "02" . "  *** macro with trigger \"{$trigger}\" deleted");
        } elseif (count($parts) >= 5) {
            array_shift($parts);
            array_shift($parts);
            array_shift($parts);
            $cmd = strtoupper(trim($parts[0]));
            if ($cmd != "PRIVMSG" and $cmd != "INTERNAL") {
                privmsg(chr(3) . "02" . "  *** error: invalid cmd (must be either INTERNAL or PRIVMSG)");
                return;
            }
            array_shift($parts);
            if (isset($macros[$parts[0]]) == True) {
                privmsg(chr(3) . "02" . "  *** error: triggering other macros is not permitted");
                return;
            }
            $command = implode(" ", $parts);
            for ($i = 0; $i < count($reserved_commands); $i++) {
                if (strtolower(substr($command, 0, strlen($reserved_commands[$i]))) == strtolower($reserved_commands[$i])) {
                    privmsg(chr(3) . "02" . "  *** macro with command \"{$command}\" not permitted");
                    return;
                }
            }
            $data = array();
            $data["chanlist"] = $chanlist;
            $data["command"] = $command;
            $data["cmd"] = $cmd;
            $macros[$trigger] = serialize($data);
            privmsg(chr(3) . "02" . "  *** macro with trigger \"{$trigger}\" and {$cmd} command template \"{$command}\" saved");
        }
        save_settings($macros, $macro_file, "=");
    } else {
        foreach ($macros as $trigger => $data) {
            if (trim($parts[0]) == $trigger) {
                $data = unserialize($data);
                if ($data["chanlist"] == "*" or in_array(strtolower($channel), explode(",", strtolower($data["chanlist"]))) == True) {
                    $account = users_get_account($nick);
                    if ($account != "") {
                        $cmd = "INTERNAL";
                        if (isset($data["cmd"]) == True) {
                            $cmd = $data["cmd"];
                        }
                        $trailing = trim(substr($trailing, strlen($trigger)));
                        # TODO: MAKE MORE TRAILING PARSING REPLACE ARGS
                        $command = str_replace("%%channel%%", $channel, $data["command"]);
                        $command = str_replace("%%nick%%", $nick, $command);
//.........这里部分代码省略.........
开发者ID:cmn32480,项目名称:exec-irc-bot,代码行数:101,代码来源:cmd.php

示例13: change_settings

function change_settings($sender, $new_color)
{
    change_settings_from_db($sender, $new_color);
    load_settings($sender);
}
开发者ID:R1413,项目名称:CryptoGear,代码行数:5,代码来源:profile_info.php

示例14: save_settings

/**
 * Save Settings
 *
 * Save the application settings to the database
 *
 * @param array $conf Configuration data
 */
function save_settings($conf)
{
    update_setting("company_name", $conf['company']['name']);
    update_setting("company_email", $conf['company']['email']);
    update_setting("company_notification_email", $conf['company']['notification_email']);
    update_setting("order_confirmation_subject", $conf['order']['confirmation_subject']);
    update_setting("order_confirmation_email", $conf['order']['confirmation_email']);
    update_setting("order_notification_subject", $conf['order']['notification_subject']);
    update_setting("order_notification_email", $conf['order']['notification_email']);
    update_setting("welcome_email", $conf['welcome_email']);
    update_setting("welcome_subject", $conf['welcome_subject']);
    update_setting("nameservers_ns1", $conf['dns']['nameservers'][0]);
    update_setting("nameservers_ns2", $conf['dns']['nameservers'][1]);
    update_setting("nameservers_ns3", $conf['dns']['nameservers'][2]);
    update_setting("nameservers_ns4", $conf['dns']['nameservers'][3]);
    update_setting("invoice_text", $conf['invoice_text']);
    update_setting("invoice_subject", $conf['invoice_subject']);
    update_setting("locale_currency_symbol", $conf['locale']['currency_symbol']);
    update_setting("locale_language", $conf['locale']['language']);
    update_setting("payment_gateway_default_module", $conf['payment_gateway']['default_module']);
    update_setting("payment_gateway_order_method", $conf['payment_gateway']['order_method']);
    update_setting("order_title", $conf['order']['title']);
    update_setting("order_accept_checks", $conf['order']['accept_checks'] ? "1" : "0");
    update_setting("order_tos_required", $conf['order']['tos_required'] ? "1" : "0");
    update_setting("order_tos_url", $conf['order']['tos_url']);
    update_setting("theme_manager", $conf['themes']['manager']);
    update_setting("theme_order", $conf['themes']['order']);
    // Reload
    load_settings($conf);
}
开发者ID:carriercomm,项目名称:NeoBill,代码行数:37,代码来源:settings.php

示例15: get_template_directory_uri

            $settings['options_file_url'] = 'http://my.getbowtied.com/api/shopkeeper/theme_options/theme_options.json';
            $settings['theme_logo'] = get_template_directory_uri() . '/backend/img/shopkeeper.png';
            $settings['demo_image'] = get_template_directory_uri() . '/backend/img/demos/shopkeeper/default.png';
            break;
        case 'mr_tailor':
            $settings['theme_docs'] = 'http://support.getbowtied.com/hc/en-us/categories/200103142-Mr-Tailor';
            $settings['release_notes'] = 'http://support.getbowtied.com/hc/en-us/sections/200658372-Updates';
            $settings['purchase'] = 'http://themeforest.net/item/mr-tailor-responsive-woocommerce-theme/7292110?license=regular&open_purchase_for_item_id=7292110&purchasable=source';
            $settings['dummy_data_preview'] = 'http://mr-tailor.getbowtied.com/blank-v2/';
            $settings['demo_xml_file_url'] = 'http://my.getbowtied.com/api/mr_tailor/demos/demo.gz';
            $settings['options_file_url'] = 'http://my.getbowtied.com/api/mr_tailor/theme_options/theme_options.json';
            $settings['theme_logo'] = get_template_directory_uri() . '/backend/img/mr_tailor.png';
            $settings['demo_image'] = get_template_directory_uri() . '/backend/img/demos/mr_tailor/default.png';
            break;
        case 'the_retailer':
            $settings['theme_docs'] = 'http://support.getbowtied.com/hc/en-us/categories/200102021-The-Retailer';
            $settings['release_notes'] = 'http://support.getbowtied.com/hc/en-us/sections/200649072-Updates';
            $settings['purchase'] = 'http://themeforest.net/item/the-retailer-responsive-wordpress-theme/4287447?license=regular&open_purchase_for_item_id=4287447&purchasable=source&ref=getbowtied';
            $settings['dummy_data_preview'] = 'http://import.getbowtied.com/the-retailer-v1.1/';
            $settings['demo_xml_file_url'] = 'http://my.getbowtied.com/api/the_retailer/demos/demo.gz';
            $settings['options_file_url'] = 'http://my.getbowtied.com/api/the_retailer/theme_options/theme_options.txt';
            $settings['theme_logo'] = get_template_directory_uri() . '/backend/img/the_retailer.png';
            $settings['demo_image'] = get_template_directory_uri() . '/backend/img/demos/the_retailer/default.png';
            break;
        default:
            break;
    }
    return $settings;
}
$getbowtied_settings = load_settings(THEME_SLUG);
开发者ID:shwetadubey,项目名称:upfit,代码行数:30,代码来源:settings.php


注:本文中的load_settings函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。