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


PHP update_setting函数代码示例

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


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

示例1: update_db

function update_db()
{
    global $C, $F, $I, $db, $memcached;
    $dbversion = (int) get_setting('dbversion');
    if ($dbversion < $C['dbversion'] || get_setting('msgencrypted') != $C['msgencrypted']) {
        if ($dbversion < 2) {
            $db->exec("CREATE TABLE IF NOT EXISTS {$C['prefix']}ignored (id int(10) unsigned NOT NULL AUTO_INCREMENT, ignored tinytext NOT NULL, `by` tinytext NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
        }
        if ($dbversion < 3) {
            $db->exec("INSERT INTO {$C['prefix']}settings (setting, value) VALUES ('rulestxt', '');");
        }
        if ($dbversion < 4) {
            $db->exec("ALTER TABLE {$C['prefix']}members ADD incognito TINYINT(1) UNSIGNED NOT NULL;");
            $db->exec("ALTER TABLE {$C['prefix']}sessions ADD incognito TINYINT(1) UNSIGNED NOT NULL;");
        }
        if ($dbversion < 5) {
            $db->exec("INSERT INTO {$C['prefix']}settings (setting, value) VALUES ('globalpass', '');");
        }
        if ($dbversion < 6) {
            $db->exec("INSERT INTO {$C['prefix']}settings (setting, value) VALUES ('dateformat', 'm-d H:i:s');");
        }
        if ($dbversion < 7) {
            $db->exec("ALTER TABLE {$C['prefix']}captcha ADD code TINYTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");
        }
        if ($dbversion < 8) {
            $db->exec("INSERT INTO {$C['prefix']}settings (setting, value) VALUES ('captcha', '0'), ('englobalpass', '0');");
            $ga = (int) get_setting('guestaccess');
            if ($ga === -1) {
                update_setting('guestaccess', 0);
                update_setting('englobalpass', 1);
            } elseif ($ga === 4) {
                update_setting('guestaccess', 1);
                update_setting('englobalpass', 2);
            }
        }
        if ($dbversion < 9) {
            $db->exec("INSERT INTO {$C['prefix']}settings (setting,value) VALUES ('msgencrypted', '0');");
            $db->exec("ALTER TABLE {$C['prefix']}settings MODIFY value text NOT NULL;");
            $db->exec("ALTER TABLE {$C['prefix']}messages DROP postid;");
        }
        if ($dbversion < 10) {
            $db->exec("INSERT INTO {$C['prefix']}settings (setting, value) VALUES ('css', 'a:visited{color:#B33CB4;} a:active{color:#FF0033;} a:link{color:#0000FF;} input,select,textarea{color:#FFFFFF;background-color:#000000;} a img{width:15%} a:hover img{width:35%} .error{color:#FF0033;} .delbutton{background-color:#660000;} .backbutton{background-color:#004400;} #exitbutton{background-color:#AA0000;}'), ('memberexpire', '60'), ('guestexpire', '15'), ('kickpenalty', '10'), ('entrywait', '120'), ('messageexpire', '14400'), ('messagelimit', '150'), ('maxmessage', 2000), ('captchatime', '600');");
            $db->exec("ALTER TABLE {$C['prefix']}sessions ADD ip tinytext NOT NULL;");
        }
        if ($dbversion < 11) {
            $db->exec("ALTER TABLE {$C['prefix']}captcha CHARACTER SET utf8 COLLATE utf8_bin;");
            $db->exec("ALTER TABLE {$C['prefix']}filter CHARACTER SET utf8 COLLATE utf8_bin;");
            $db->exec("ALTER TABLE {$C['prefix']}ignored CHARACTER SET utf8 COLLATE utf8_bin;");
            $db->exec("ALTER TABLE {$C['prefix']}members CHARACTER SET utf8 COLLATE utf8_bin;");
            $db->exec("ALTER TABLE {$C['prefix']}messages CHARACTER SET utf8 COLLATE utf8_bin;");
            $db->exec("ALTER TABLE {$C['prefix']}notes CHARACTER SET utf8 COLLATE utf8_bin;");
            $db->exec("ALTER TABLE {$C['prefix']}sessions CHARACTER SET utf8 COLLATE utf8_bin;");
            $db->exec("ALTER TABLE {$C['prefix']}settings CHARACTER SET utf8 COLLATE utf8_bin;");
            $db->exec("CREATE TABLE IF NOT EXISTS {$C['prefix']}linkfilter (id int(10) unsigned NOT NULL, `match` tinytext NOT NULL, `replace` tinytext NOT NULL, regex tinyint(1) unsigned NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;");
            $db->exec("ALTER TABLE {$C['prefix']}linkfilter ADD PRIMARY KEY (id), MODIFY id int(10) unsigned NOT NULL AUTO_INCREMENT;");
            $db->exec("ALTER TABLE {$C['prefix']}sessions DROP fontinfo, DROP displayname;");
            $db->exec("ALTER TABLE {$C['prefix']}members ADD style TEXT NOT NULL;");
            $result = $db->query("SELECT * FROM {$C['prefix']}members;");
            $stmt = $db->prepare("UPDATE {$C['prefix']}members SET style=? WHERE id=?;");
            while ($temp = $result->fetch(PDO::FETCH_ASSOC)) {
                if (isset($F[$temp['fontface']])) {
                    $fontface = $F[$temp['fontface']];
                } else {
                    $fontface = '';
                }
                $style = get_style("#{$temp['colour']} {$fontface} <{$temp['fonttags']}>");
                $stmt->execute(array($style, $temp['id']));
            }
            $db->exec("ALTER TABLE {$C['prefix']}members DROP colour, DROP fontface, DROP fonttags;");
            $db->exec("INSERT INTO {$C['prefix']}settings (setting, value) VALUES ('colbg', '000000'), ('coltxt', 'FFFFFF'), ('maxname', '20'), ('minpass', '5'), ('defaultrefresh', '20'), ('dismemcaptcha', '0'), ('suguests', '0'), ('imgembed', '1'), ('timestamps', '1'), ('trackip', '0'), ('captchachars', '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('memkick', '1'), ('forceredirect', '0'), ('redirect', ''), ('incognito', '1');");
        }
        if ($dbversion < 12) {
            $db->exec("ALTER TABLE {$C['prefix']}captcha MODIFY code char(5) NOT NULL, DROP INDEX id, ADD PRIMARY KEY (id) USING BTREE;");
            $db->exec("ALTER TABLE {$C['prefix']}captcha ENGINE=MEMORY;");
            $db->exec("ALTER TABLE {$C['prefix']}filter MODIFY id int(10) unsigned NOT NULL AUTO_INCREMENT, MODIFY `match` varchar(255) NOT NULL, MODIFY replace varchar(20000) NOT NULL;");
            $db->exec("ALTER TABLE {$C['prefix']}ignored MODIFY ignored varchar(50) NOT NULL, MODIFY `by` varchar(50) NOT NULL, ADD INDEX(ignored) USING BTREE, ADD INDEX(`by`) USING BTREE;");
            $db->exec("ALTER TABLE {$C['prefix']}linkfilter MODIFY match varchar(255) NOT NULL, MODIFY replace varchar(255) NOT NULL;");
            $db->exec("ALTER TABLE {$C['prefix']}members MODIFY id int(10) unsigned NOT NULL AUTO_INCREMENT, MODIFY nickname varchar(50) NOT NULL, MODIFY passhash char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, MODIFY bgcolour char(6) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, MODIFY boxwidth tinyint(3) NOT NULL DEFAULT '40', MODIFY boxheight tinyint(3) NOT NULL DEFAULT '3', MODIFY notesboxheight tinyint(3) NOT NULL DEFAULT '30', MODIFY notesboxwidth tinyint(3) NOT NULL DEFAULT '80', MODIFY regedby varchar(50) NOT NULL, MODIFY embed tinyint(1) NOT NULL DEFAULT '1', MODIFY incognito tinyint(1) NOT NULL DEFAULT '0', MODIFY style varchar(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, ADD UNIQUE(nickname) USING BTREE;");
            $db->exec("ALTER TABLE {$C['prefix']}messages MODIFY poster varchar(50) NOT NULL, MODIFY recipient varchar(50) NOT NULL, MODIFY text varchar(20000) NOT NULL, ADD INDEX(poster) USING BTREE, ADD INDEX(recipient) USING BTREE, ADD INDEX(postdate) USING BTREE, ADD INDEX(poststatus) USING BTREE;");
            $db->exec("ALTER TABLE {$C['prefix']}notes MODIFY type char(5) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, MODIFY editedby varchar(50) NOT NULL, MODIFY text varchar(20000) NOT NULL;");
            $db->exec("ALTER TABLE {$C['prefix']}sessions MODIFY session char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, MODIFY nickname varchar(50) NOT NULL, MODIFY style varchar(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, MODIFY passhash char(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, MODIFY postid char(6) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '000000', MODIFY boxwidth tinyint(3) unsigned NOT NULL DEFAULT '40', MODIFY boxheight tinyint(3) unsigned NOT NULL DEFAULT '3', MODIFY notesboxheight tinyint(3) unsigned NOT NULL DEFAULT '30', MODIFY notesboxwidth tinyint(3) unsigned NOT NULL DEFAULT '80', MODIFY bgcolour char(6) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, MODIFY useragent varchar(255) NOT NULL, MODIFY kickmessage varchar(255) NOT NULL, MODIFY embed tinyint(1) unsigned NOT NULL DEFAULT '1', MODIFY incognito tinyint(1) unsigned NOT NULL DEFAULT '0', MODIFY ip varchar(45) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, ADD UNIQUE(session) USING BTREE, ADD UNIQUE(nickname) USING BTREE, ADD INDEX(status) USING BTREE, ADD INDEX(lastpost) USING BTREE;");
            $db->exec("ALTER TABLE {$C['prefix']}sessions ENGINE=MEMORY;");
            $db->exec("ALTER TABLE {$C['prefix']}settings MODIFY id int(10) unsigned NOT NULL, MODIFY setting varchar(50) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, MODIFY value varchar(20000) NOT NULL;");
            $db->exec("ALTER TABLE {$C['prefix']}settings DROP PRIMARY KEY, DROP id, ADD PRIMARY KEY(setting) USING BTREE;");
            $db->exec("INSERT INTO {$C['prefix']}settings (setting, value) VALUES ('enablejs', '0'), ('chatname', 'My Chat'), ('topic', ''), ('msgsendall', '{$I['sendallmsg']}'), ('msgsendmem', '{$I['sendmemmsg']}'), ('msgsendmod', '{$I['sendmodmsg']}'), ('msgsendadm', '{$I['sendadmmsg']}'), ('msgsendprv', '{$I['sendprvmsg']}'), ('numnotes', '3');");
        }
        if ($dbversion < 13) {
            $db->exec("ALTER TABLE {$C['prefix']}filter CHANGE `match` filtermatch varchar(255) NOT NULL, CHANGE `replace` filterreplace varchar(20000) NOT NULL;");
            $db->exec("ALTER TABLE {$C['prefix']}ignored CHANGE ignored ign varchar(50) NOT NULL, CHANGE `by` ignby varchar(50) NOT NULL;");
            $db->exec("ALTER TABLE {$C['prefix']}linkfilter CHANGE `match` filtermatch varchar(255) NOT NULL, CHANGE `replace` filterreplace varchar(255) NOT NULL;");
            $db->exec("ALTER TABLE {$C['prefix']}sessions MODIFY ip varchar(45) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL;");
        }
        if ($dbversion < 14) {
            if ($C['memcached']) {
                $memcached->delete("{$C['dbname']}-{$C['prefix']}members");
                $memcached->delete("{$C['dbname']}-{$C['prefix']}ignored");
            }
            if ($C['dbdriver'] === 0) {
                //MySQL
                $db->exec("CREATE TABLE IF NOT EXISTS {$C['prefix']}captcha (id int(10) unsigned NOT NULL AUTO_INCREMENT, time int(10) unsigned NOT NULL, code char(5) NOT NULL, PRIMARY KEY (id) USING BTREE) ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_bin;");
//.........这里部分代码省略.........
开发者ID:grlong,项目名称:le-chat-php,代码行数:101,代码来源:chat.php

示例2: pass_decode

    $pay['paypal']['keycode'] = pass_decode($pay['paypal']['keycode'], $P['paypal']['keycode']);
    $setting['uc_dbpwd'] = pass_decode($setting['uc_dbpwd'], $MOD['uc_dbpwd']);
    $setting['ex_pass'] = pass_decode($setting['ex_pass'], $MOD['ex_pass']);
    #$setting['sso_auth'] = pass_decode($setting['sso_auth'], $MOD['sso_auth']);
    $setting['edit_check'] = implode(',', $setting['edit_check']);
    foreach ($pay as $k => $v) {
        update_setting('pay-' . $k, $v);
    }
    $setting['oauth'] = 0;
    foreach ($oauth as $k => $v) {
        if ($v['enable']) {
            $setting['oauth'] = 1;
        }
        update_setting('oauth-' . $k, $v);
    }
    update_setting($moduleid, $setting);
    cache_module($moduleid);
    $ext_oauth = $setting['oauth'];
    if ($oauth['sina']['enable'] && $oauth['sina']['sync']) {
        $ext_oauth .= ',sina';
    }
    if ($oauth['qq']['enable'] && $oauth['qq']['sync']) {
        $ext_oauth .= ',qq';
    }
    $db->query("UPDATE {$DT_PRE}setting SET item_value='{$ext_oauth}' WHERE item_key='oauth' AND item='3'");
    cache_module(3);
    dmsg('更新成功', '?moduleid=' . $moduleid . '&file=' . $file . '&tab=' . $tab);
} else {
    extract(dhtmlspecialchars($MOD));
    cache_pay();
    $P = cache_read('pay.php');
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:setting.inc.php

示例3: update_setting

	
				<?
					include("../../koneksi.php");
					
					function update_setting($nama,$isi){
						$simpanSetting = mysql_query("UPDATE setting SET Isi = '$isi' WHERE Nama = '$nama'") or die(mysql_error());
					}
					
				
						if($_POST['namaDesa'] != ""){
							update_setting('Nama Desa', $_POST['namaDesa']);
						}
						if($_POST['subArtikel'] != ""){
							update_setting('Sub Artikel', $_POST['subArtikel']);
						}
						if($_POST['subLaporan'] != ""){
							update_setting('Sub Laporan', $_POST['subLaporan']);
						}
						echo "Data Berhasil Diupdate";
				?>
				  
开发者ID:abu-wafiy,项目名称:SIM-Desa,代码行数:19,代码来源:input.php

示例4: array

     $lists = array();
     $result = $db->query("SELECT * FROM {$DT_PRE}weixin_user WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         $r['gender'] = $SEX[$r['sex']];
         $r['status'] = $SUBSCRIBE[$r['subscribe']];
         $r['headimgurl'] or $r['headimgurl'] = 'api/weixin/image/headimg.jpg';
         $lists[] = $r;
     }
     include tpl('weixin_user', $module);
     break;
 case 'menu':
     if ($submit) {
         require DT_ROOT . '/api/weixin/init.inc.php';
         update_setting('weixin-menu', array('menu' => serialize($post)));
         cache_weixin();
         $menu = $sub = $btn = array();
         for ($i = 0; $i < 3; $i++) {
             $sub[$i] = 0;
             if ($post[$i][1]['name'] && $post[$i][1]['key']) {
                 $sub[$i] = 1;
             }
         }
         for ($i = 0; $i < 3; $i++) {
             if ($post[$i][0]['name']) {
                 $menu[$i]['name'] = urlencode(convert($post[$i][0]['name'], DT_CHARSET, 'UTF-8'));
                 if ($sub[$i]) {
                     for ($j = 1; $j < 6; $j++) {
                         if ($post[$i][$j]['name'] && $post[$i][$j]['key']) {
                             $menu[$i]['sub_button'][$j - 1]['name'] = urlencode(convert($post[$i][$j]['name'], DT_CHARSET, 'UTF-8'));
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:weixin.inc.php

示例5: update_setting

$show_default = true;
?>
<h1>Owned Listings</h1>
<?php 
$action = '';
if (isset($_REQUEST["action"])) {
    $action = $_REQUEST['action'];
}
/*__________________________________________________________________TEMPLATE_*/
if ($action == 'template') {
    $show_default = false;
    $show_template_form = true;
    if (isset($_POST['done'])) {
        $update_header = update_setting('owned_template_header', $_POST['header']);
        $update_template = update_setting('owned_template', $_POST['template']);
        $update_footer = update_setting('owned_template_footer', $_POST['footer']);
        $show_default = true;
        $show_template_form = false;
        echo '<p class="success">Templates successfully updated.</p>';
    }
    if ($show_template_form) {
        $header = get_setting('owned_template_header');
        $template = get_setting('owned_template');
        $footer = get_setting('owned_template_footer');
        $header_help = get_setting_desc('owned_template_header');
        $template_help = get_setting_desc('owned_template');
        $footer_help = get_setting_desc('owned_template_footer');
        ?>
      <p>You can edit the way your owned fanlistings will be shown via the
      templates below. If you need help, click on the 'help' button.</p>
开发者ID:adriculous,项目名称:enthusiast,代码行数:30,代码来源:owned.php

示例6: trim

 // 2-digit year - restart numbers at yr rollover
 $the_inc_num = trim(get_variable('_inc_num'));
 // possibly empty
 if (!(strlen($the_inc_num) > 0)) {
     do_setting('_inc_num', base64_encode(serialize(array("0", "", "", "", "0", $the_year))));
     // insert if absent
     update_setting('_inc_num', base64_encode(serialize(array("0", "", "", "", "0", $the_year))));
     // it's there now, update it
 } else {
     // exists, not-empty
     if (strpos($the_inc_num, $left_br)) {
         // if unencoded - else ignore
         //			snap(__LINE__, $the_inc_num);
         $instr = unserialize(get_variable('_inc_num'));
         $outstr = base64_encode(serialize($the_inc_num));
         update_setting('_inc_num', $outstr);
     }
 }
 $the_table = "{$GLOBALS['mysql_prefix']}codes";
 // 12/15/10
 if (!mysql_table_exists($the_table)) {
     $query = "CREATE TABLE `{$the_table}` (\n\t\t\t  `id` int(7) NOT NULL AUTO_INCREMENT,\n\t\t\t  `code` varchar(20) NOT NULL,\n\t\t\t  `text` varchar(64) NOT NULL,\n\t\t\t  `sort` int(3) NOT NULL DEFAULT '999',\n\t\t\t  `_by` int(7) NOT NULL DEFAULT 0,\n\t\t\t  `_from` varchar(16) NOT NULL DEFAULT '',\n\t\t\t  `_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\t\t  PRIMARY KEY (`id`)\n\t\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_unicode_ci;";
     $result = mysql_query($query) or do_error("", 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
     // 3/12/10
     $query = "INSERT INTO `{$the_table}` (`code`, `text`, `sort`) VALUES\n\t\t\t\t('ex-1', 'Instructed to return to station ASAP', 999),\n\t\t\t\t('ex-2', 'Requested to contact Dispatch Central by voice', 999);";
     $result = mysql_query($query) or do_error("", 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
     // 3/12/10
 }
 $the_table = "{$GLOBALS['mysql_prefix']}hints";
 // 11/30/10
 if (!mysql_table_exists($the_table)) {
开发者ID:sharedgeo,项目名称:TicketsCAD-SharedGeo-Dev,代码行数:31,代码来源:index.php

示例7: edit

 function edit($setting)
 {
     if (!is_array($setting)) {
         return false;
     }
     update_setting('group-' . $this->groupid, $setting);
     $setting = addslashes(serialize(dstripslashes($setting)));
     $this->db->query("UPDATE {$this->table} SET groupname='{$this->groupname}',vip='{$this->vip}',listorder='{$this->listorder}' WHERE groupid={$this->groupid}");
     cache_group();
     return true;
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:11,代码来源:group.inc.php

示例8: admincp_master

function admincp_master()
{
    global $X7CHATVERSION, $x7p, $x7s, $print, $db, $txt, $x7c, $prefix, $X7CHAT_CONFIG, $g_default_settings;
    $head = $txt[37];
    $body = "<h2 style=\"text-align: center;\">Pannello di amministrazione</h2>";
    // Set these so it doesn't complain, all admins have access to these pages
    $x7c->permissions["admin_main"] = 1;
    $x7c->permissions["admin_news"] = 1;
    $x7c->permissions["admin_help"] = 1;
    // Look for the CP page we are on, if not set then make it main
    if (!isset($_GET['cp_page'])) {
        $_GET['cp_page'] = "main";
    }
    // Check permissions
    $check_page = $_GET['cp_page'];
    if ($check_page == "groupmanager") {
        $check_page = "groups";
    }
    if ($x7c->permissions["admin_{$check_page}"] == 0) {
        $_GET['cp_page'] = "ad2";
    }
    if ($x7c->permissions['admin_access'] == 0) {
        $_GET['cp_page'] = "ad";
    }
    // Figure out which page this is
    if ($_GET['cp_page'] == "settings") {
        $head = $txt[139];
        if (isset($_GET['update_settings'])) {
            // Update the settings for some section
            $txt[343] = eregi_replace("<a>", "<a href=\"./index.php?act=adminpanel&cp_page=settings\">", $txt[343]);
            if ($_GET['settings_page'] == "general") {
                // Update the settings page for the general settings
                // Check for unset values (this is a bug in some browers)
                if (!isset($_POST['disable_chat'])) {
                    $_POST['disable_chat'] = 0;
                }
                if (!isset($_POST['allow_reg'])) {
                    $_POST['allow_reg'] = 0;
                }
                if (!isset($_POST['allow_guests'])) {
                    $_POST['allow_guests'] = 0;
                }
                if (!isset($_POST['disable_sounds'])) {
                    $_POST['disable_sounds'] = 0;
                }
                if (!isset($_POST['log_bandwidth'])) {
                    $_POST['log_bandwidth'] = 0;
                }
                if (!isset($_POST['req_activation'])) {
                    $_POST['req_activation'] = 0;
                }
                // Preparse these to cuz we need to convert seconds to miliseconds
                $_POST['min_refresh'] = $_POST['min_refresh'] * 1000;
                $_POST['max_refresh'] = $_POST['max_refresh'] * 1000;
                // Check for problems with the submitted data
                if ($_POST['min_refresh'] > $_POST['max_refresh']) {
                    $error = $txt[344];
                }
                if (!isset($error)) {
                    // Do the actual updates right now, when I say now I mean NOW
                    // Yes this section wrecks hell on your MySql server but hopefully you don't need to update your settings to often
                    update_setting("disable_chat", $_POST['disable_chat']);
                    update_setting("allow_reg", $_POST['allow_reg']);
                    update_setting("allow_guests", $_POST['allow_guests']);
                    update_setting("disable_sounds", $_POST['disable_sounds']);
                    update_setting("site_name", $_POST['site_name']);
                    update_setting("admin_email", $_POST['admin_email']);
                    update_setting("logout_page", $_POST['logout_page']);
                    update_setting("default_lang", $_POST['default_lang']);
                    update_setting("default_skin", $_POST['default_skin']);
                    update_setting("maxchars_status", $_POST['maxchars_status']);
                    update_setting("maxchars_msg", $_POST['maxchars_msg']);
                    update_setting("max_offline_msgs", $_POST['max_offline_msgs']);
                    update_setting("min_refresh", $_POST['min_refresh']);
                    update_setting("max_refresh", $_POST['max_refresh']);
                    update_setting("cookie_time", $_POST['cookie_time']);
                    update_setting("log_bandwidth", $_POST['log_bandwidth']);
                    update_setting("maxchars_username", $_POST['maxchars_username']);
                    update_setting("banner_link", $_POST['banner_link']);
                    update_setting("single_room_mode", $_POST['single_room_mode']);
                    update_setting("req_activation", $_POST['req_activation']);
                    // Check activation stuff
                    if ($_POST['req_activation'] == 0) {
                        // Update existing accounts so they do not require activation
                        $db->doQuery("UPDATE {$prefix}users SET activated='1'");
                    }
                    $body = $txt[343];
                } else {
                    $body = $error . "<Br><Br><div align=\"center\"><a href=\"javascript: history.back()\">{$txt['77']}</a></div>";
                }
            } elseif ($_GET['settings_page'] == "logs") {
                // Convert these values from Kilobytes to bytes
                $_POST['max_log_user'] *= 1024;
                $_POST['max_log_room'] *= 1024;
                if (!isset($_POST['enable_logging'])) {
                    $_POST['enable_logging'] = 0;
                }
                // Update the settings
                update_setting("max_log_user", $_POST['max_log_user']);
                update_setting("max_log_room", $_POST['max_log_room']);
//.........这里部分代码省略.........
开发者ID:EZDM,项目名称:omeyocan,代码行数:101,代码来源:admin.php

示例9: cache_read

 $content = cache_read('ad_14_0.htm', 'htm', 1);
 $content = str_replace('http://demo.destoon.com/v' . DT_VERSION . '/', $CFG['url'], $content);
 cache_write('ad_14_0.htm', $content, 'htm');
 $pay = (include DT_ROOT . '/file/setting/pay.php');
 foreach ($pay as $k => $v) {
     update_setting('pay-' . $k, $v);
 }
 $oauth = (include DT_ROOT . '/file/setting/oauth.php');
 foreach ($oauth as $k => $v) {
     update_setting('oauth-' . $k, $v);
 }
 for ($i = 1; $i <= 7; $i++) {
     $setting = (include DT_ROOT . '/file/setting/group-' . $i . '.php');
     if ($setting) {
         unset($setting['groupid'], $setting['groupname'], $setting['vip']);
         update_setting('group-' . $i, $setting);
     }
 }
 $DT_TIME = time();
 $DT_IP = get_env('ip');
 //模块安装时间
 $db->query("UPDATE {$DT_PRE}module SET installtime='{$DT_TIME}'");
 //设置管理员
 $md5_password = md5(md5($password));
 $db->query("UPDATE {$DT_PRE}member SET username='{$username}',passport='{$username}',password='{$md5_password}',payword='{$md5_password}',email='{$email}',regip='{$DT_IP}',regtime='{$DT_TIME}',loginip='{$DT_IP}',logintime='{$DT_TIME}' WHERE userid=1");
 $userurl = $CFG['url'] . 'index.php?homepage=' . $username;
 $db->query("UPDATE {$DT_PRE}company SET username='{$username}',linkurl='{$userurl}' WHERE userid=1");
 //替换广告位 单网页路径
 $content = cache_read('ad_14_0.htm', 'htm', 1);
 $content = str_replace('http://demo.destoon.com/v' . DT_VERSION . '/', $CFG['url'], $content);
 cache_write('ad_14_0.htm', $content, 'htm');
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:index.php

示例10: update_setting

        ?>
';" />
      </td></tr>

      </table></form>
<?php 
    }
}
/*__________________________________________________________________TEMPLATE_*/
if ($action == 'template') {
    $show_default = false;
    $show_template_form = true;
    if (isset($_POST['done'])) {
        $update_header = update_setting('affiliates_template_header', $_POST['header']);
        $update_template = update_setting('affiliates_template', $_POST['template']);
        $update_footer = update_setting('affiliates_template_footer', $_POST['footer']);
        $show_default = true;
        $show_template_form = false;
        echo '<p class="success">Templates successfully updated.</p>';
    }
    if ($show_template_form) {
        $header = get_setting('affiliates_template_header');
        $template = get_setting('affiliates_template');
        $footer = get_setting('affiliates_template_footer');
        $header_help = get_setting_desc('affiliates_template_header');
        $template_help = get_setting_desc('affiliates_template');
        $footer_help = get_setting_desc('affiliates_template_footer');
        ?>
      <p>You can edit the way your collective affiliates will be shown via the
      templates below. If you need help, click on the 'help' button.</p>
开发者ID:adriculous,项目名称:enthusiast,代码行数:30,代码来源:affiliates.php

示例11: 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


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