Code Duplication    Length = 10-10 lines in 2 locations

include/notification.inc.php 2 locations

@@ 36-45 (lines=10) @@
33
34
    global $xoopsDB;
35
36
    if ($category === 'category') {
37
        // Assume we have a valid category id
38
        $sql          = 'SELECT name FROM ' . $xoopsDB->prefix('smartfaq_categories') . ' WHERE categoryid  = ' . $item_id;
39
        $result       = $xoopsDB->query($sql); // TODO: error check
40
        $result_array = $xoopsDB->fetchArray($result);
41
        $item['name'] = $result_array['name'];
42
        $item['url']  = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/category.php?categoryid=' . $item_id;
43
44
        return $item;
45
    }
46
47
    if ($category === 'faq') {
48
        // Assume we have a valid story id
@@ 47-56 (lines=10) @@
44
        return $item;
45
    }
46
47
    if ($category === 'faq') {
48
        // Assume we have a valid story id
49
        $sql          = 'SELECT question FROM ' . $xoopsDB->prefix('smartfaq_faq') . ' WHERE faqid = ' . $item_id;
50
        $result       = $xoopsDB->query($sql); // TODO: error check
51
        $result_array = $xoopsDB->fetchArray($result);
52
        $item['name'] = $result_array['question'];
53
        $item['url']  = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/faq.php?faqid=' . $item_id;
54
55
        return $item;
56
    }
57
}
58