您的位置:首页 > 其它

destoon 如何添加一个字段

2013-01-21 09:46 639 查看
1.在destoon_article_30 表加上一个字段,pubdate 类型varchar 30 注释:发布日期

2.在article.class.php 中的

$this->fields = array('catid','areaid','level','title','style','fee','subtitle','introduce','thumb','tag','author','copyfrom','fromurl','voteid','status','hits','username','addtime',

'editor','edittime','ip','template','islink','linkurl','filepath','note');

在后面加上字段:

'pubdate'

3.在module/company/otnews.inc.php中在第19行这段代码后面

$item[adddate] = timetodate($item['addtime'], 3);

加上如下代码

$item[pubdate]=$item['pubdate'];

4.前台显示在template/default/homepage/otnews.htm中:



<tr>

<td class="thtr">{$JP['totime']}</td>

<td class="rtitle">{$adddate}</td>

</tr>

改为:

<tr>

<td class="thtr">{$JP['totime']}</td>

<td class="rtitle"><?php if($pubdate !='0'){ ?>{$pubdate}<?php }?></td>

</tr>



{loop $fglists $v}

<tr>

<td><a href="{$v[linkurl]}">{$v[title]}</a></td>

<td><a href="{$v[clinkurl]}">{$v[catname]}</a></td>

<td style="font-size:11px;">{$v[adddate]}</td>

</tr>

{/loop}

改为:

{loop $fglists $v}

<tr>

<td><a href="{$v[linkurl]}">{$v[title]}</a></td>

<td><a href="{$v[clinkurl]}">{$v[catname]}</a></td>

<td style="font-size:11px;"><?php if($v[pubdate] !='0'){ ?>{$v[pubdate]}<?php }?></td>

</tr>

{/loop}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: