首页 技术 正文
技术 2022年11月15日
0 收藏 783 点赞 2,093 浏览 1402 个字

1.在ecs_category 表 添加 template 字段

可以在后台运行sql语句:alter table `ecs_category` Add column template text NOT NULL AFTER `style`

前缀自己改

2.打开admin/templates/category_info.htm 文件,分类的样式表文件 的下一行,加放以下代码

搜索:javascript:showNotice(‘noticeGoodsSN’) 找到:大概在128行

<tr>
        <td class=”label”><a href=”javascript:showNotice(‘noticeGoodsSN’);” title=”{$lang.form_notice}”><img src=”data:images/notice.gif” width=”16″ height=”16″ border=”0″ alt=”{$lang.notice_style}”></a>{$lang.cat_style}:</td>
        <td>
          <input type=”text” name=”style” value=”{$cat_info.style|escape}” size=”40″ /> <br />
          <span class=”notice-span” {if $help_open}style=”display:block” {else} style=”display:none” {/if} id=”noticeGoodsSN”>{$lang.notice_style}</span>
        </td>
      </tr>

下方增加:

<tr>  
    <td class=”label”>分类模板:</td>  
    <td>  
    <input type=”text” name=”template” value=”{$cat_info.template|escape}” size=”40″ /> <br />  
    <span class=”notice-span”>留空为默认模板</span>  
    </td>  
    </tr>

3.打开admin/category.php

搜索:$cat[‘style’] = !empty($_POST[‘style’]) ? trim($_POST[‘style’]) : ”;

找到 (一共两个地方)

在下面加上
$cat[‘template’] = !empty($_POST[‘template’]) ? trim($_POST[‘template’]) : ”;

4.打开category.php

找到  function get_cat_info($cat_id),要在下面的sql语句里找到 cat_desc, style 在后面加上 ,template

大概在432行:cat_desc, style, template,  grade,

搜索:assign_dynamic(‘category’); // 动态内容

下方找到:$smarty->display(‘category.dwt’, $cache_id);

//修改
  $categorys = $cat[‘template’] ? $cat[‘template’] : ‘category.dwt’; 
  $smarty->display($categorys, $cache_id);

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,129
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,601
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,444
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,218
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,852
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,940