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


PHP jconf::core_settings方法代碼示例

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


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

示例1: DoModifyNormal


//.........這裏部分代碼省略.........
     }
     if (isset($this->Post['config']['image_size'])) {
         $this->Post['config']['image_size'] = max(10, min(51200, (int) $this->Post['config']['image_size']));
         $this->Post['config']['image_size_limit'] = $this->Post['config']['image_size'] * 1024;
     }
     if (isset($this->Post['seccode_setting'])) {
         $this->Post['config']['seccode_login'] = $this->Post['config']['seccode_login'] ? 1 : 0;
         $this->Post['config']['seccode_register'] = $this->Post['config']['seccode_register'] ? 1 : 0;
         $this->Post['config']['seccode_password'] = $this->Post['config']['seccode_password'] ? 1 : 0;
         $this->Post['config']['seccode_publish'] = $this->Post['config']['seccode_publish'] ? 1 : 0;
         $this->Post['config']['seccode_comment'] = $this->Post['config']['seccode_comment'] ? 1 : 0;
         $this->Post['config']['seccode_forward'] = $this->Post['config']['seccode_forward'] ? 1 : 0;
         $this->Post['config']['seccode_sms'] = $this->Post['config']['seccode_sms'] ? 1 : 0;
         $this->Post['config']['seccode_no_email'] = $this->Post['config']['seccode_no_email'] ? 1 : 0;
         $this->Post['config']['seccode_no_photo'] = $this->Post['config']['seccode_no_photo'] ? 1 : 0;
         $this->Post['config']['seccode_no_vip'] = $this->Post['config']['seccode_no_vip'] ? 1 : 0;
         $this->Post['config']['seccode_purviews'] = array();
         if (is_array($this->Post['config']['seccode_purview']) && count($this->Post['config']['seccode_purview'])) {
             foreach ($this->Post['config']['seccode_purview'] as $__spid) {
                 $__spid = jfilter($__spid, 'int');
                 if ($__spid > 0) {
                     $this->Post['config']['seccode_purviews'][$__spid] = $__spid;
                 }
             }
         }
         $this->Post['config']['seccode_enable'] = $this->Post['seccode_enable'] ? (int) $this->Post['seccode_enable'] : 0;
         if ($this->Post['config']['seccode_enable'] == 1) {
             $this->Post['config']['seccode_login'] = $this->Post['config']['seccode_logins'] ? 1 : 0;
             $this->Post['config']['seccode_register'] = $this->Post['config']['seccode_registers'] ? 1 : 0;
             $this->Post['config']['seccode_password'] = $this->Post['config']['seccode_passwords'] ? 1 : 0;
         }
         $this->Post['config']['seccode_purview'] = is_array($this->Post['config']['seccode_purview']) ? implode(',', $this->Post['config']['seccode_purview']) : '';
         $this->Post['config']['seccode_pri_key'] = $this->Post['config']['seccode_pri_key'] ? $this->Post['config']['seccode_pri_key'] : $this->yxm_pri_key;
         $this->Post['config']['seccode_pub_key'] = $this->Post['config']['seccode_pub_key'] ? $this->Post['config']['seccode_pub_key'] : $this->yxm_pub_key;
         unset($this->Post['seccode_setting']);
     }
     if (isset($this->Post['config']['is_qmd'])) {
         $this->Post['config']['is_qmd'] = $this->Post['config']['is_qmd'] ? 1 : 0;
         if ($this->Post['config']['is_qmd']) {
             if (!$this->Post['config']['qmd_file_url'] || !jmkdir($this->Post['config']['qmd_file_url'])) {
                 $this->Post['config']['qmd_file_url'] = 'images/qmd/';
             }
             if (!$this->Post['config']['qmd_fonts_url'] || !file_exists($this->Post['config']['qmd_fonts_url'])) {
                 $this->Post['config']['is_qmd'] = 0;
                 $this->Messager('請上傳簽名檔必須的字體文件 ' . $this->Post['config']['qmd_fonts_url']);
             }
         }
         $this->Post['config']['qmd_link_display'] = $this->Post['config']['qmd_link_display'] ? 1 : 0;
     }
     if (isset($this->Post['config']['follow_limit'])) {
         $this->Post['config']['follow_limit'] = max(0, (int) $this->Post['config']['follow_limit']);
     }
     if (isset($this->Post['config']['topic_input_length'])) {
         $this->Post['config']['topic_input_length'] = max(0, (int) $this->Post['config']['topic_input_length']);
     }
     if (isset($this->Post['config']['gzip'])) {
         $this->Post['config']['gzip'] = $this->Post['config']['gzip'] && function_exists('ob_gzhandler') ? 1 : 0;
     }
     if (isset($this->Post['config']['reply_mode_normal'])) {
         $this->Post['config']['reply_mode_normal'] = $this->Post['config']['reply_mode_normal'] ? 1 : 0;
     }
     $new_config = $config = jconf::core_settings();
     foreach ($this->Post['config'] as $k => $v) {
         if (isset($this->Post['config'][$k]) && !is_null($v)) {
             $new_config[$k] = $v;
         }
     }
     $new_config['topic_cut_length'] = (int) $new_config['topic_cut_length'];
     if ($new_config['topic_cut_length'] > 200 || $new_config['topic_cut_length'] < 10) {
         $new_config['topic_cut_length'] = 140;
     }
     if (!$new_config['wap_url']) {
         $new_config['wap_url'] = $new_config['site_url'] . '/wap';
     }
     if (!$new_config['mobile_url']) {
         $new_config['mobile_url'] = $new_config['site_url'] . '/mobile';
     }
     $new_config['extra_domains'] = array();
     if ($new_config['extra_domain']) {
         $_arrs = explode("\n", $new_config['extra_domain']);
         foreach ($_arrs as $v) {
             $v = trim($v);
             $vl = strlen($v);
             if ($vl > 3 && $vl < 100) {
                 $new_config['extra_domains'][] = strtolower($v);
             }
         }
         $new_config['extra_domain'] = implode("\n", $new_config['extra_domains']);
     }
     $new_config['copyright'] = jstripslashes($new_config['copyright']);
     $new_config['tongji'] = jstripslashes($new_config['tongji']);
     $new_config['topic_view_share_code'] = jstripslashes($new_config['topic_view_share_code']);
     $new_config['regclosemessage'] = jstripslashes($new_config['regclosemessage']);
     $result = jconf::set($new_config);
     if ($result != false) {
         $this->Messager("配置修改成功");
     } else {
         $this->Messager("配置修改失敗");
     }
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:101,代碼來源:setting.mod.php


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