Code Duplication    Length = 12-13 lines in 2 locations

class/User.php 2 locations

@@ 114-126 (lines=13) @@
111
            $result = $xoopsDB->query($sql);
112
            $i      = $xoopsDB->getRowsNum($result);
113
        }
114
        while (false !== ($row = $xoopsDB->fetchArray($result))) {
115
            if (0 == $i && '' == $i) {
116
                $respons[0] = 0;
117
            }
118
119
            if (1 == $i && 1 == $row['status']) {
120
                $respons[0] = 1;
121
            }
122
            if (1 == $i && 2 == $row['status']) {
123
                $respons[0] = 2;
124
            }
125
126
            return $respons;
127
        }
128
    }
129
@@ 162-173 (lines=12) @@
159
            $sql    = 'SELECT * FROM ' . $xoopsDB->prefix('smallworld_followers') . " WHERE me = '" . (int)$userid . "' AND you = '" . (int)$friendid . "'";
160
            $result = $xoopsDB->query($sql);
161
            $i      = $xoopsDB->getRowsNum($result);
162
            while (false !== ($row = $xoopsDB->fetchArray($result))) {
163
                if (0 == $i) {
164
                    $respons[0] = 0;
165
                }
166
167
                if (1 == $i && 1 == $row['status']) {
168
                    $respons[0] = 1;
169
                }
170
                if (1 == $i && 2 == $row['status']) {
171
                    $respons[0] = 2;
172
                }
173
            }
174
        }
175
176
        return $respons;