【 ps:以下是最新V1.7.0版本更新方法】


 大家好,由于目前程序默认只有图集和文章模型在会员中心发表,版友问,如何在会员中心投稿里面要发表下载或者产品甚至视频/专辑模型的文章,该如何增加,我在闲暇时给大家简单的一个修改方案,此方案就可以自行掌握修改,大家可以试试效果哦,如果有什么问题可以留言告知。


方法如下:


新增配置文件:


web3.htm(自己创建)  路径:\application\admin\template\system


代码内如如下:


{include file="public/layout" /}

<link href="__PUBLIC__/plugins/colpick/css/colpick.css" rel="stylesheet" type="text/css"/>

<body class="bodystyle" style="overflow-y: scroll; cursor: default; -moz-user-select: inherit;">

<div id="append_parent"></div>

<div id="ajaxwaitid"></div>

<div class="page">

    {include file="system/bar" /}

    <div class="flexigrid">

    <form method="post" id="handlepost" action="{:U('System/web3')}" enctype="multipart/form-data" name="form1" class="form-horizontal">

        <div class="ncap-form-default">

             <div class="hDiv htitx">

                <div class="hDivBox">

                    <table cellspacing="0" cellpadding="0" style="width: 100%">

                        <thead>

                        <tr>

                            <th class="sign w10" axis="col0">

                                <div class="tc"></div>

                            </th> 

                     {if condition="$php_servicemeal > 1"}

                    {eq name='$main_lang' value='$admin_lang'}

                    {eq name="$Think.const.CONTROLLER_NAME.'@web3'|is_check_access" value="1"}   <dl class="row">

                            <dt class="tit">

                                <label>投稿模型控制</label>

                            </dt>

                            <dd class="opt" style="line-height: 26px;">

                              <label class="curpoin">

                   <a href='{:url("Member/users_config")}'><span>选择栏目</span></a>

                    </label><p class="notic">控制前端允许发布的模型栏目</p>

                            </dd>

                        </dl>{/eq}{/eq}

                            <th abbr="ac_id" axis="col4">

                                <div class=""></div>

                            </th>

                        </tr>

                        </thead>

                    </table>

                </div>

            </div>

              <dl class="row">

                <dt class="tit">

                    <label for="web_usertougao">文章模型</label>

                </dt>

                <dd class="opt">

                  <div class="onoff">

                       <label for="web_usertougao1" class="cb-enable {if condition='isset($config.web_usertougao) AND $config.web_usertougao eq 1'}selected{/if}">开启</label>

                           <label for="web_usertougao0" class="cb-disable {if condition='!isset($config.web_usertougao) OR empty($config.web_usertougao)'}selected{/if}">关闭</label>

                     

                        <input id="web_usertougao0" name="web_usertougao" value="0" type="radio" {if condition="!isset($config.web_usertougao) OR empty($config.web_usertougao)"} checked="checked"{/if}>

                        <input id="web_usertougao1" name="web_usertougao" value="1" type="radio" {if condition="isset($config.web_usertougao) AND $config.web_usertougao eq 1"} checked="checked"{/if}>

                        <input type="hidden" id="old_web_usertougao" value="{$config.web_usertougao|default='0'}">

                        </div>

                 &nbsp;

                    <p class="notic">设置文章模型栏目开关</p>

                  <br/>

                    <p class="notic2"> </p>

                </dd>

            </dl>

             <dl class="row">

                <dt class="tit">

                    <label for="web_usertougaob">图集模型</label>

                </dt>

                <dd class="opt">

                  <div class="onoff">

                       <label for="web_usertougaob3" class="cb-enable {if condition='isset($config.web_usertougaob) AND $config.web_usertougaob eq 3'}selected{/if}">开启</label>

                           <label for="web_usertougaob0" class="cb-disable {if condition='!isset($config.web_usertougaob) OR empty($config.web_usertougaob)'}selected{/if}">关闭</label>

                     

                        <input id="web_usertougaob0" name="web_usertougaob" value="0" type="radio" {if condition="!isset($config.web_usertougaob) OR empty($config.web_usertougaob)"} checked="checked"{/if}>

                        <input id="web_usertougaob3" name="web_usertougaob" value="3" type="radio" {if condition="isset($config.web_usertougaob) AND $config.web_usertougaob eq 3"} checked="checked"{/if}>

                        <input type="hidden" id="old_web_usertougaob" value="{$config.web_usertougaob|default='0'}">

                        </div>

                 &nbsp;

                    <p class="notic">设置图集模型栏目开关</p>

                  <br/>

                    <p class="notic2"> </p>

                </dd>

            </dl>


             <dl class="row">

                <dt class="tit">

                    <label for="web_usertougaoc">产品模型</label>

                </dt>

                <dd class="opt">

                  <div class="onoff">

                       <label for="web_usertougaoc2" class="cb-enable {if condition='isset($config.web_usertougaoc) AND $config.web_usertougaoc eq 2'}selected{/if}">开启</label>

                           <label for="web_usertougaoc0" class="cb-disable {if condition='!isset($config.web_usertougaoc) OR empty($config.web_usertougaoc)'}selected{/if}">关闭</label>

                     

                        <input id="web_usertougaoc0" name="web_usertougaoc" value="0" type="radio" {if condition="!isset($config.web_usertougaoc) OR empty($config.web_usertougaoc)"} checked="checked"{/if}>

                        <input id="web_usertougaoc2" name="web_usertougaoc" value="2" type="radio" {if condition="isset($config.web_usertougaoc) AND $config.web_usertougaoc eq 2"} checked="checked"{/if}>

                        <input type="hidden" id="old_web_usertougaoc" value="{$config.web_usertougaoc|default='0'}">

                        </div>

                 &nbsp;

                    <p class="notic">设置产品模型栏目开关</p>

                  <br/>

                    <p class="notic2"> </p>

                </dd>

            </dl>

 

                 <dl class="row">

                <dt class="tit">

                    <label for="web_usertougaod">下载模型</label>

                </dt>

                <dd class="opt">

                  <div class="onoff">

                       <label for="web_usertougaod4" class="cb-enable {if condition='isset($config.web_usertougaod) AND $config.web_usertougaod eq 4'}selected{/if}">开启</label>

                           <label for="web_usertougaod0" class="cb-disable {if condition='!isset($config.web_usertougaod) OR empty($config.web_usertougaod)'}selected{/if}">关闭</label>

                     

                        <input id="web_usertougaod0" name="web_usertougaod" value="0" type="radio" {if condition="!isset($config.web_usertougaod) OR empty($config.web_usertougaod)"} checked="checked"{/if}>

                        <input id="web_usertougaod4" name="web_usertougaod" value="4" type="radio" {if condition="isset($config.web_usertougaod) AND $config.web_usertougaod eq 4"} checked="checked"{/if}>

                        <input type="hidden" id="old_web_usertougaod" value="{$config.web_usertougaod|default='0'}">

                        </div>

                 &nbsp;

                    <p class="notic">设置下载模型栏目开关</p>

                  <br/>

                    <p class="notic2"> </p>

                </dd>

            </dl>


                 <dl class="row">

                <dt class="tit">

                    <label for="web_usertougaof">视频模型</label>

                </dt>

                <dd class="opt">

                  <div class="onoff">

                       <label for="web_usertougaof5" class="cb-enable {if condition='isset($config.web_usertougaof) AND $config.web_usertougaof eq 5'}selected{/if}">开启</label>

                           <label for="web_usertougaof0" class="cb-disable {if condition='!isset($config.web_usertougaof) OR empty($config.web_usertougaof)'}selected{/if}">关闭</label>

                     

                        <input id="web_usertougaof0" name="web_usertougaof" value="0" type="radio" {if condition="!isset($config.web_usertougaof) OR empty($config.web_usertougaof)"} checked="checked"{/if}>

                        <input id="web_usertougaof5" name="web_usertougaof" value="5" type="radio" {if condition="isset($config.web_usertougaof) AND $config.web_usertougaof eq 5"} checked="checked"{/if}>

                        <input type="hidden" id="old_web_usertougaof" value="{$config.web_usertougaof|default='0'}">

                        </div>

                 &nbsp;

                    <p class="notic">设置视频模型栏目开关</p>

                  <br/>

                    <p class="notic2"> </p>

                </dd>

            </dl>

  {/if}

            <div class="bot">

                <a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" on-click="adsubmit();">确认提交</a>

            </div>

        </div>

    </form>


<input type="hidden" id="show_web_adminlogo" value="{$config.web_adminlogo|default=''}">

<input type="hidden" id="show_uiset" value="{$show_uiset|default=''}">

<script type="text/javascript">


    function adsubmit(){


        // 留言外链与默认切换

        var web_goods_mode_obj = $('input[name=web_goods_mode]');

        if ($('input[name=web_goods_mode]:checked').val() == 1) {

            if (web_goods_mode_obj.val() == "{$subDomain|default='www'}") {

                showErrorMsg('外链地址必须全部输入');

                web_goods_mode_obj.focus();

                return false;

            }

        }

        

         // 会员外链与默认切换

        var web_usertz_mode_obj = $('input[name=web_usertz_mode]');

        if ($('input[name=web_usertz_mode]:checked').val() == 1) {

            if (web_usertz_mode_obj.val() == "{$subDomain|default='www'}") {

                showErrorMsg('外链地址必须全部输入');

                web_usertz_mode_obj.focus();

                return false;

            }

        }

        

        // 后台登录超时

        var web_login_expiretime_obj = $('input[name=web_login_expiretime]');

        if (web_login_expiretime_obj.val() < 60) {

            showErrorMsg('后台登录超时不能少于60秒!');

            web_login_expiretime_obj.focus();

            return false;

        }


        var adminbasefileObj = $('textarea[name=web_goods]');

        var adminbasefile_oldObj = $('textarea[name=web_goods]');


        if(adminbasefile_oldObj.val() != adminbasefileObj.val()){

            var flag = false;

            var site_url = adminbasefileObj.data('site_url');

            layer.confirm('后台路径:<font color="red">'+site_url+'__ROOT_DIR__/'+adminbasefileObj.val()+'.php</font>,确认更改?', {

                    title: false,

                    btn: ['继续更改','取消'] //按钮

                }, function(){

                    layer_loading('正在处理');

                    $('#handlepost').submit();

                }, function(index){

                    flag = false;

                }

            );

            return flag;

        }

        layer_loading('正在处理');

        $('#handlepost').submit();

    }


</script>


{include file="public/footer" /}



打开:\application\admin\template\system目录


找到bar.htm


在</ul>前面增加以下代码:


                             

 {if condition="$php_servicemeal > 1"}

                                {eq name='$main_lang' value='$admin_lang'}

                    {eq name="$Think.const.CONTROLLER_NAME.'@web3'|is_check_access" value="1"}

                    <li><a href="{:url('System/web3')}" {if condition="'we3'==$Think.const.ACTION_NAME"}class="current"{/if}><span>其他设置</span></a></li>

                    {/eq}

                {/eq} {/if}


打开:\application\admin\controller目录

打开System.php文件:

在最底下的最后一个  } 符号前面新增以下代码:



 public function web3()

  {

        $this->language_access(); // 多语言功能操作权限

        $inc_type = 'web';

        if (IS_POST) {

            $param = input('post.');

            /*多语言*/

            if (is_language()) {

                $langRow = \think\Db::name('language')->order('id asc')

                    ->cache(true, EYOUCMS_CACHE_TIME, 'language')

                    ->select();

                foreach ($langRow as $key => $val) {

                    tpCache($inc_type,$param,$val['mark']);

                    write_global_params($val['mark']); // 写入全局内置参数

                }

            } else {

                tpCache($inc_type,$param);

                write_global_params($this->admin_lang); // 写入全局内置参数

            }

            /*--end*/

            /*更改session会员设置 - session有效期(后台登录超时)*/

            $session_conf = [];

            $session_file = APP_PATH.'admin/conf/session_conf.php';

            if (file_exists($session_file)) {

                require_once($session_file);

                $session_conf_tmp = EY_SESSION_CONF;

                if (!empty($session_conf_tmp)) {

                    $session_conf_tmp = json_decode($session_conf_tmp, true);

                    if (!empty($session_conf_tmp) && is_array($session_conf_tmp)) {

                        $session_conf = $session_conf_tmp;

                    }

                }

            }

            $session_conf['expire'] = $param['web_login_expiretime'];

            $str_session_conf = '<?php'.PHP_EOL.'$session_1600593464 = json_encode('.var_export($session_conf,true).');'.PHP_EOL.'define(\'EY_SESSION_CONF\', $session_1600593464);';

            @file_put_contents(APP_PATH . 'admin/conf/session_conf.php', $str_session_conf);

            /*--end*/

            $refresh = false;

            $gourl = request()->domain().$this->root_dir.'/'.$adminbasefile; // 支持子目录

            /*--end*/

            $this->success('操作成功', url('System/web3'));

        }

        $config = tpCache($inc_type);

        $show_uiset = '';

        $web_tpl_theme = !empty($config['web_tpl_theme']) ? $config['web_tpl_theme'].DS : '';

        if (file_exists(ROOT_PATH.'template'.DS.$web_tpl_theme.'pc'.DS.'uiset.txt') && file_exists(ROOT_PATH.'template'.DS.$web_tpl_theme.'mobile'.DS.'uiset.txt')) {

            $show_uiset = 'pc+mobile';

        } else if (file_exists(ROOT_PATH.'template'.DS.$web_tpl_theme.'pc'.DS.'uiset.txt')) {

            $show_uiset = 'pc';

        } else if (file_exists(ROOT_PATH.'template'.DS.$web_tpl_theme.'mobile'.DS.'uiset.txt')) {

            $show_uiset = 'mobile';

        }

        $this->assign('show_uiset', $show_uiset);

        /*end*/


        $this->assign('config',$config);//当前配置项

        

    $assign_data['weapp_plugin_open'] = tpCache('php.php_weapp_plugin_open');

        $assign_data['php_weapp_plugin_open'] = $php_weapp_plugin_open;


        $this->assign($assign_data);

        return $this->fetch();

    }




再次打开:\application\admin\template\member目录

打开:users_config.htm文件

找到:(247行左右)


<dl class="row">

                            <dt class="tit">

                                <label>投稿次数限制</label>

                            </dt>

                            <dd class="opt">

                                <label class="curpoin">

                                    <input name="users[is_open_posts_count]" value="1" type="radio"  {if condition="isset($usersConfig.is_open_posts_count) && $usersConfig.is_open_posts_count == 1"} checked="checked"{/if}>开启

                                </label>

                                <label class="curpoin">

                                &nbsp;&nbsp;&nbsp;

                                    <input name="users[is_open_posts_count]" value="0" type="radio" {if condition="!isset($usersConfig.is_open_posts_count) || empty($usersConfig.is_open_posts_count)"} checked="checked" {/if}>关闭

                                </label>

                                <a {if condition='!isset($usersConfig.is_open_posts_count) || empty($usersConfig.is_open_posts_count)'}style="display: none;"{/if} id='UpUsersLevelBout' href="javascript:void(0);" on-click="UpUsersLevelBout();" class="ml10 ncap-btn ncap-btn-green">设置次数</a>

                                <p class="notic">开启后可设置会员每日的投搞数量</p>

                            </dd>

                        </dl>


在下面新增以下代码:


{eq name='$main_lang' value='$admin_lang'}

                    {eq name="$Think.const.CONTROLLER_NAME.'@web3'|is_check_access" value="1"}   <dl class="row">

                            <dt class="tit">

                                <label>投稿模型开关</label>

                            </dt>

                            <dd class="opt" style="line-height: 26px;">

                              <label class="curpoin">

                   <a href="{:url('System/web3')}"><span>配置</span></a>

                    </label><p class="notic">控制前端允许发布的模型栏目</p>

                            </dd>

                        </dl>{/eq}

                {/eq} 


保存!



打开目录:/application/admin/controller目录

Member.php文件  

找到:大概在980行左右  


找到:

// 左侧菜单

        $this->assign('usersTplVersion', getUsersTplVersion());


在下面添加:

$web_usertougao = tpCache('web.web_usertougao');

$web_usertougaob = tpCache('web.web_usertougaob');

$web_usertougaoc = tpCache('web.web_usertougaoc');

 $web_usertougaod = tpCache('web.web_usertougaod');

 $web_usertougaod = tpCache('web.web_usertougaof');

然后继续

在下一行

找到

 /*允许发布文档列表的栏目*/

        $current_channel = [1,3,4,5]; // 允许投稿的模型


修改为:

 /*允许发布文档列表的栏目*/

        $current_channel = [$web_usertougao,$web_usertougaod,$web_usertougaob,$web_usertougaoc, $web.web_usertougaof]; // 允许投稿的模型



修改后保存。



最后打开:\application\user\controller

UsersRelease.php 文件:


大概在172行左右

找到:

 public function release_select()

    {

下面增加:

$web_usertougao = tpCache('web.web_usertougao');

         $web_usertougaob = tpCache('web.web_usertougaob');

         $web_usertougaoc = tpCache('web.web_usertougaoc');

         $web_usertougaod = tpCache('web.web_usertougaod');

        $web_usertougaod = tpCache('web.web_usertougaof');

下面2行找到:

 $ids = [1,3,4,5];

修改为: 

$ids = [$web_usertougao,$web_usertougaod,$web_usertougaob,$web_usertougaoc,web_usertougaof];


最后保存


完毕




最后打开/data/runtime目录(缓存文件)

里面的所有目录 全部删除干净。

再打开:/data/目录里面的 类似/session_12Xi28Zr  全部删除(不用担心这个目录删了 还会自动生成,只是后台缓存文件)


后台缓存如果无效请手动删除上面的步骤,然后搞定。

修改或者新增模型后请重新到后台

投稿配置里 重新设置栏目允许前台投稿使用。


最后说明,有可能新的模型在会员中心有新的属性或者自定义标签,需要CSS的 则自己修改!!完毕

效果图:


后台:

【教程】会员中心投稿新增或者修改模型栏目开关控制方法(V1.70更新)(图1)【教程】会员中心投稿新增或者修改模型栏目开关控制方法(V1.70更新)(图2)【教程】会员中心投稿新增或者修改模型栏目开关控制方法(V1.70更新)(图3)

【教程】会员中心投稿新增或者修改模型栏目开关控制方法(V1.70更新)(图4)



【教程】会员中心投稿新增或者修改模型栏目开关控制方法(V1.70更新)(图5)

【教程】会员中心投稿新增或者修改模型栏目开关控制方法(V1.70更新)(图6)

【教程】会员中心投稿新增或者修改模型栏目开关控制方法(V1.70更新)(图7)

【教程】会员中心投稿新增或者修改模型栏目开关控制方法(V1.70更新)(图8)