本文整理汇总了PHP中save_prefs函数的典型用法代码示例。如果您正苦于以下问题:PHP save_prefs函数的具体用法?PHP save_prefs怎么用?PHP save_prefs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了save_prefs函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: e_linkwords
function e_linkwords()
{
global $pref, $admin_log;
/* constructor */
// Do an auto-update on the variable used to hook parsers - so we should only be called once
include_lan(e_PLUGIN . "linkwords/languages/" . e_LANGUAGE . ".php");
$hooks = explode(",", $pref['tohtml_hook']);
if (($key = array_search('linkwords', $hooks)) !== FALSE) {
unset($hooks[$key]);
}
if (count($hooks) == 0) {
unset($pref['tohtml_hook']);
} else {
$pref['tohtml_hook'] = implode(',', $hooks);
}
if (!isset($pref['e_tohtml_list'])) {
$pref['e_tohtml_list'] = array();
}
if (!in_array('linkwords', $pref['e_tohtml_list'])) {
$pref['e_tohtml_list'][] = 'linkwords';
}
save_prefs();
$admin_log->log_event('LINKWD_05', LWLAN_58 . '[!br!]' . $pref['tohtml_hook'], '');
// Log that the update was done
return;
}
示例2: ebattles_configure_save
function ebattles_configure_save()
{
global $gold_obj, $pref, $arcade_obj;
$pref['eb_gold_userclass'] = $_POST['eb_gold_userclass'];
$pref['eb_gold_playmatch'] = $_POST['eb_gold_playmatch'];
save_prefs();
return EB_GOLD_L3;
}
示例3: e_emotefilter
function e_emotefilter()
{
$pref = e107::getPref();
if (!$pref['emotepack']) {
$pref['emotepack'] = "default";
save_prefs();
}
$this->emotes = e107::getConfig("emote")->getPref();
if (!vartrue($this->emotes)) {
return;
}
foreach ($this->emotes as $key => $value) {
$value = trim($value);
if ($value) {
// Only 'activate' emote if there's a substitution string set
$key = preg_replace("#!(\\w{3,}?)\$#si", ".\\1", $key);
// Next two probably to sort out legacy issues - may not be required any more
$key = preg_replace("#_(\\w{3})\$#", ".\\1", $key);
$key = str_replace("!", "_", $key);
$filename = e_IMAGE . "emotes/" . $pref['emotepack'] . "/" . $key;
$fileloc = SITEURLBASE . e_IMAGE_ABS . "emotes/" . $pref['emotepack'] . "/" . $key;
if (file_exists($filename)) {
if (strstr($value, " ")) {
$tmp = explode(" ", $value);
foreach ($tmp as $code) {
$this->search[] = " " . $code;
$this->search[] = "\n" . $code;
//TODO CSS class?
$this->replace[] = " <img src='" . $fileloc . "' alt='' style='vertical-align:middle; border:0' /> ";
$this->replace[] = "\n <img src='" . $fileloc . "' alt='' style='vertical-align:middle; border:0' /> ";
}
unset($tmp);
} else {
if ($value) {
$this->search[] = " " . $value;
$this->search[] = "\n" . $value;
//TODO CSS class?
$this->replace[] = " <img src='" . $filename . "' alt='' style='vertical-align:middle; border:0' /> ";
$this->replace[] = "\n <img src='" . $filename . "' alt='' style='vertical-align:middle; border:0' /> ";
}
}
}
} else {
unset($this->emotes[$key]);
}
}
}
示例4: __construct
function __construct()
{
e107::js('core', 'zrssfeed/jquery.zrssfeed.min.js');
// http://www.zazar.net/developers/jquery/zrssfeed/
$code = "\n\t\t\n\t\t\n\t\tjQuery(function(\$){\n\t\t \$('#e-adminfeed').rssfeed('" . ADMINFEED . "', {\n \t\tlimit: 3,\n \t\theader: false,\n \t\tlinktarget: '_blank'\n \t\t\t});\n\t\t});\n";
global $user_pref;
// quick fix.
$pref = e107::getPref();
e107::js('inline', $code, 'jquery');
if (isset($_POST['submit-mye107']) || varset($_POST['submit-mymenus'])) {
$user_pref['core-infopanel-mye107'] = $_POST['e-mye107'];
save_prefs('user');
$pref['core-infopanel-menus'] = $_POST['e-mymenus'];
save_prefs();
}
// $array_functions_assoc = e107::getNav()->adminLinks('assoc');
// $this->iconlist = array_merge($array_functions_assoc, e107::getNav()->pluginLinks(E_16_PLUGMANAGER, "array"));
$this->iconlist = e107::getNav()->adminLinks();
}
示例5: logPrefChanges
function logPrefChanges(&$prefList, $logRef)
{
global $pref, $tp, $admin_log;
$prefChanges = array();
foreach ($prefList as $prefName => $process) {
switch ($process) {
case 0:
$temp = varset($_POST[$prefName], '');
break;
case 1:
$temp = intval(varset($_POST[$prefName], 0));
break;
case 2:
$temp = $tp->toDB(varset($_POST[$prefName], ''));
break;
case 3:
// Array of integers - turn into comma-separated string
$tmp = array();
foreach ($_POST[$prefName] as $v) {
$tmp[] = intval($v);
}
$temp = implode(",", $tmp);
unset($tmp);
break;
}
if (!isset($pref[$prefName]) || $temp != $pref[$prefName]) {
// Change to process
$pref[$prefName] = $temp;
$prefChanges[] = $prefName . ' => ' . $temp;
}
}
if (count($prefChanges)) {
save_prefs();
// Do admin logging
$logString = implode('[!br!]', $prefChanges);
$admin_log->log_event($logRef, $logString, '');
}
}
示例6: update
function update()
{
global $sql, $pref, $tp, $eArrayStorage, $admin_log;
$this->changeList = array();
foreach ($_POST['event'] as $key => $value) {
if ($this->update_event($key)) {
$active = TRUE;
}
}
if ($active) {
$pref['notify'] = TRUE;
} else {
$pref['notify'] = FALSE;
}
save_prefs();
$s_prefs = $tp->toDB($this->notify_prefs);
$s_prefs = $eArrayStorage->WriteArray($s_prefs);
if ($sql->db_Update("core", "e107_value='" . $s_prefs . "' WHERE e107_name='notify_prefs'") !== FALSE) {
$admin_log->logArrayAll('NOTIFY_01', $this->changeList);
return TRUE;
} else {
return FALSE;
}
}
示例7: saveSettings
function saveSettings()
{
global $admin_log, $pref;
$tp = e107::getParser();
$temp = array();
$temp['download_php'] = $_POST['download_php'];
$temp['download_view'] = $_POST['download_view'];
$temp['download_sort'] = $_POST['download_sort'];
$temp['download_order'] = $_POST['download_order'];
$temp['mirror_order'] = $_POST['mirror_order'];
$temp['recent_download_days'] = $_POST['recent_download_days'];
$temp['agree_flag'] = $_POST['agree_flag'];
$temp['download_email'] = $_POST['download_email'];
$temp['agree_text'] = $tp->toDB($_POST['agree_text']);
$temp['download_denied'] = $tp->toDB($_POST['download_denied']);
$temp['download_reportbroken'] = $_POST['download_reportbroken'];
if ($_POST['download_subsub']) {
$temp['download_subsub'] = '1';
} else {
$temp['download_subsub'] = '0';
}
if ($_POST['download_incinfo']) {
$temp['download_incinfo'] = '1';
} else {
$temp['download_incinfo'] = '0';
}
if ($admin_log->logArrayDiffs($temp, $pref, 'DOWNL_01')) {
save_prefs();
// e107::getMessage()->add(DOWLAN_65);
} else {
// e107::getMessage()->add(DOWLAN_8);
}
}
示例8: users
function users()
{
// Any changed need to be duplicated in /usersettings.php (end of the script)
$var = array();
$var['main']['text'] = LAN_USER_LIST;
$var['main']['link'] = e_ADMIN . 'users.php';
$var['main']['perm'] = '4|U0|U1';
$var['create']['text'] = LAN_USER_QUICKADD;
$var['create']['link'] = e_ADMIN . 'users.php?action=create';
$var['create']['perm'] = '4|U0|U1';
$var['prune']['text'] = LAN_USER_PRUNE;
$var['prune']['link'] = e_ADMIN . 'users.php?action=prune';
// Will be moved to "Schedule tasks"
$var['prune']['perm'] = '4';
$var['options']['text'] = LAN_OPTIONS;
$var['options']['link'] = e_ADMIN . 'users.php?action=options';
$var['options']['perm'] = '4|U2';
$var['ranks']['text'] = LAN_USER_RANKS;
$var['ranks']['link'] = e_ADMIN . 'users.php?action=ranks';
$var['ranks']['perm'] = '4|U3';
// if ($unverified) // No longer needed - done with 'filter'.
// {
// $var ['unveri']['text'] = USRLAN_138." ($unverified)";
// $var ['unveri']['link'] = e_ADMIN.'users.php?unverified';
// }
$this->menuOptions = $var;
global $pref, $user_pref, $sql, $tp;
if (isset($pref['admin_user_disp'])) {
$user_pref['admin_users_columns'] = $pref['admin_user_disp'] ? explode("|", $pref['admin_user_disp']) : array('user_status', 'user_name', 'user_class');
save_prefs('user');
unset($pref['admin_user_disp']);
save_prefs();
}
// $this->usersSaveColumnPref();
$this->fieldpref = !$user_pref['admin_users_columns'] ? array('user_name', 'user_class') : $user_pref['admin_users_columns'];
/* if (e_QUERY)
{
$tmp = explode('.', e_QUERY);
$action = $tmp[0]; // main
$sub_action = varset($tmp[1],'');
$id = varset($tmp[2],0);
$from = varset($tmp[3],0);
unset($tmp);
}*/
global $sub_action, $id, $from;
if ($from) {
$this->sortfield = $sub_action;
$this->sortorder = $id;
$this->sortorderrev = $this->sortorder == 'asc' ? 'desc' : 'asc';
$this->from = $from;
}
$this->fields = array('checkboxes' => array('title' => '', 'width' => '3%', 'forced' => true, 'thclass' => 'center first'), 'user_id' => array('title' => 'Id', 'width' => '5%', 'forced' => true), 'user_status' => array('title' => LAN_STATUS, 'width' => 'auto', 'nosort' => TRUE), 'user_name' => array('title' => LAN_USER_01, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first'), 'user_loginname' => array('title' => LAN_USER_02, 'type' => 'text', 'width' => 'auto'), 'user_login' => array('title' => LAN_USER_03, 'type' => 'text', 'width' => 'auto'), 'user_customtitle' => array('title' => LAN_USER_04, 'type' => 'text', 'width' => 'auto'), 'user_password' => array('title' => LAN_USER_05, 'type' => 'text', 'width' => 'auto'), 'user_sess' => array('title' => LAN_USER_06, 'type' => 'text', 'width' => 'auto'), 'user_image' => array('title' => LAN_USER_07, 'type' => 'text', 'width' => 'auto'), 'user_email' => array('title' => LAN_USER_08, 'type' => 'text', 'width' => 'auto'), 'user_signature' => array('title' => LAN_USER_09, 'type' => 'text', 'width' => 'auto'), 'user_hideemail' => array('title' => LAN_USER_10, 'type' => 'boolean', 'width' => 'auto'), 'user_xup' => array('title' => LAN_USER_11, 'type' => 'text', 'width' => 'auto'), 'user_class' => array('title' => LAN_USER_12, 'type' => 'class'), 'user_join' => array('title' => LAN_USER_14, 'type' => 'date', 'width' => 'auto'), 'user_lastvisit' => array('title' => LAN_USER_15, 'type' => 'date', 'width' => 'auto'), 'user_currentvisit' => array('title' => LAN_USER_16, 'type' => 'date', 'width' => 'auto'), 'user_comments' => array('title' => LAN_USER_17, 'width' => 'auto'), 'user_lastpost' => array('title' => 'Last Post', 'type' => 'date', 'width' => 'auto'), 'user_ip' => array('title' => LAN_USER_18, 'width' => 'auto'), 'user_ban' => array('title' => LAN_USER_19, 'type' => 'boolean', 'width' => 'auto'), 'user_prefs' => array('title' => LAN_USER_20, 'width' => 'auto'), 'user_visits' => array('title' => LAN_USER_21, 'width' => 'auto', 'thclass' => 'right'), 'user_admin' => array('title' => LAN_USER_22, 'type' => 'boolean', 'width' => 'auto', 'thclass' => 'center'), 'user_perms' => array('title' => LAN_USER_23, 'width' => 'auto'), 'user_pwchange' => array('title' => LAN_USER_24, 'width' => 'auto'));
if ($sql->db_Select('user_extended_struct', 'user_extended_struct_name', "user_extended_struct_type > 0 AND user_extended_struct_text != '_system_' ORDER BY user_extended_struct_parent ASC")) {
while ($row = $sql->db_Fetch()) {
$field = "user_" . $row['user_extended_struct_name'];
$title = ucfirst(str_replace("user_", "", $field));
$this->fields[$field] = array('title' => $title, 'width' => 'auto');
}
}
$this->fields['options'] = array('title' => LAN_OPTIONS, 'width' => '10%', "thclass" => "center last", 'forced' => true);
if (!getperms('4|U0')) {
unset($this->fields['checkboxes']);
unset($this->fields['options']);
$this->fieldpref = array('user_name', 'user_loginname', 'user_login', 'user_email', 'user_class', 'user_ban', 'user_admin');
}
// print_a($this->fields);
}
示例9: updateSettings
function updateSettings()
{
global $pref, $admin_log, $tp;
$mes = e107::getMessage();
$tmp = array();
$tmp['image_post'] = intval($_POST['image_post']);
$tmp['resize_method'] = $tp->toDB($_POST['resize_method']);
$tmp['im_path'] = trim($tp->toDB($_POST['im_path']));
$tmp['image_post_class'] = intval($_POST['image_post_class']);
$tmp['image_post_disabled_method'] = intval($_POST['image_post_disabled_method']);
$tmp['enable_png_image_fix'] = intval($_POST['enable_png_image_fix']);
if ($_POST['img_import_resize_w'] && $_POST['img_import_resize_h']) {
$tmp['img_import_resize'] = intval($_POST['img_import_resize_w']) . "x" . intval($_POST['img_import_resize_h']);
}
if ($admin_log->logArrayDiffs($tmp, $pref, 'IMALAN_04')) {
save_prefs();
// Only save if changes
$mes->add(IMALAN_9, E_MESSAGE_SUCCESS);
} else {
$mes->add(IMALAN_20, E_MESSAGE_INFO);
}
}
示例10: saveMailPrefs
function saveMailPrefs(&$emessage)
{
global $pref;
$e107 = e107::getInstance();
$bounceOpts = array('none' => LAN_MAILOUT_232, 'auto' => LAN_MAILOUT_233, 'mail' => LAN_MAILOUT_234);
unset($temp);
if (!in_array($_POST['mailer'], array('smtp', 'sendmail', 'php'))) {
$_POST['mailer'] = 'php';
}
$temp['mailer'] = $_POST['mailer'];
// Allow qmail as an option as well - works much as sendmail
if (strpos($_POST['sendmail'], 'sendmail') !== FALSE || strpos($_POST['sendmail'], 'qmail') !== FALSE) {
$temp['sendmail'] = $e107->tp->toDB($_POST['sendmail']);
}
$temp['smtp_server'] = $e107->tp->toDB($_POST['smtp_server']);
$temp['smtp_username'] = $e107->tp->toDB($_POST['smtp_username']);
$temp['smtp_password'] = $e107->tp->toDB($_POST['smtp_password']);
$smtp_opts = array();
switch (trim($_POST['smtp_options'])) {
case 'smtp_ssl':
$smtp_opts[] = 'secure=SSL';
break;
case 'smtp_tls':
$smtp_opts[] = 'secure=TLS';
break;
case 'smtp_pop3auth':
$smtp_opts[] = 'pop3auth';
break;
}
if (varsettrue($_POST['smtp_keepalive'])) {
$smtp_opts[] = 'keepalive';
}
if (varsettrue($_POST['smtp_useVERP'])) {
$smtp_opts[] = 'useVERP';
}
$temp['smtp_options'] = implode(',', $smtp_opts);
$temp['mail_sendstyle'] = $e107->tp->toDB($_POST['mail_sendstyle']);
$temp['mail_pause'] = intval($_POST['mail_pause']);
$temp['mail_pausetime'] = intval($_POST['mail_pausetime']);
$temp['mail_workpertick'] = intval($_POST['mail_workpertick']);
$temp['mail_workpertick'] = min($temp['mail_workpertick'], 1000);
$temp['mail_bounce'] = isset($bounceOpts[$_POST['mail_bounce']]) ? $_POST['mail_bounce'] : 'none';
$temp['mail_bounce_auto'] = 0;
// Make sure this is always defined
switch ($temp['mail_bounce']) {
case 'none':
$temp['mail_bounce_email'] = '';
break;
case 'auto':
$temp['mail_bounce_email'] = $e107->tp->toDB($_POST['mail_bounce_email2']);
break;
case 'mail':
$temp['mail_bounce_email'] = $e107->tp->toDB($_POST['mail_bounce_email']);
$temp['mail_bounce_auto'] = intval($_POST['mail_bounce_auto']);
break;
}
$temp['mail_bounce_pop3'] = $e107->tp->toDB($_POST['mail_bounce_pop3']);
$temp['mail_bounce_user'] = $e107->tp->toDB($_POST['mail_bounce_user']);
$temp['mail_bounce_pass'] = $e107->tp->toDB($_POST['mail_bounce_pass']);
$temp['mail_bounce_type'] = $e107->tp->toDB($_POST['mail_bounce_type']);
$temp['mail_bounce_delete'] = intval(varset($_POST['mail_bounce_delete'], 0));
$temp['mailout_enabled'] = implode(',', varset($_POST['mail_mailer_enabled'], ''));
$temp['mail_log_options'] = intval($_POST['mail_log_option']) . ',' . intval($_POST['mail_log_email']);
if ($e107->admin_log->logArrayDiffs($temp, $pref, 'MAIL_03')) {
save_prefs();
// Only save if changes - generates its own message
// $emessage->add(LAN_SETSAVED, E_MESSAGE_SUCCESS);
} else {
$emessage->add(LAN_NO_CHANGE, E_MESSAGE_INFO);
}
}
示例11: foreach
$one_pack = FALSE;
// Check for pack-related buttons pressed
foreach ($_POST as $key => $value) {
if (strstr($key, "subPack_")) {
$subpack = str_replace("subPack_", "", $key);
$emote->emoteConf($subpack);
break;
}
if (strstr($key, "XMLPack_")) {
$subpack = str_replace("XMLPack_", "", $key);
$emote->emoteXML($subpack);
break;
}
if (strstr($key, "defPack_")) {
$pref['emotepack'] = str_replace("defPack_", "", $key);
if (save_prefs()) {
$mes->addSuccess(LAN_UPDATED);
} else {
$mes->addInfo(LAN_NO_CHANGE);
}
e107::getLog()->add('EMOTE_01', $pref['emotepack'], E_LOG_INFORMATIVE, '');
break;
}
if (strstr($key, "scanPack_")) {
$one_pack = str_replace("scanPack_", "", $key);
break;
}
}
$ns->tablerender($caption, $mes->render() . $text);
$check = TRUE;
//$check = $emote -> installCheck();
示例12: saveSettings
function saveSettings()
{
global $pref, $admin_log, $emessage;
$temp['listPages'] = $_POST['listPages'];
$temp['pageCookieExpire'] = $_POST['pageCookieExpire'];
if ($admin_log->logArrayDiffs($temp, $pref, 'CPAGE_04')) {
save_prefs();
// Only save if changes
$emessage->add(CUSLAN_45, E_MESSAGE_SUCCESS);
} else {
$emessage->add(CUSLAN_46);
}
}
示例13: setAdminTheme
function setAdminTheme()
{
global $pref, $e107cache;
$ns = e107::getRender();
$mes = e107::getMessage();
$themeArray = $this->getThemes("id");
$pref['admintheme'] = $themeArray[$this->id];
$pref['admincss'] = file_exists(e_THEME . $pref['admintheme'] . '/admin_dark.css') ? 'admin_dark.css' : 'admin_light.css';
$e107cache->clear_sys();
if (save_prefs()) {
// Default Message
$mes->add(TPVLAN_40 . " <b>'" . $themeArray[$this->id] . "'</b>", E_MESSAGE_SUCCESS);
$this->theme_adminlog('02', $pref['admintheme'] . ', ' . $pref['admincss']);
}
// $ns->tablerender("Admin Message", "<br /><div style='text-align:center;'>".TPVLAN_40." <b>'".$themeArray[$this -> id]."'</b>.</div><br />");
// $this->showThemes('admin');
}
示例14: menuSetConfigList
function menuSetConfigList()
{
global $sql, $pref;
$sql->db_Select("menus", "*", "menu_location != 0 ORDER BY menu_path,menu_name");
while ($row = $sql->db_Fetch()) {
$link = "";
extract($row);
$id = substr($menu_path, 0, -1);
if (file_exists(e_PLUGIN . "{$menu_path}{$menu_name}_menu_config.php")) {
$link = "{$menu_path}{$menu_name}_menu_config.php";
}
if (file_exists(e_PLUGIN . "{$menu_path}config.php")) {
$link = "{$menu_path}config.php";
}
if ($link) {
$tmp[$id]['name'] = ucwords(str_replace("_menu", "", $menu_name));
if ($prev == $id && $tmp[$id]['name'] != $prev_name) {
$tmp[$id]['name'] .= ":" . $prev_name;
}
$tmp[$id]['link'] = $link;
$prev = $id;
$prev_name = $tmp[$id]['name'];
}
}
$pref['menuconfig_list'] = $tmp;
save_prefs();
}
示例15: menuSetCustomPages
function menuSetCustomPages($array)
{
$pref = e107::getPref();
$key = key($array);
$pref['sitetheme_custompages'][$key] = array_filter(explode(" ", $array[$key]));
save_prefs();
}