本文整理汇总了PHP中Settings::replace方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::replace方法的具体用法?PHP Settings::replace怎么用?PHP Settings::replace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings::replace方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if (isset($_POST['savebasic'])) {
$sp_search = array('\\\\"', "\\\\'", "'");
$sp_replace = array('&', '"', ''');
$siteurl = $_POST['data']['setting']['site_url'];
if (!empty($siteurl) && substr($siteurl, -1, 1) != '/') {
$siteurl .= "/";
}
$_POST['data']['setting']['site_url'] = $siteurl;
if (isset($_POST['data']['multita'])) {
$_POST['data']['setting']['site_description'] = pb_lang_merge($_POST['data']['multita']);
if (!empty($_POST['data']['setting']['site_description'])) {
$_POST['data']['setting']['site_description'] = str_replace($sp_search, $sp_replace, $_POST['data']['setting']['site_description']);
}
}
if (!empty($_POST['data']['setting'])) {
$updated = $setting->replace($_POST['data']['setting']);
if ($updated) {
$cache->writeCache("setting", "setting");
}
}
if ($updated) {
if (!empty($_POST['data']['setting']['site_url']) && !pb_strcomp($_POST['data']['setting']['site_url'], $absolute_uri)) {
edit_config(array("absolute_uri" => $_POST['data']['setting']['site_url']));
}
flash("success", "setting.php?do=basic");
} else {
flash();
}
}
if (isset($_POST['saveauth'])) {
$updated = $setting->replace($_POST['data']['setting']);
示例2: Pages
require PHPB2B_ROOT . './libraries/page.class.php';
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
uses("service", "typeoption", "setting");
$page = new Pages();
$cache = new Caches();
$setting = new Settings();
$typeoption = new Typeoption();
$service = new Services();
$conditions = null;
$tpl_file = "service";
setvar("Status", $typeoption->get_cache_type("common_status"));
setvar("ServiceTypes", $typeoption->get_cache_type("service_type"));
if (isset($_POST['save_client'])) {
if (!empty($_POST['data']['setting'])) {
$updated = $setting->replace($_POST['data']['setting'], 1);
if ($updated) {
$cache->writeCache("setting", "setting");
flash("success");
}
}
flash();
}
if (isset($_POST['save']) && !empty($_POST['data']['service'])) {
$vals = array();
$vals = $_POST['data']['service'];
$vals['modified'] = $time_stamp;
$result = $service->save($vals, "update", $_POST['id']);
if (!empty($vals['revert_content'])) {
$datas = array("actor" => $adminer_info['last_name'], "action" => L("feed_revert", "tpl"), "do" => L("feed_problem", "tpl"), "subject" => '<a href="index.php?do=service&action=detail&id=' . $_POST['id'] . '">' . $vals['title'] . '</a>');
$sql = "INSERT INTO {$tb_prefix}feeds (type_id,type,member_id,username,data,created,modified,revert_date) VALUE ('1','service'," . $current_adminer_id . ",'" . $adminer_info['last_name'] . "','" . serialize($datas) . "'," . $time_stamp . "," . $time_stamp . "," . $time_stamp . ")";
示例3: Setting
require LIB_PATH . "file.class.php";
uses("setting");
$setting_controller = new Setting();
$setting = new Settings();
$cache = new Caches();
$file = new Files();
$conditions = null;
$tpl_file = "language";
if (isset($_POST['action'])) {
$vals = $datas = array();
foreach ($_POST['data']['item'] as $key => $val) {
$_POST['data']['language'][$val]['img'] = str_replace(array("../", "../../"), "", $_POST['data']['language'][$val]['img']);
$vals[$val] = $_POST['data']['language'][$val];
}
$datas['languages'] = serialize($vals);
$setting->replace($datas);
if (isset($_POST['update_dot'])) {
foreach ($vals as $lang => $lang_var) {
pb_configmake($lang, false);
$cache->lang_dirname = $lang;
$cache->cacheAll();
}
} else {
pb_configmake($app_lang, false);
$cache->updateLanguages();
}
flash("success");
}
$result = $file->getFolders("../languages/");
$items = array();
$installed_languages = array();
示例4: array
* @version $Revision: 2075 $
*/
require "../libraries/common.inc.php";
session_start();
require PHPB2B_ROOT . './libraries/func.sql.php';
require "session_cp.inc.php";
$system_info = array();
uses("setting", "adminnote");
$setting = new Settings();
$adminnote = new Adminnotes();
if (isset($_GET['do'])) {
$do = trim($_GET['do']);
if ($do == "set_update_alert") {
$vals['update_alert_type'] = intval($_GET['type']);
$vals['update_alert_lasttime'] = $time_stamp;
$setting->replace($vals, 1);
die(L("action_successfully"));
}
}
$serverinfo = PHP_VERSION;
$serverinfo .= @ini_get('safe_mode') ? ' Safe Mode' : NULL;
$dbversion = $pdb->GetOne("SELECT VERSION()");
$system_info['PhpVersion'] = $serverinfo;
$system_info["MysqlVersion"] = $dbversion;
$when_to_backup = $_PB_CACHE['setting']['backup_type'];
$system_info["LastBackupTime"] = $_PB_CACHE['setting']['last_backup'];
$system_info['InstallDate'] = df(file_exists(DATA_PATH . 'install.lock') ? filemtime(DATA_PATH . 'install.lock') : $pdb->GetOne("SELECT valued FROM {$tb_prefix}settings WHERE variable='install_dateline'"));
$system_info['last_login'] = !empty($adminer_info['last_login']) ? date("Y-m-d H:i", $adminer_info['last_login']) : L("your_first_login", "tpl");
$system_info['last_ip'] = $adminer_info['last_ip'];
$system_info['safe_mode'] = (bool) ini_get('safe_mode') ? L("correct", "tpl") : L("deny", "tpl");
$system_info['safe_mode_gid'] = (bool) ini_get('safe_mode_gid') ? L("correct", "tpl") : L("deny", "tpl");
示例5: trim
if (isset($_GET['do'])) {
$do = trim($_GET['do']);
if (!empty($_GET['id'])) {
$id = intval($_GET['id']);
}
if ($do == "uninstall" && !empty($id)) {
$templet->del($id);
}
if ($do == "install" && !empty($_GET['entry'])) {
$entry = trim($_GET['entry']);
$templet_controller->install($entry);
flash("tpl_installed_ok", "templet.php?type=" . $_GET['type']);
}
if ($do == "setup" && !empty($_GET['name']) && $pdb->GetRow("SELECT * FROM {$tb_prefix}templets WHERE id=" . $id)) {
$the_theme = trim($_GET['name']);
$setting->replace(array("theme" => $the_theme));
$result = $cache->writeCache("setting", "setting");
if ($result) {
$templet->exchangeDefault($id);
flash("success", "templet.php?type=system");
} else {
flash();
}
}
if ($do == "edit") {
if (!empty($id)) {
setvar("item", $templet->read("*", $id));
}
$user_types = array();
foreach ($_PB_CACHE['membergroup'] as $key => $val) {
$user_types[$key] = $val['name'];
示例6: serialize
if ($type == "user") {
//description for styles column 20120920
$vals['description'] = serialize($_POST['data']['skins']);
}
if (!empty($id)) {
$result = $templet->save($vals, "update", $id);
if (isset($_POST['data']['templet']['is_default']) && $_POST['data']['templet']['is_default'] == 1) {
$pdb->Execute("UPDATE {$tb_prefix}templets SET is_default='0' WHERE type='" . $type . "'");
$pdb->Execute("UPDATE {$tb_prefix}templets SET is_default='1' WHERE id='" . $_POST['id'] . "'");
}
} else {
$result = $templet->save($vals);
}
if (!empty($_POST['data']['site_style'])) {
$the_style = trim($_POST['data']['site_style']);
$setting->replace(array("site_style" => $the_style));
$site_theme_styles = $templet_controller->getStyle();
$setting->replace(array("site_theme_styles" => serialize($site_theme_styles)));
// $setting->replace(array("site_theme_styles"=>serialize($_POST['data']['site_theme_styles'])));
$result = $cache->writeCache("setting", "setting");
}
if (!$result) {
flash();
} else {
flash("success", "templet.php?type=" . $_POST['type']);
}
}
if (isset($_GET['do'])) {
$do = trim($_GET['do']);
if (!empty($_GET['id'])) {
$id = intval($_GET['id']);