• 欢迎访问苗景云的博客

首先在数据库 v9_category 添加字段
然后在 phpcms\modules\admin\templates 目录找到category_add.tpl.php和category_edit.tpl.php然后在里面添加代码: <tr>
        <th><?php echo L('自定义字段名')?>:</th>
        <td><input type="text" name="info[自定义字段名]" id="自定义字段名" class="input-text" value=""></td>
      </tr>

注意:(字段名与数据库添加的字段同步)

发布:苗景云 | 查看全文 | 浏览(1406) | 分类:IT技术&设计 | 评论(0) | 2015年05月24日

内容页当前栏目同级栏目名称

 

           {loop subcat($CAT[parentid]) $v}

发布:苗景云 | 查看全文 | 浏览(1352) | 分类:IT技术&设计 | 评论(0) | 2015年05月23日
{loop subcat(0,0,0,$siteid) $r}
{php $num++}
<div class="box cat-area" {if $num%2!=0}style=" margin-right:10px"{/if}>
        <h5 class="title-1">{$r[catname]}<a href="{$r[url]}" class="more">鏇村>></a></h5>
     <div class="content">
     {pc:content  action="lists" catid="$r[catid]" order="updatetime DESC" thumb="1" num="1" return="info"}
     {loop $info $v}
        <p>
            <img src="{thumb($v[thumb],90,0)}" width="90" height="60"/>
            <strong><a href="{$v['url']}" target="_blank" title="{$v['title']}"{title_style($v[style])}>{str_cut($v['title'],28)}</a></strong><br />{str_cut($v['description'],100)}
        </p>
      {/loop}
      {/pc}                
        <div class="bk15 hr"></div>
        {pc:content action="lists" catid="$r[catid]" num="5" order="id DESC" return="info"}
 
        <ul class="list lh24 f14">
        {loop $info $v}
            <li>路<a href="{$v['url']}" target="_blank" title="{$v['title']}"{title_style($v[style])}>{str_cut($v['title'],40)}</a></li>
        {/loop}
        </ul>
        {/pc}
    </div>
</div>
{if $num%2==0}<div class="bk10"></div>{/if}
{/loop}


发布:苗景云 | 查看全文 | 浏览(1610) | 分类:IT技术&设计 | 评论(0) | 2015年05月19日

Mysql使用Update在原字段内容上追加

update 数据表 set 字段=concat("http://www.foshang.net/",字段) where id between 'id' and 'id'

发布:苗景云 | 查看全文 | 浏览(1885) | 分类:IT技术&设计 | 评论(0) | 2015年05月16日
PHPCMS用户知道,要调用推荐文章的话,可以用默认的推荐位标签实现,例如
{pc:content action="position" posid="10" catid="$catid" num="20" order="id DESC" cache="3600"}
{loop $data $r}
<p class="list"><a href="{$r[url]}" title="{$r[title]}">{$r[title]}</a></p>
{/loop}
{/pc}
 
调用当前栏目推荐文章的办法
 
但是只能调用一个属性的推荐位,如果有时候需要调用当前栏目的推荐文章应该怎么办? 可以尝试一下代码!


发布:苗景云 | 查看全文 | 浏览(1692) | 分类:IT技术&设计 | 评论(0) | 2015年05月16日

v9数据源调用,数据标签不能加引号
{loop $data $v}
<a href={$v[url]} title={$v[title]}>{$v[title]}</a>
{/loop}
如上,href 值 title值均不能加引号。
希望能帮到你

发布:苗景云 | 查看全文 | 浏览(1525) | 分类:IT技术&设计 | 评论(0) | 2015年05月15日

ecshop的商品列表页中,我们是没有让商品按人气或者说是点击量进行排序的,ecshop程序本身可以让商品按价格、上架时间、更新时间这个参数进行排序,但是很多实际需要的时候,我们需要对商品进行一个人气排序的功能的实现。

下面,我们就详细的说一下怎么进行二次开发来实现商品按点击量排序

第一步:
打开category.php这个文件,找到这句代码:
$sort  = (isset($_REQUEST['sort'])  && in_array(trim(strtolower($_REQUEST['sort'])), array('goods_id', 'shop_price', 'last_update', 'click_count'))) ? trim($_REQUEST['sort'])  : $default_sort_order_type;
我们把这句代码修改为:
$sort  = (isset($_REQUEST['sort'])  && in_array(trim(strtolower($_REQUEST['sort'])), array('goods_id', 'shop_price', 'last_update'))) ? trim($_REQUEST['sort'])  : $default_sort_order_type;

在代码中我们添加了一个变量 click_count,这个变量我们的表中有,所以我们不需要自己定义,直接调用就可以了。
现在,程序的部分就调用好了。

第二步:
打开我们的goods_list.lbi,在我们需要添加商品按人气排序的地方添加下边的代码:

<a href="{$script_name}.php?category={$category}&display={$pager.display}&brand={$brand_id}&price_min={$price_min}&price_max={$price_max}&filter_attr={$filter_attr}&page={$pager.page}&sort=click_count&order=<!-- {if $pager.sort == 'click_count' && $pager.order == 'DESC'} -->ASC<!-- {else} -->DESC<!-- {/if} -->#goods_list">人气排列</a>

这样呢,就大功告成了。

发布:苗景云 | 查看全文 | 浏览(1461) | 分类:IT技术&设计 | 评论(0) | 2015年05月03日
« 之后的文章苗景云的博客
<< 向左走,向右走 >>
更早的文章 »