This commit is contained in:
haoouba 2021-02-18 22:02:19 +08:00
parent 86e77cbbc1
commit 9d29106040
6 changed files with 13 additions and 9 deletions

View File

@ -3,7 +3,7 @@
/* 获取主题当前版本号 */
function _getVersion()
{
return "5.1.5";
return "5.1.6";
};
/* 判断是否是手机 */

View File

@ -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"

View File

@ -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')

View File

@ -114,7 +114,7 @@
<li class="item">
<a class="link" href="<?php $item->permalink(); ?>" title="<?php $item->title(); ?>">
<figure class="inner">
<span class="views"><?php _getViews($item); ?> ℃</span>
<span class="views"><?php $item->views(); ?> ℃</span>
<img class="image lazyload" src="<?php _getLazyload(); ?>" data-src="<?php echo _getThumbnails($item)[0]; ?>" onerror="javascript: this.src='<?php _getLazyload() ?>';" alt="<?php $item->title(); ?>" />
<figcaption class="title"><?php $item->title(); ?></figcaption>
</figure>

View File

@ -60,7 +60,7 @@
<img class="image lazyload" src="<?php _getLazyload(); ?>" data-src="<?php echo _getThumbnails($item)[0]; ?>" onerror="javascript: this.src='<?php _getLazyload() ?>';" alt="<?php $item->title() ?>" />
<div class="describe">
<h6><?php $item->title(); ?></h6>
<span><?php _getViews($item); ?> 阅读 - <?php $item->date('m/d'); ?></span>
<span><?php $item->views(); ?> 阅读 - <?php $item->date('m/d'); ?></span>
</div>
</a>
</li>

View File

@ -146,7 +146,7 @@
<a href="<?php $item->permalink(); ?>" title="<?php $item->title(); ?>" class="item">
<span class="sort"><?php echo $index; ?></span>
<span class="text"><?php $item->title(); ?></span>
<span class="views"><?php _getViews($item); ?> 阅读</span>
<span class="views"><?php $item->views(); ?> 阅读</span>
</a>
<?php $index++; ?>
<?php endwhile; ?>