当前位置: 首页>>代码示例>>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;未经允许,请勿转载。