comment_functions.php ➔ apcal_comments_approve()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
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
/**
13
 * @copyright   {@link http://xoops.org/ XOOPS Project}
14
 * @license     {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
15
 * @package
16
 * @since
17
 * @author       XOOPS Development Team,
18
 * @author       GIJ=CHECKMATE (PEAK Corp. http://www.peak.ne.jp/)
19
 */
20
21
if (!defined('APCAL_COMMENT_FUNCTIONS_INCLUDED')) {
22
    define('APCAL_COMMENT_FUNCTIONS_INCLUDED', 1);
23
24
    // comment callback functions
25
26
    /**
27
     * @param $event_id
28
     * @param $total_num
29
     * @return mixed
30
     */
31
    function apcal_comments_update($event_id, $total_num)
32
    {
33
        // record total_num
34
        global $xoopsDB, $cal;
35
36
        if (is_object($cal)) {
37
            $tablename = $cal->table;
38
        } else {
39
            $moduleDirName = basename(dirname(__DIR__));
40
            if (!preg_match('/^(\D+)(\d*)$/', $moduleDirName, $regs)) {
41
                echo('invalid dirname: ' . htmlspecialchars($moduleDirName));
42
            }
43
            $mydirnumber = $regs[2] === '' ? '' : (int)$regs[2];
44
            $tablename   = $GLOBALS['xoopsDB']->prefix("apcal{$mydirnumber}_event");
45
        }
46
47
        $ret = $GLOBALS['xoopsDB']->query("UPDATE $tablename SET comments=$total_num WHERE id=$event_id");
48
49
        return $ret;
50
    }
51
52
    /**
53
     * @param $comment
54
     */
55
    function apcal_comments_approve(&$comment)
0 ignored issues
show
Unused Code introduced by
The parameter $comment is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
56
    {
57
        // notification mail here
58
    }
59
}
60