From b63ed9224a11967fb6066a69023247f5f76a866b Mon Sep 17 00:00:00 2001 From: haoouba <2323333339@qq.com> Date: Sun, 7 Mar 2021 21:31:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/function.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/core/function.php b/core/function.php index 2942d84..f8147bb 100644 --- a/core/function.php +++ b/core/function.php @@ -3,7 +3,7 @@ /* 获取主题当前版本号 */ function _getVersion() { - return "5.6.4"; + return "5.6.5"; }; /* 判断是否是手机 */ @@ -254,16 +254,18 @@ function _getAsideAuthorNav() $prefix = $db->getPrefix(); $sql = "SELECT * FROM `{$prefix}contents` WHERE cid >= (SELECT floor( RAND() * ((SELECT MAX(cid) FROM `{$prefix}contents`)-(SELECT MIN(cid) FROM `{$prefix}contents`)) + (SELECT MIN(cid) FROM `{$prefix}contents`))) and type='post' and status='publish' and (password is NULL or password='') ORDER BY cid LIMIT $limit"; $result = $db->query($sql); - foreach ($result as $item) { - $item = Typecho_Widget::widget('Widget_Abstract_Contents')->push($item); - $title = htmlspecialchars($item['title']); - $permalink = $item['permalink']; - echo " -
  • - {$title} - -
  • - "; + if (is_array($result)) { + foreach ($result as $item) { + $item = Typecho_Widget::widget('Widget_Abstract_Contents')->push($item); + $title = htmlspecialchars($item['title']); + $permalink = $item['permalink']; + echo " +
  • + {$title} + +
  • + "; + } } } }