當前位置: 首頁>>代碼示例>>PHP>>正文


PHP jconf::set方法代碼示例

本文整理匯總了PHP中jconf::set方法的典型用法代碼示例。如果您正苦於以下問題:PHP jconf::set方法的具體用法?PHP jconf::set怎麽用?PHP jconf::set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在jconf的用法示例。


在下文中一共展示了jconf::set方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: DoSave

 function DoSave()
 {
     $dedecms = $this->Post['dedecms'];
     $dedecms_config_default = $dedecms_config = jconf::get('dedecms');
     $dedecms_config['enable'] = $dedecms['enable'] ? 1 : 0;
     $dedecms_config['db_host'] = $dedecms['db_host'];
     $dedecms_config['db_name'] = $dedecms['db_name'];
     $dedecms_config['db_user'] = $dedecms['db_user'];
     $dedecms_config['db_pass'] = $dedecms['db_pass'];
     $dedecms_config['db_port'] = $dedecms['db_port'];
     $dedecms_config['db_pre'] = $dedecms['db_pre'];
     $dedecms_config['charset'] = $dedecms['charset'];
     $dedecms_config['db_url'] = $dedecms['db_url'];
     if ($dedecms_config['enable']) {
         include_once ROOT_PATH . './api/uc_api_db.php';
         $dede_db = new JSG_UC_API_DB();
         @$dede_db->connect($dedecms['db_host'], $dedecms['db_user'], $dedecms['db_pass'], $dedecms['db_name'], $dedecms['charset'], 1, $dedecms['db_pre']);
         if (!$dede_db->link || !$dede_db->query("SHOW COLUMNS FROM {$dedecms['db_pre']}member", 'SILENT')) {
             $this->Messager("無法連接DedeCMS數據庫,請檢查您填寫的DedeCMS數據庫配置信息是否正確.");
             exit;
         }
     }
     if ($dedecms_config_default != $dedecms_config) {
         jconf::set('dedecms', $dedecms_config);
     }
     if ($dedecms_config['enable'] != $this->Config['dedecms_enable']) {
         $config = array();
         $config['dedecms_enable'] = $dedecms_config['enable'];
         jconf::update($config);
     }
     $this->Messager("修改成功");
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:32,代碼來源:dedecms.mod.php

示例2: ForceIP

 function ForceIP()
 {
     $ip = trim($this->Post['ip']);
     if (!$ip) {
         json_error("無效IP。");
     }
     if ('admin' != MEMBER_ROLE_TYPE) {
         json_error("您沒有封IP權限");
     }
     if ($ip == $GLOBALS['_J']['client_ip']) {
         json_error("無法禁止當前的IP。");
     }
     if (preg_match("/^(\\d{1,3}\\.){1,3}\\d{1,3}\\.?\$/", $ip)) {
         $ip = str_replace(".", "\\.", $ip);
     }
     $access = jconf::get('access');
     $ip_arr = explode('|', $access['ipbanned']);
     if ($ip_arr && in_array($ip, $ip_arr)) {
         json_error("已禁止此IP");
     }
     if ($access['ipbanned']) {
         $access['ipbanned'] .= '|' . $ip;
     } else {
         $access['ipbanned'] = $ip;
     }
     jconf::set('access', $access);
     $config = array();
     $config['ipbanned_enable'] = $access['ipbanned'] ? 1 : 0;
     jconf::update($config);
     json_result('禁止IP:' . $ip . '成功');
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:31,代碼來源:topic_manage.mod.php

示例3: DoClean

 function DoClean()
 {
     $type = get_param('type');
     if (!$type) {
         $this->Messager("請先選擇要清理的緩存對象");
     }
     $this->_removeTopicAttach();
     $this->_removeTopicLongtext();
     $this->_removeVoteImage();
     if (in_array('data', $type)) {
         cache_db('clear');
         jtable('failedlogins')->truncate();
         DB::query("update " . TABLE_PREFIX . "members set `username`=`uid` WHERE `username`!=`uid` AND `username` REGEXP '^[0-9]*\$'");
     }
     if (in_array('tpl', $type)) {
         cache_clear();
         jconf::set('validate_category', array());
         jlogic('credits')->rule_conf(true);
     }
     if (in_array('channel', $type)) {
         jlogic('channel')->update_data();
     }
     if (in_array('album', $type)) {
         jlogic('image')->update_data();
     }
     $this->Messager("已清空所有緩存");
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:27,代碼來源:cache.mod.php

示例4: writeNextRunTime

 function writeNextRunTime()
 {
     $query = $this->DatabaseHandler->Query("SELECT nextrun FROM " . TABLE_PREFIX . 'task' . " WHERE available>'0' ORDER BY nextrun LIMIT 1");
     $row = $query->GetRow();
     $nextruntime = $row['nextrun'] ? $row['nextrun'] : time() + 1800;
     jconf::set('task', 'nextrun', $nextruntime);
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:7,代碼來源:task.logic.php

示例5: update_feature_cache

 function update_feature_cache()
 {
     $features = array();
     $query = DB::query("SELECT * FROM " . DB::table('feature'));
     while ($value = DB::fetch($query)) {
         $features[$value['featureid']] = $value['featurename'];
     }
     jconf::set('feature', $features);
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:9,代碼來源:feature.logic.php

示例6: weibo_show

 function weibo_show()
 {
     $conf = jconf::get('weibo_show');
     $link_display_none_radio = $this->jishigou_form->YesNoRadio('link_display_none', (int) $conf['link_display_none']);
     if (jpost('settingsubmit')) {
         $conf['link_display_none'] = jpost('link_display_none') ? 1 : 0;
         jconf::set('weibo_show', $conf);
         $this->Messager('設置成功了');
     }
     include template();
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:11,代碼來源:tools.mod.php

示例7: DoModify

 function DoModify()
 {
     $set['about'] = $this->Post['about'];
     $set['contact'] = $this->Post['contact'];
     $set['joins'] = $this->Post['joins'];
     $set['float'] = $this->Post['float'];
     $set['float_align'] = $this->Post['float_align'];
     $set['float_style'] = $this->Post['float_style'];
     $set = jstripslashes($set);
     jconf::set('web_info', $set);
     $this->Messager("修改成功", 'admin.php?mod=web_info');
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:12,代碼來源:web_info.mod.php

示例8: doconfig

 function doconfig()
 {
     $config = $this->Post['config'];
     $live_config['user'] = trim($config['user']);
     $live_config['des'] = trim($config['des']);
     $live_config['ads'] = trim($config['ads']);
     $uid = DB::result_first("SELECT uid FROM " . DB::table("members") . " WHERE nickname = '{$live_config['user']}'");
     if ($uid) {
         $live_config['uid'] = $uid;
         jconf::set('live', $live_config);
         $this->Messager("配置成功");
     } else {
         $this->Messager("用戶 <b>" . $live_config['user'] . "</b> 不存在!");
     }
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:15,代碼來源:live.mod.php

示例9: update_qun_num

 function update_qun_num($cat_id, $num = null)
 {
     $ret = false;
     $cat_id = (int) $cat_id;
     if ($cat_id > 0) {
         if (isset($num)) {
             $num = (int) $num;
             $ret = $this->db->update_count($cat_id, 'qun_num', $num);
         } else {
         }
     }
     if ($ret) {
         jconf::set('qun_category', array());
     }
     return $ret;
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:16,代碼來源:qun_category.logic.php

示例10: setting

 function setting()
 {
     if (jget('settingsubmit')) {
         $url = jget('url');
         $url['status_default'] = (int) $url['status_default'];
         foreach ($url['status_set'] as $k => $v) {
             $url['status_set'][$k] = (int) $v;
         }
         jconf::set('url', $url);
         $this->Messager('設置成功');
     }
     $url = jconf::get('url');
     $options = array(1 => array('value' => 1, 'name' => '加入白名單(允許訪問)隊列<br />'), 0 => array('value' => 0, 'name' => '加入常規(默認)隊列<br />'), -1 => array('value' => -1, 'name' => '加入黑名單(禁止訪問)隊列<br />'));
     $status_default_radio = $this->jishigou_form->Radio('url[status_default]', $options, (int) $url['status_default']);
     $options = array(0 => array('value' => 0, 'name' => '直接跳轉到相應的鏈接地址(推薦用於白名單(允許訪問)隊列)<br />'), 1 => array('value' => 1, 'name' => '給出可以點擊的鏈接地址,需要點擊後才能跳轉(推薦用於常規(默認)隊列)<br />'), 2 => array('value' => 2, 'name' => '給出鏈接地址,需要自行複製鏈接地址到瀏覽器地址欄中進行訪問(推薦用於常規(默認)隊列)<br />'), 3 => array('value' => 3, 'name' => '禁止訪問(推薦用於黑名單(禁止訪問)隊列)<br />'));
     $status_set_allow_radio = $this->jishigou_form->Radio('url[status_set][1]', $options, (int) $url['status_set'][1]);
     $status_set_normal_radio = $this->jishigou_form->Radio('url[status_set][0]', $options, (int) $url['status_set'][0]);
     $status_set_disallow_radio = $this->jishigou_form->Radio('url[status_set][-1]', $options, (int) $url['status_set'][-1]);
     include template();
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:20,代碼來源:url.mod.php

示例11: DoSave

 function DoSave()
 {
     $dzbbs = $this->Post['dzbbs'];
     $dzbbs_config_default = $dzbbs_config = jconf::get('dzbbs');
     $dzbbs_config['enable'] = $dzbbs['enable'] ? 1 : 0;
     $dzbbs_config['db_host'] = $dzbbs['db_host'];
     $dzbbs_config['db_name'] = $dzbbs['db_name'];
     $dzbbs_config['db_user'] = $dzbbs['db_user'];
     $dzbbs_config['db_pass'] = $dzbbs['db_pass'];
     $dzbbs_config['db_port'] = $dzbbs['db_port'];
     $dzbbs_config['db_pre'] = $dzbbs['db_pre'];
     $dzbbs_config['charset'] = $dzbbs['charset'];
     $dzbbs_config['db_url'] = $dzbbs['db_url'];
     $dzbbs_config['dz_ver'] = $dzbbs['dz_ver'];
     if ($dzbbs_config['enable']) {
         $table_m = $dzbbs['dz_ver'] == 'dzx' ? $dzbbs['db_pre'] . 'common_member' : $dzbbs['db_pre'] . 'members';
         include_once ROOT_PATH . './api/uc_api_db.php';
         $dz_db = new JSG_UC_API_DB();
         @$dz_db->connect($dzbbs['db_host'], $dzbbs['db_user'], $dzbbs['db_pass'], $dzbbs['db_name'], $dzbbs['charset'], 1, $dzbbs['db_pre']);
         if (!$dz_db->link || !$dz_db->query("SHOW COLUMNS FROM {$table_m}", 'SILENT')) {
             $this->Messager("無法連接Discuz數據庫,請檢查您填寫的Discuz數據庫配置信息是否正確.");
             exit;
         }
     }
     if ($dzbbs_config_default != $dzbbs_config) {
         jconf::set('dzbbs', $dzbbs_config);
     }
     if ($dzbbs_config['enable'] != $this->Config['dzbbs_enable']) {
         $config = array();
         $config['dzbbs_enable'] = $dzbbs_config['enable'];
         if ($dzbbs_config['enable'] == 1) {
             $config['ucenter_enable'] = 1;
             $config['pwbbs_enable'] = 0;
             $config['phpwind_enable'] = 0;
         }
         jconf::update($config);
     }
     $this->Messager("修改成功");
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:39,代碼來源:dzbbs.mod.php

示例12: DoModifySetting

 function DoModifySetting()
 {
     $attach = $this->Post['attach'];
     $attach_config_default = $attach_config = jconf::get('attach');
     $attach_config['enable'] = $attach['enable'] ? 1 : 0;
     $attach_config['qun_enable'] = $attach['qun_enable'] ? 1 : 0;
     $attach_config['request_file_type'] = jlogic('attach')->type_filter($attach['request_file_type']);
     $attach_config['request_size_limit'] = min(max(1, (int) $attach['request_size_limit']), 51200);
     $attach_config['request_files_limit'] = min(max(1, (int) $attach['request_files_limit']), 50);
     $attach_config['score_min'] = max(1, (int) $attach['score_min']);
     $attach_config['score_max'] = max(1, (int) $attach['score_max']);
     if ($attach_config['score_max'] < $attach_config['score_min']) {
         $attach_config['score_max'] = $attach_config['score_min'];
     }
     $attach_config['no_score_user'] = is_array($this->Post['no_score_user']) ? implode(',', $this->Post['no_score_user']) : '';
     $config = array();
     if ($attach_config_default != $attach_config) {
         jconf::set('attach', $attach_config);
     }
     if ($attach_config['enable'] != $this->Config['attach_enable']) {
         $config['attach_enable'] = $attach_config['enable'];
     }
     if ($attach_config['qun_enable'] != $this->Config['qun_attach_enable']) {
         $config['qun_attach_enable'] = $attach_config['qun_enable'];
     }
     if ($attach_config['request_file_type'] != $this->Config['attach_file_type']) {
         $config['attach_file_type'] = $attach_config['request_file_type'];
     }
     if ($attach_config['request_size_limit'] != $this->Config['attach_size_limit']) {
         $config['attach_size_limit'] = $attach_config['request_size_limit'];
     }
     if ($attach_config['request_files_limit'] != $this->Config['attach_files_limit']) {
         $config['attach_files_limit'] = $attach_config['request_files_limit'];
     }
     if ($config) {
         jconf::update($config);
     }
     $this->Messager("修改成功");
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:39,代碼來源:attach.mod.php

示例13: modify

 function modify()
 {
     if (jget('settingsubmit')) {
         $limit = jget('limit', 'int');
         if ($limit < 1) {
             $limit = 15;
         }
         $time = jget('time', 'int');
         if ($time < 1) {
             $time = 15;
         }
         $white_list = jget('white_list');
         if ($white_list) {
             $white_list = explode("\n", $white_list);
             foreach ($white_list as $k => $v) {
                 $white_list[$k] = trim($v);
             }
             $white_list = array_remove_empty(array_unique($white_list));
         }
         $failedlogins = array('limit' => $limit, 'time' => $time, 'white_list' => $white_list);
         jconf::set('failedlogins', $failedlogins);
     }
     $this->Messager('設置成功', 'admin.php?mod=failedlogins&code=index');
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:24,代碼來源:failedlogins.mod.php

示例14: hot_tag_recommend

 function hot_tag_recommend()
 {
     $rets = array();
     if ($GLOBALS['_J']['config']['hot_tag_recommend_enable']) {
         $rets = jconf::get('hot_tag_recommend');
         if ($rets['list'] && TIMESTAMP - $rets['time'] >= 1800) {
             $for_count = $rets['num'];
             foreach ($rets['list'] as $key => $val) {
                 if ($for_count < 1) {
                     break;
                 }
                 $for_count--;
                 if ($val['tag_id']) {
                     $rets['list'][$key]['topic_count'] = DB::result_first(" select `topic_count` from `" . TABLE_PREFIX . "tag` where id='{$val[tag_id]}' ");
                 } else {
                     $rets['list'][$key]['topic_count'] = 0;
                 }
             }
             $rets['time'] = TIMESTAMP;
             jconf::set('hot_tag_recommend', $rets);
         }
     }
     return $rets;
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:24,代碼來源:data_block.logic.php

示例15: DoDelADV

 function DoDelADV()
 {
     $ids = jget('ids');
     if ($ids && is_array($ids)) {
         $ad = jconf::get('ad');
         $ids_where = implode(',', $ids);
         DB::query(" delete from `" . TABLE_PREFIX . "ad` where `adid` in ({$ids_where}) ");
         foreach ($ad['ad_list'] as $k => $page) {
             foreach ($page as $k_local => $local) {
                 foreach ($local as $ad_id => $ad_one) {
                     $ad_info = DB::fetch_first(" select * from `" . TABLE_PREFIX . "ad` where `adid` = '{$ad_id}' ");
                     if (!$ad_info) {
                         if (isset($ad['ad_list'][$k][$k_local][$ad_id]) && is_array($ad['ad_list'][$k][$k_local][$ad_id])) {
                             unset($ad['ad_list'][$k][$k_local][$ad_id]);
                         }
                     }
                     if (in_array($ad_id, $ids)) {
                         if (isset($ad['ad_list'][$k][$k_local][$ad_id]) && is_array($ad['ad_list'][$k][$k_local][$ad_id])) {
                             unset($ad['ad_list'][$k][$k_local][$ad_id]);
                         }
                     }
                 }
                 $ad['ad_list'][$k][$k_local] = array_filter($ad['ad_list'][$k][$k_local]);
             }
             $ad['ad_list'][$k] = array_filter($ad['ad_list'][$k]);
         }
         $ad['ad_list'] = array_filter($ad['ad_list']);
         jconf::set('ad', $ad);
     }
     $this->Messager('刪除成功', 'admin.php?mod=income&code=ad_list');
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:31,代碼來源:income.mod.php


注:本文中的jconf::set方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。