Code Duplication    Length = 20-20 lines in 2 locations

class/db.php 1 location

@@ 90-109 (lines=20) @@
87
     * @param int $id
88
     * @returns Array
89
     */
90
    public function getScreennamesToDiv($id)
91
    {
92
        global $xoopsUser, $xoopsDB, $arr06;
93
        $msg    = [];
94
        $sql    = 'SELECT screenname_type,screenname FROM ' . $xoopsDB->prefix('smallworld_user') . " WHERE userid ='" . $id . "'";
95
        $result = $xoopsDB->query($sql);
96
        while ($row = $xoopsDB->fetchArray($result)) {
97
            $screenname_type = unserialize($row['screenname_type']);
98
            $screenname      = unserialize($row['screenname']);
99
        }
100
        $start = 0;
101
        $end   = count($screenname_type) - 1;
102
        while ($start <= $end) {
103
            $msg[$start]['screenname']      = $screenname_type[$start];
104
            $msg[$start]['screenname_type'] = $arr06[$screenname[$start]];
105
            $msg[$start]['link']            = "<span class='smallworld_website'>" . Smallworld_sociallinks($screenname[$start], $msg[$start]['screenname']);
106
            ++$start;
107
        }
108
        return $msg;
109
    }
110
111
    /**
112
     * getVar function

class/SmallWorldDB.php 1 location

@@ 92-111 (lines=20) @@
89
     * @param int $id
90
     * @return array
91
     */
92
    public function getScreennamesToDiv($id)
93
    {
94
        global $xoopsUser, $xoopsDB, $arr06;
95
        $msg    = [];
96
        $sql    = 'SELECT screenname_type,screenname FROM ' . $xoopsDB->prefix('smallworld_user') . " WHERE userid ='" . $id . "'";
97
        $result = $xoopsDB->query($sql);
98
        while ($row = $xoopsDB->fetchArray($result)) {
99
            $screenname_type = unserialize($row['screenname_type']);
100
            $screenname      = unserialize($row['screenname']);
101
        }
102
        $start = 0;
103
        $end   = count($screenname_type) - 1;
104
        while ($start <= $end) {
105
            $msg[$start]['screenname']      = $screenname_type[$start];
106
            $msg[$start]['screenname_type'] = $arr06[$screenname[$start]];
107
            $msg[$start]['link']            = "<span class='smallworld_website'>" . Smallworld_sociallinks($screenname[$start], $msg[$start]['screenname']);
108
            ++$start;
109
        }
110
        return $msg;
111
    }
112
113
    /**
114
     * getVar function