From 07f8c0b12ae7b05128d02726be3057f3438debd4 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Mon, 26 Dec 2011 03:49:05 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=90=8Dwriter=3D>author=20writetime=3D>ts=5Fcreated=20pubtime?= =?UTF-8?q?=3D>ts=5Fpublished?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/NewsController.php | 23 +++++++++---------- .../admin/views/scripts/news/index.phtml | 6 ++--- .../admin/views/scripts/news/newsedit.phtml | 4 ++-- .../admin/views/scripts/news/newslist.phtml | 12 +++++----- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/application/admin/controllers/NewsController.php b/application/admin/controllers/NewsController.php index 115243a6..554c70ac 100644 --- a/application/admin/controllers/NewsController.php +++ b/application/admin/controllers/NewsController.php @@ -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']}' diff --git a/application/admin/views/scripts/news/index.phtml b/application/admin/views/scripts/news/index.phtml index a8d2eb00..fb8e7e43 100644 --- a/application/admin/views/scripts/news/index.phtml +++ b/application/admin/views/scripts/news/index.phtml @@ -49,11 +49,11 @@
详细信息 关闭 -

作者:'.$v['writer'].'

+

作者:'.$v['author'].'

关键词:'.$v['keyword'].'

描述:'.$v['description'].'

-

添加时间:'.date("Y-m-d H:i",$v['writetime']).'

-

发布时间:'.date("Y-m-d H:i",$v['pubtime']).'

+

添加时间:'.date("Y-m-d H:i",$v['ts_created']).'

+

发布时间:'.date("Y-m-d H:i",$v['ts_published']).'

来源:'.$v['source'].'

点击:'.$v['click'].'

diff --git a/application/admin/views/scripts/news/newsedit.phtml b/application/admin/views/scripts/news/newsedit.phtml index 609a6a0e..2b739333 100644 --- a/application/admin/views/scripts/news/newsedit.phtml +++ b/application/admin/views/scripts/news/newsedit.phtml @@ -86,7 +86,7 @@ $(document).ready(function(){


- +

@@ -140,7 +140,7 @@ $(document).ready(function(){


- ev['pubtime']);?>" readonly="readonly" /> + ev['ts_published']);?>" readonly="readonly" /> e.g. 2011-10-28 9:35 or 2011-10-28 21:35

diff --git a/application/admin/views/scripts/news/newslist.phtml b/application/admin/views/scripts/news/newslist.phtml index 609e455d..cde84349 100644 --- a/application/admin/views/scripts/news/newslist.phtml +++ b/application/admin/views/scripts/news/newslist.phtml @@ -68,11 +68,11 @@
详细信息 关闭 -

作者:'.$v['writer'].'

+

作者:'.$v['author'].'

关键词:'.$v['keyword'].'

描述:'.$v['description'].'

-

添加时间:'.date("Y-m-d H:i",$v['writetime']).'

-

发布时间:'.date("Y-m-d H:i",$v['pubtime']).'

+

添加时间:'.date("Y-m-d H:i",$v['ts_created']).'

+

发布时间:'.date("Y-m-d H:i",$v['ts_published']).'

来源:'.$v['source'].'

点击:'.$v['click'].'

@@ -80,13 +80,13 @@ '.$v['catlog'].' '; - if($v['pubtime']0) + if($v['ts_published']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) {