Completed
Push — master ( 583920...a73650 )
by Michael
02:19
created

waiting.plugin.php ➔ b_waiting_presenter()   B

Complexity

Conditions 3
Paths 4

Size

Total Lines 27
Code Lines 18

Duplication

Lines 10
Ratio 37.04 %

Importance

Changes 0
Metric Value
cc 3
eloc 18
nc 4
nop 0
dl 10
loc 27
rs 8.8571
c 0
b 0
f 0
1
<?php
2
/*
3
 You may not change or alter any portion of this comment or credits
4
 of supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit authors.
6
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
/**
12
 * presenter module for xoops
13
 *
14
 * @copyright       XOOPS Project (http://xoops.org)
15
 * @license         GPL 2.0 or later
16
 * @package         presenter
17
 * @since           2.5.5
18
 * @author          XOOPS Development Team <[email protected]> - <http://xoops.org>
19
 * @version         $Id: 1.0 waiting.plugin.php 11532 Wed 2013/08/28 4:00:28Z XOOPS Development Team $
20
 */
21
function b_waiting_presenter()
22
{
23
    $db  =& XoopsDatabaseFactory::getDatabaseConnection();
24
    $ret = array();
25
26
    // waiting categories
27
    $block  = array();
28
    $result = $db->query("SELECT COUNT(*) FROM " . $db->prefix('presenter_categories') . " WHERE cat_waiting = 1");
29 View Code Duplication
    if ($result) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
30
        $block['adminlink'] = XOOPS_URL . "/modules/presenter/admin/categories.php?op=list_waiting";
31
        list($block['pendingnum']) = $db->fetchRow($result);
32
        $block['lang_linkname'] = _MB_PRESENTER_CATEGORIES_WAITING;
33
    }
34
    $ret[] = $block;
35
36
    // waiting slides
37
    $block  = array();
38
    $result = $db->query("SELECT COUNT(*) FROM " . $db->prefix('presenter_slides') . " WHERE slides_waiting = 1");
39 View Code Duplication
    if ($result) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
40
        $block['adminlink'] = XOOPS_URL . "/modules/presenter/admin/slides.php?op=list_waiting";
41
        list($block['pendingnum']) = $db->fetchRow($result);
42
        $block['lang_linkname'] = _MB_PRESENTER_SLIDES_WAITING;
43
    }
44
    $ret[] = $block;
45
46
    return $ret;
47
}
48