Conditions | 3 |
Paths | 3 |
Total Lines | 24 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
6 | function b_waiting_newbb() |
||
7 | { |
||
8 | /** @var \XoopsMySQLDatabase $xoopsDB */ |
||
9 | $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection(); |
||
10 | $ret = []; |
||
11 | $block = []; |
||
12 | |||
13 | // judge the version of newbb/ |
||
14 | if (!file_exists(XOOPS_ROOT_PATH . '/modules/newbb/polls.php')) { |
||
15 | // newbb1 |
||
16 | return []; |
||
17 | } |
||
18 | |||
19 | // works with newbb2 or CBB 1.14 |
||
20 | $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('newbb_posts') . ' WHERE approved=0'); |
||
21 | if ($result) { |
||
22 | $block['adminlink'] = XOOPS_URL . '/modules/newbb/admin/index.php'; |
||
23 | [$block['pendingnum']] = $xoopsDB->fetchRow($result); |
||
|
|||
24 | $block['lang_linkname'] = _PI_WAITING_SUBMITTED; |
||
25 | } |
||
26 | |||
27 | $ret[] = $block; |
||
28 | |||
29 | return $ret; |
||
30 | } |
||
31 |