Code Duplication    Length = 10-12 lines in 2 locations

class/WallUpdates.php 2 locations

@@ 75-86 (lines=12) @@
72
            $query = 'SELECT M.msg_id, M.uid_fk, M.priv, M.message, M.created, U.username FROM ' . $xoopsDB->prefix('smallworld_messages') . ' M, ' . $xoopsDB->prefix('smallworld_user') . " U  WHERE M.uid_fk=U.userid AND M.uid_fk='" . $uid . "'";
73
        }
74
75
        if (is_array($followers)) {
76
            foreach ($followers as $k => $v) {
77
                if ($last > 0) {
78
                    $query .= " OR M.uid_fk=U.userid and M.uid_fk= '" . $v . "' and M.msg_id < '" . $last . "'";
79
                } elseif (0 == $last) {
80
                    $query .= " OR M.uid_fk=U.userid and M.uid_fk= '" . $v . "'";
81
                } elseif ('a' === $last) {
82
                    $query .= " OR M.uid_fk=U.userid and M.uid_fk= '" . $v . "'";
83
                }
84
                ++$i;
85
            }
86
        }
87
        if (!is_array($followers)) {
88
            $followers = $uid;
89
            if ($last > 0) {
@@ 87-96 (lines=10) @@
84
                ++$i;
85
            }
86
        }
87
        if (!is_array($followers)) {
88
            $followers = $uid;
89
            if ($last > 0) {
90
                $query .= " OR M.uid_fk=U.userid and M.uid_fk= '" . $followers . "' and M.msg_id < '" . $last . "'";
91
            } elseif (0 == $last) {
92
                $query .= " OR M.uid_fk=U.userid and M.uid_fk= '" . $followers . "'";
93
            } elseif ('a' === $last) {
94
                $query .= " OR M.uid_fk=U.userid and M.uid_fk= '" . $followers . "'";
95
            }
96
        }
97
98
        if ($last > 0) {
99
            $query .= ' order by created DESC LIMIT ' . $hm;