diff --git a/blocks/newbb_block.php b/blocks/newbb_block.php index 9b0e731b..bf9960b9 100644 --- a/blocks/newbb_block.php +++ b/blocks/newbb_block.php @@ -929,11 +929,7 @@ function b_newbb_author_edit($options) function b_newbb_custom($options) { // if no newbb module block set, we have to include the language file - if (is_readable($GLOBALS['xoops']->path('modules/newbb/language/' . $GLOBALS['xoopsConfig']['language'] . '/blocks.php'))) { - require_once $GLOBALS['xoops']->path('modules/newbb/language/' . $GLOBALS['xoopsConfig']['language'] . '/blocks.php'); - } else { - require_once $GLOBALS['xoops']->path('modules/newbb/language/english/blocks.php'); - } + xoops_loadLanguage('blocks', 'newbb'); $options = explode('|', $options); $block = b_newbb_show($options); diff --git a/class/ForumHandler.php b/class/ForumHandler.php index 0d1088e6..a9a63863 100644 --- a/class/ForumHandler.php +++ b/class/ForumHandler.php @@ -37,7 +37,7 @@ public function __construct(\XoopsDatabase $db = null) /** * @param \XoopsObject $object * @param bool $force - * @return bool + * @return bool|int * @internal param \XoopsObject $forum */ public function insert(\XoopsObject $object, $force = true) //insert($forum) diff --git a/class/OnlineHandler.php b/class/OnlineHandler.php index 662d3a91..9ce6fd26 100644 --- a/class/OnlineHandler.php +++ b/class/OnlineHandler.php @@ -257,6 +257,7 @@ public function write($uid, $uname, $time, $forum_id, $ip, $topic_id) return false; } + /** @var \XoopsOnlineHandler $xoopsOnlineHandler */ $xoopsOnlineHandler = \xoops_getHandler('online'); $xoopsOnlineTable = $xoopsOnlineHandler->table; @@ -295,6 +296,7 @@ public function gc($expire) $sql = 'DELETE FROM ' . $this->db->prefix('newbb_online') . ' WHERE online_updated < ' . (\time() - (int)$expire); $this->db->queryF($sql); + /** @var \XoopsOnlineHandler $xoopsOnlineHandler */ $xoopsOnlineHandler = \xoops_getHandler('online'); $xoopsOnlineHandler->gc($expire); } @@ -302,7 +304,7 @@ public function gc($expire) /** * Get an array of online information * - * @param \CriteriaElement|\CriteriaCompo|null $criteria {@link \CriteriaElement} + * @param \CriteriaElement|null $criteria {@link \CriteriaElement} * @return array Array of associative arrays of online information */ public function getAll($criteria = null) @@ -310,7 +312,7 @@ public function getAll($criteria = null) $ret = []; $limit = $start = 0; $sql = 'SELECT * FROM ' . $this->db->prefix('newbb_online'); - if (\is_object($criteria) && $criteria instanceof CriteriaElement) { + if (\is_object($criteria) && ($criteria instanceof \CriteriaCompo || $criteria instanceof \Criteria)) { $sql .= ' ' . $criteria->renderWhere(); $limit = $criteria->getLimit(); $start = $criteria->getStart(); @@ -371,7 +373,7 @@ public function checkStatus($uids) public function getCount($criteria = null) { $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('newbb_online'); - if (\is_object($criteria) && $criteria instanceof CriteriaElement) { + if (\is_object($criteria) && ($criteria instanceof \CriteriaCompo || $criteria instanceof \Criteria)) { $sql .= ' ' . $criteria->renderWhere(); } if (!$result = $this->db->query($sql)) { diff --git a/class/PostHandler.php b/class/PostHandler.php index cb2dd90c..823bf607 100644 --- a/class/PostHandler.php +++ b/class/PostHandler.php @@ -483,7 +483,7 @@ public function getPostCount($criteria = null, $join = null) // LEFT JOIN $sql .= $join; // WHERE - if (null !== $criteria && $criteria instanceof \CriteriaElement) { + if (\is_object($criteria) && is_subclass_of($criteria, \CriteriaElement::class)) { $sql .= ' ' . $criteria->renderWhere(); } if (!$result = $this->db->query($sql)) { @@ -515,7 +515,7 @@ public function getPostsByLimit($criteria = null, $limit = 1, $start = 0, $join if (!empty($join)) { $sql .= $join; } - if (null !== $criteria && $criteria instanceof \CriteriaElement) { + if (\is_object($criteria) && is_subclass_of($criteria, \CriteriaElement::class)) { $sql .= ' ' . $criteria->renderWhere(); if ('' !== $criteria->getSort()) { $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); diff --git a/docs/changelog.txt b/docs/changelog.txt index f1c97a50..83bc8ce1 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -1,4 +1,4 @@ -
5.01 Beta 3 [NOT RELEASED]
Dev: XOOPS 2.5.11, PHP 7.4.14, PHP 8.0.1 +
5.01 Beta 3 [2021-02-14]
Dev: XOOPS 2.5.11, PHP 7.4.14, PHP 8.0.2
- 'isset' replaced with coalesce (mamba) - rename $newbbpermHandler (mamba) diff --git a/xoops_version.php b/xoops_version.php index 91b29548..9447495b 100644 --- a/xoops_version.php +++ b/xoops_version.php @@ -16,7 +16,7 @@ $modversion = [ 'version' => 5.01, 'module_status' => 'Beta 3', - 'release_date' => '2021/01/31', + 'release_date' => '2021/02/14', 'name' => _MI_NEWBB_NAME, 'description' => _MI_NEWBB_DESC, 'help' => 'page=help',