修改了字段名writer=>author writetime=>ts_created pubtime=>ts_published

This commit is contained in:
Li Jianxuan 2011-12-26 03:49:05 +00:00
parent 7d71b3e351
commit 07f8c0b12a
4 changed files with 22 additions and 23 deletions

View File

@ -14,7 +14,7 @@ class Admin_NewsController extends Zend_Controller_Action
}
function indexAction()
{
$sql = "select n.*,c.title as catlog from news_archives n left join news_catlog c on n.typeid=c.id order by n.writetime desc limit 10";
$sql = "select n.*,c.title as catlog from news_archives n left join news_catlog c on n.typeid=c.id order by n.ts_created desc limit 10";
$rs = $this->db->query($sql);
$rows = $rs->fetchAll();
$this->view->news = $rows;
@ -37,10 +37,10 @@ class Admin_NewsController extends Zend_Controller_Action
if(!empty($type))
{
$sql = "select n.*,c.title as catlog,c.url from news_archives n left join news_catlog c on n.typeid=c.id WHERE n.typeid='$type' order by n.writetime desc";
$sql = "select n.*,c.title as catlog,c.url from news_archives n left join news_catlog c on n.typeid=c.id WHERE n.typeid='$type' order by n.ts_created desc";
}else
{
$sql = "select n.*,c.title as catlog,c.url from news_archives n left join news_catlog c on n.typeid=c.id order by n.writetime desc";
$sql = "select n.*,c.title as catlog,c.url from news_archives n left join news_catlog c on n.typeid=c.id order by n.ts_created desc";
}
$rs = $this->db->query($sql);
$rows = $rs->fetchAll();
@ -134,15 +134,15 @@ class Admin_NewsController extends Zend_Controller_Action
$id = $this->_request->getParam('id');
if($id>0)
{
$sql = "SELECT arc.id,arc.title,arc.pubtime,arc.typeid,cat.url,cat.id as typeid from news_archives arc
$sql = "SELECT arc.id,arc.title,arc.ts_published,arc.typeid,cat.url,cat.id as typeid from news_archives arc
LEFT JOIN news_catlog cat ON arc.typeid=cat.id
WHERE arc.id=$id";
$rs = $this->db->query($sql);
$rows = $rs->fetch();
if($rows['pubtime']>time())
if($rows['ts_published']>time())
{
$title = "{$rows['title']}》将在".date('Y-m-d H:i',$rows['pubtime'])."发布";
$title = "{$rows['title']}》将在".date('Y-m-d H:i',$rows['ts_published'])."发布";
}
else
{
@ -223,7 +223,7 @@ class Admin_NewsController extends Zend_Controller_Action
'keyword' => $this->db->quote($this->replacehtml($keyword)),
'description'=> $this->db->quote($this->replacehtml($description)),
'image' => $image,
'writetime' => time(),
'ts_created'=> time(),
'pubtime' => $pubtime,
'source' => $source,
'typeid' => $typeid,
@ -233,9 +233,9 @@ class Admin_NewsController extends Zend_Controller_Action
$sql = "INSERT INTO news_archives (title,writer,keyword,description,image,writetime,pubtime,source,typeid,pub)
$sql = "INSERT INTO news_archives (title,author,keyword,description,image,ts_created,ts_published,source,typeid,pub)
VALUES (".$date['title'].",".$date['writer'].",".$date['keyword'].",".$date['description'].",'".$date['image']."',
'{$date['writetime']}',
'{$date['ts_created']}',
'{$date['pubtime']}',
'{$date['source']}',
'{$date['typeid']}',
@ -357,7 +357,6 @@ class Admin_NewsController extends Zend_Controller_Action
'keyword' => $this->replacehtml($keyword),
'description'=> $this->replacehtml($description),
'image' => $image,
'writetime' => time(),
'pubtime' => $pubtime,
'source' => $this->replacehtml($source),
'typeid' => $typeid,
@ -369,11 +368,11 @@ class Admin_NewsController extends Zend_Controller_Action
$sql = "UPDATE news_archives SET
title='{$date['title']}',
writer='{$date['writer']}',
author='{$date['writer']}',
keyword='{$date['keyword']}',
description='{$date['description']}',
image='{$date['image']}',
pubtime='{$date['pubtime']}',
ts_published='{$date['pubtime']}',
source='{$date['source']}',
typeid='{$date['typeid']}',
pub='{$date['pub']}'

View File

@ -49,11 +49,11 @@
<div class="listingDetails">
<div class="pad">
<b>详细信息</b> <a href="javascript:;" class="closepad" style="float:right">关闭</a>
<p>作者:'.$v['writer'].'</p>
<p>作者:'.$v['author'].'</p>
<p>关键词:'.$v['keyword'].'</p>
<p>描述:'.$v['description'].'</p>
<p>添加时间:'.date("Y-m-d H:i",$v['writetime']).'</p>
<p>发布时间:'.date("Y-m-d H:i",$v['pubtime']).'</p>
<p>添加时间:'.date("Y-m-d H:i",$v['ts_created']).'</p>
<p>发布时间:'.date("Y-m-d H:i",$v['ts_published']).'</p>
<p>来源:'.$v['source'].'</p>
<p>点击:'.$v['click'].'</p>
</div>

View File

@ -86,7 +86,7 @@ $(document).ready(function(){
<p>
<label class="required" for="writer">作者</label><br/>
<input type="text" id="writer" class="half title" value="<?php echo $this->ev['writer']; ?>" name="writer"/>
<input type="text" id="writer" class="half title" value="<?php echo $this->ev['author']; ?>" name="writer"/>
</p>
<p>
@ -140,7 +140,7 @@ $(document).ready(function(){
<div class="column width3">
<p>
<input type="checkbox" id="pubtimeturn" name="pubtimer" value="1" /><label id="pubtimelable" for="productcat">定时发布?</label><br/>
<input type="text" name="pubtime" id="pubtime" value="<?php echo date("Y-m-d H:i",$this->ev['pubtime']);?>" readonly="readonly" />
<input type="text" name="pubtime" id="pubtime" value="<?php echo date("Y-m-d H:i",$this->ev['ts_published']);?>" readonly="readonly" />
<small>e.g. 2011-10-28 9:35 or 2011-10-28 21:35</small>
</p>
</div>

View File

@ -68,11 +68,11 @@
<div class="listingDetails">
<div class="pad">
<b>详细信息</b> <a href="javascript:;" class="closepad" style="float:right">关闭</a>
<p>作者:'.$v['writer'].'</p>
<p>作者:'.$v['author'].'</p>
<p>关键词:'.$v['keyword'].'</p>
<p>描述:'.$v['description'].'</p>
<p>添加时间:'.date("Y-m-d H:i",$v['writetime']).'</p>
<p>发布时间:'.date("Y-m-d H:i",$v['pubtime']).'</p>
<p>添加时间:'.date("Y-m-d H:i",$v['ts_created']).'</p>
<p>发布时间:'.date("Y-m-d H:i",$v['ts_published']).'</p>
<p>来源:'.$v['source'].'</p>
<p>点击:'.$v['click'].'</p>
</div>
@ -80,13 +80,13 @@
</td>
<td><a href="/admin/news/newslist/type/'.$v['typeid'].'">'.$v['catlog'].'</a></td>
<td>';
if($v['pubtime']<time() and $v['pub']>0)
if($v['ts_published']<time() and $v['pub']>0)
{
$list.="已发布";
}
if($v['pubtime']>time() and $v['pub']>0)
if($v['ts_published']>time() and $v['pub']>0)
{
$list.= date('Y-m-d H:i',$v['pubtime']) . '发布';
$list.= date('Y-m-d H:i',$v['ts_published']) . '发布';
}
if($v['pub']==0)
{