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


PHP load_global_settings函数代码示例

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


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

示例1: ws_init

function ws_init()
{
    global $admin_can_add_user, $admin_can_delete_user, $site_extras, $user_inc;
    // Load include files.
    define('__WC_BASEDIR', '..');
    // Points to the base WebCalendar directory
    // relative to current working directory.
    define('__WC_INCLUDEDIR', '../includes');
    include_once __WC_INCLUDEDIR . '/translate.php';
    require_once __WC_INCLUDEDIR . '/classes/WebCalendar.class';
    require_once __WC_INCLUDEDIR . '/classes/Event.class';
    require_once __WC_INCLUDEDIR . '/classes/RptEvent.class';
    $WebCalendar =& new WebCalendar(__FILE__);
    include_once __WC_INCLUDEDIR . '/config.php';
    include_once __WC_INCLUDEDIR . '/dbi4php.php';
    include_once __WC_INCLUDEDIR . '/access.php';
    include_once __WC_INCLUDEDIR . '/functions.php';
    $WebCalendar->initializeFirstPhase();
    include_once __WC_INCLUDEDIR . '/' . $user_inc;
    include_once __WC_INCLUDEDIR . '/validate.php';
    include_once __WC_INCLUDEDIR . '/site_extras.php';
    $WebCalendar->initializeSecondPhase();
    load_global_settings();
    load_user_preferences();
    $WebCalendar->setLanguage();
}
开发者ID:rhertzog,项目名称:lcs,代码行数:26,代码来源:ws.php

示例2: preg_match

    $self = $PHP_SELF;
}
preg_match("/\\/(\\w+\\.php)/", $self, $match);
$SCRIPT = $match[1];
// Several files need a no-cache header and some of the same code
$special = array('month.php', 'day.php', 'week.php', 'week_details.php', 'year.php');
$DMW = in_array($SCRIPT, $special);
// Unset some variables that shouldn't be set
unset($user_inc);
include_once 'includes/config.php';
include_once 'includes/php-dbi.php';
include_once 'includes/functions.php';
include_once "includes/{$user_inc}";
include_once 'includes/validate.php';
include_once 'includes/connect.php';
load_global_settings();
if (empty($ovrd)) {
    load_user_preferences();
}
include_once 'includes/translate.php';
// error-check some commonly used form variable names
$id = getValue("id", "[0-9]+", true);
$user = getValue("user", "[A-Za-z0-9_\\.=@,\\-]*", true);
$date = getValue("date", "[0-9]+");
$year = getValue("year", "[0-9]+");
$month = getValue("month", "[0-9]+");
$hour = getValue("hour", "[0-9]+");
$minute = getValue("minute", "[0-9]+");
$cat_id = getValue("cat_id", "[0-9]+");
$friendly = getValue("friendly", "[01]");
if (empty($public_access)) {
开发者ID:neymanna,项目名称:fusionforge,代码行数:31,代码来源:init.php

示例3: save_pref

function save_pref($prefs, $src)
{
    global $error, $my_theme, $prad;
    if (!$prad) {
        global $prefuser;
    }
    $pos = $prad ? 6 : 5;
    while (list($key, $value) = each($prefs)) {
        if ($src == 'post') {
            $prefix = substr($key, 0, $pos);
            $setting = substr($key, $pos);
            if (!$prad && $prefix != 'pref_' || $prad && $key == 'currenttab') {
                continue;
            }
            // .
            // Validate key name.
            // If $prad not true, should start with "pref_"
            // else should start with "admin_",
            // and not include any unusual characters that might be an SQL injection attack.
            if (!$prad && !preg_match('/pref_[A-Za-z0-9_]+$/', $key) || $prad && !preg_match('/admin_[A-Za-z0-9_]+$/', $key)) {
                die_miserable_death(str_replace('XXX', $key, translate('Invalid setting name XXX.')));
            }
        } else {
            $prefix = $prad ? 'admin_' : 'pref_';
            $setting = $key;
        }
        if (strlen($setting) > 0 && $prefix == 'pref_' || $prefix == 'admin_') {
            if ($setting == 'THEME' && $value != 'none') {
                $my_theme = strtolower($value);
            }
            if ($prad) {
                $setting = strtoupper($setting);
                $sql = 'DELETE FROM webcal_config WHERE cal_setting = ?';
                if (!dbi_execute($sql, array($setting))) {
                    $error = db_error(false, $sql);
                    break;
                }
                if (strlen($value) > 0) {
                    $sql = 'INSERT INTO webcal_config ( cal_setting, cal_value ) VALUES ( ?, ? )';
                    if (!dbi_execute($sql, array($setting, $value))) {
                        $error = db_error(false, $sql);
                        break;
                    }
                }
            } else {
                dbi_execute('DELETE FROM webcal_user_pref WHERE cal_login = ?
          AND cal_setting = ?', array($prefuser, $setting));
                if (strlen($value) > 0) {
                    $setting = strtoupper($setting);
                    $sql = 'INSERT INTO webcal_user_pref ( cal_login, cal_setting,
            cal_value ) VALUES ( ?, ?, ? )';
                    if (!dbi_execute($sql, array($prefuser, $setting, $value))) {
                        $error = 'Unable to update preference: ' . dbi_error() . '<br /><br /><span class="bold">SQL:</span>' . $sql;
                        break;
                    }
                }
            }
        }
    }
    // Reload preferences so any CSS changes will take effect.
    load_global_settings();
    load_user_preferences();
}
开发者ID:rhertzog,项目名称:lcs,代码行数:63,代码来源:common_admin_pref.php


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