diff --git a/core/function.php b/core/function.php index 502769c..50d3ab6 100644 --- a/core/function.php +++ b/core/function.php @@ -3,7 +3,7 @@ /* 获取主题当前版本号 */ function _getVersion() { - return "5.1.5"; + return "5.1.6"; }; /* 判断是否是手机 */ diff --git a/core/route.php b/core/route.php index 24ef68a..00d533c 100644 --- a/core/route.php +++ b/core/route.php @@ -50,7 +50,7 @@ function _getPost($self) "agree" => _getAgree($item, false), "permalink" => $item->permalink, "lazyload" => _getLazyload(false), - "type" => "sticky" + "type" => "sticky", ); } } @@ -64,9 +64,9 @@ function _getPost($self) "title" => $item->title, "abstract" => _getAbstract($item, false), "category" => $item->categories, - "views" => _getViews($item, false), + "views" => $item->views, "commentsNum" => number_format($item->commentsNum), - "agree" => _getAgree($item, false), + "agree" => $item->agree, "permalink" => $item->permalink, "lazyload" => _getLazyload(false), "type" => "normal" diff --git a/core/widget.php b/core/widget.php index a2295ad..a13ed9f 100644 --- a/core/widget.php +++ b/core/widget.php @@ -4,8 +4,10 @@ class Widget_Contents_Hot extends Widget_Abstract_Contents public function execute() { $this->parameter->setDefault(array('pageSize' => 10)); + $select = $this->select(); + $select->cleanAttribute('fields'); $this->db->fetchAll( - $this->select()->from('table.contents') + $select->from('table.contents') ->where("table.contents.password IS NULL OR table.contents.password = ''") ->where('table.contents.status = ?', 'publish') ->where('table.contents.created <= ?', time()) @@ -23,8 +25,10 @@ class Widget_Contents_Sort extends Widget_Abstract_Contents { $this->parameter->setDefault(array('page' => 1, 'pageSize' => 10, 'type' => 'created')); $offset = $this->parameter->pageSize * ($this->parameter->page - 1); + $select = $this->select(); + $select->cleanAttribute('fields'); $this->db->fetchAll( - $this->select() + $select ->from('table.contents') ->where('table.contents.type = ?', 'post') ->where('table.contents.status = ?', 'publish') diff --git a/index.php b/index.php index eeed38a..990ba92 100644 --- a/index.php +++ b/index.php @@ -114,7 +114,7 @@
  • - + views(); ?> ℃ <?php $item->title(); ?>
    title(); ?>
    diff --git a/public/aside.php b/public/aside.php index f05f915..d2da3ba 100644 --- a/public/aside.php +++ b/public/aside.php @@ -60,7 +60,7 @@ <?php $item->title() ?>
    title(); ?>
    - 阅读 - date('m/d'); ?> + views(); ?> 阅读 - date('m/d'); ?>
  • diff --git a/public/header.php b/public/header.php index 8b97a95..9d579b4 100644 --- a/public/header.php +++ b/public/header.php @@ -146,7 +146,7 @@ title(); ?> - 阅读 + views(); ?> 阅读