Code Duplication    Length = 13-14 lines in 2 locations

include/notification.inc.php 2 locations

@@ 39-52 (lines=14) @@
36
37
    global $xoopsDB;
38
39
    if ('story' === $category) {
40
        // Assume we have a valid story id
41
        $sql    = 'SELECT title FROM ' . $xoopsDB->prefix('news_stories') . ' WHERE storyid = ' . (int)$item_id;
42
        $result = $xoopsDB->query($sql);
43
        if ($result) {
44
            $result_array = $xoopsDB->fetchArray($result);
45
            $item['name'] = $result_array['title'];
46
            $item['url']  = XOOPS_URL . '/modules/news/article.php?storyid=' . (int)$item_id;
47
48
            return $item;
49
        } else {
50
            return null;
51
        }
52
    }
53
54
    // Added by Lankford on 2007/3/23
55
    if ('category' === $category) {
@@ 55-67 (lines=13) @@
52
    }
53
54
    // Added by Lankford on 2007/3/23
55
    if ('category' === $category) {
56
        $sql    = 'SELECT title FROM ' . $xoopsDB->prefix('news_topics') . ' WHERE topic_id = ' . (int)$item_id;
57
        $result = $xoopsDB->query($sql);
58
        if ($result) {
59
            $result_array = $xoopsDB->fetchArray($result);
60
            $item['name'] = $result_array['topic_id'];
61
            $item['url']  = XOOPS_URL . '/modules/news/index.php?storytopic=' . (int)$item_id;
62
63
            return $item;
64
        } else {
65
            return null;
66
        }
67
    }
68
69
    return null;
70
}