comment_functions.php ➔ mylinks_com_update()   A
last analyzed

Complexity

Conditions 5
Paths 16

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
nc 16
nop 2
dl 0
loc 10
rs 9.6111
c 0
b 0
f 0
1
<?php
2
// comment callback functions
3
4
/**
5
 * @param $link_id
6
 * @param $total_num
7
 */
8
function mylinks_com_update($link_id, $total_num)
9
{
10
    $link_id   = isset($link_id) ? (int)$link_id : 0;
11
    $total_num = (isset($total_num) && ((int)$total_num > 0)) ? (int)$total_num : 0;
12
    if ($link_id > 0) {
13
        $db  = XoopsDatabaseFactory::getDatabaseConnection();
14
        $sql = 'UPDATE ' . $db->prefix('mylinks_links') . " SET comments={$total_num} WHERE lid={$link_id}";
15
        $db->query($sql);
16
    }
17
}
18
19
/**
20
 * @param $comment
21
 */
22
function mylinks_com_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...
23
{
24
    // notification mail here
25
}
26