zoukankan      html  css  js  c++  java
  • Phpcms v9专题分类增加模板设置的方法

     Phpcms v9专题设置里面,默认专题子分类是无模板设置的,本文教你通过官方论坛给出的教程实现专题分类增加模板设置。先来看看默认专题子分类设置界面:

      修改后的的专题子分类设置界面多了模板设置:

      修改方法

      第一步:修改 phpcmsmodulesspecial index.php

      找到

    $list_template ? $list_template : 'list';

      替换成

    $template = $info['template'] ? $info['template'] : ($list_template ? $list_template : 'list');

      第二步 修改 phpcmsmodulesspecial special.php

      找到

    `typedir`

      替换成

    `typedir`, `template`

      第三步 修改 phpcmsmodulesspecial emplates special_add.tpl.php

      找到

    </span>&nbsp;<span id="typeTip">

      替换成

    <?php echo form::select_template('default', 'special', 'list', 'name="type[1][template]"', 'list');?></span>&nbsp;<span id="typeTip">

      找到

    var n = $('#option_list').find('input[name]').length/3+1;

      替换成

    var n = $('#option_list').find('input[name]').length/3+1;
            var template = '<?php echo str_replace("'", "'", form::select_template('default', 'special', 'list', 'name="type[|id|][template]"', 'list'));?>';

      找到

    </span>&nbsp;<a href="javascript:;"

      替换成

    '+template.replace('|id|', n)+'</span>&nbsp;<a href="javascript:;"

      第三步 修改 phpcmsmodulesspecial emplates special_edit.tpl.php

      找到

    </span>&nbsp;<?php if ($k!=1)

      修改成

    <?php echo form::select_template('default', 'special', $t['template'], 'name="type['.$k.'][template]"', 'list');?> </span>&nbsp;<?php if ($k!=1)

      找到

    var n = $('#option_list').find('input[type="text"]').length/3+1;

      替换成

    var n = $('#option_list').find('input[type="text"]').length/3+1;
            var template = '<?php echo str_replace("'", "'", form::select_template('default', 'special', 'list', 'name="type[|id|][template]"', 'list'));?>';

      找到

    </span>&nbsp;<a href="javascript:;"

      替换成

    '+template.replace('|id|', n)+'</span>&nbsp;<a href="javascript:;"

      修改完了 可以去添加模版了 比如 list_hehe.html 然后专题页面就可以自动搜索到了。

  • 相关阅读:
    第十二章学习笔记
    UVa OJ 107 The Cat in the Hat (戴帽子的猫)
    UVa OJ 123 Searching Quickly (快速查找)
    UVa OJ 119 Greedy Gift Givers (贪婪的送礼者)
    UVa OJ 113 Power of Cryptography (密文的乘方)
    UVa OJ 112 Tree Summing (树的求和)
    UVa OJ 641 Do the Untwist (解密工作)
    UVa OJ 105 The Skyline Problem (地平线问题)
    UVa OJ 100 The 3n + 1 problem (3n + 1问题)
    UVa OJ 121 Pipe Fitters (装管子)
  • 原文地址:https://www.cnblogs.com/xiaomifeng/p/5753635.html
Copyright © 2011-2022 走看看