Completed
Push — master ( c8eead...62889a )
by Michael
04:13
created

include/waiting.plugin.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 23 and the first side effect is on line 86.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
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
 * animal module for xoops
13
 *
14
 * @copyright       The TXMod XOOPS Project http://sourceforge.net/projects/thmod/
15
 * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/
16
 * @license         GPL 2.0 or later
17
 * @package         animal
18
 * @since           2.5.x
19
 * @author          XOOPS Development Team ( [email protected] ) - ( http://xoops.org )
20
 * @version         $Id: const_entete.php 9860 2012-07-13 10:41:41Z txmodxoops $
21
 */
22
23
function b_waiting_animal()
24
{
25
    $xoopsDB =& XoopsDatabaseFactory::getDatabaseConnection();
26
    $ret     = array();
27
28
    // waiting pedigree_trash
29
    $block = array();
30
31
    $result = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("pedigree_trash") . " WHERE pedigree_trash_waiting=1");
32 View Code Duplication
    if ($result) {
33
        $block['adminlink'] = XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/pedigree_trash.php?op=listWaiting";
34
        list($block['pendingnum']) = $xoopsDB->fetchRow($result);
35
        $block['lang_linkname'] = _PI_WAITING_WAITINGS;
36
    }
37
    $ret[] = $block;
38
39
    // waiting mod_owner
40
    $block = array();
41
42
    $result = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("pedigree_owner") . " WHERE owner_waiting=1");
43 View Code Duplication
    if ($result) {
44
        $block['adminlink'] = XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/owner.php?op=listWaiting";
45
        list($block['pendingnum']) = $xoopsDB->fetchRow($result);
46
        $block['lang_linkname'] = _PI_WAITING_WAITINGS;
47
    }
48
    $ret[] = $block;
49
50
    // waiting pedigree_temp
51
    $block = array();
52
53
    $result = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("pedigree_temp") . " WHERE pedigree_temp_waiting=1");
54 View Code Duplication
    if ($result) {
55
        $block['adminlink'] = XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/pedigree_temp.php?op=listWaiting";
56
        list($block['pendingnum']) = $xoopsDB->fetchRow($result);
57
        $block['lang_linkname'] = _PI_WAITING_WAITINGS;
58
    }
59
    $ret[] = $block;
60
61
    // waiting pedigree
62
    $block = array();
63
64
    $result = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("pedigree_tree") . " WHERE pedigree_waiting=1");
65 View Code Duplication
    if ($result) {
66
        $block['adminlink'] = XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/pedigree.php?op=listWaiting";
67
        list($block['pendingnum']) = $xoopsDB->fetchRow($result);
68
        $block['lang_linkname'] = _PI_WAITING_WAITINGS;
69
    }
70
    $ret[] = $block;
71
72
    // waiting pedigree_config
73
    $block = array();
74
75
    $result = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("pedigree_fields") . " WHERE pedigree_config_waiting=1");
76 View Code Duplication
    if ($result) {
77
        $block['adminlink'] = XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/pedigree_config.php?op=listWaiting";
78
        list($block['pendingnum']) = $xoopsDB->fetchRow($result);
79
        $block['lang_linkname'] = _PI_WAITING_WAITINGS;
80
    }
81
    $ret[] = $block;
82
83
    return $ret;
84
}
85
86
;
87