You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 lines
1.1 KiB

<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
/**
* 最新文章
*
* @category typecho
* @package Widget
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org)
* @license GNU General Public License 2.0
* @version $Id$
*/
/**
* 最新评论组件
*
* @category typecho
* @package Widget
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org)
* @license GNU General Public License 2.0
*/
class Widget_Contents_Post_Recent extends Widget_Abstract_Contents
{
/**
* 执行函数
*
* @access public
* @return void
*/
public function execute()
{
$this->parameter->setDefault(array('pageSize' => $this->options->postsListSize));
$this->db->fetchAll($this->select()
->where('table.contents.status = ?', 'publish')
->where('table.contents.created < ?', $this->options->gmtTime)
->where('table.contents.type = ?', 'post')
->order('table.contents.created', Typecho_Db::SORT_DESC)
->limit($this->parameter->pageSize), array($this, 'push'));
}
}