Code Duplication    Length = 12-13 lines in 2 locations

class/User.php 2 locations

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