Code Duplication    Length = 21-22 lines in 2 locations

class/Utility.php 1 location

@@ 1029-1050 (lines=22) @@
1026
     * @param $uids
1027
     * @return bool
1028
     */
1029
public static function getUserData($uids)
1030
{
1031
    global $xoopsDB, $xoopsUser, $xoopsUserIsAdmin;
1032
1033
    if ($uids <= 0) {
1034
        return false;
1035
    }
1036
    if ($uids > 0) {
1037
        $memberHandler = xoops_getHandler('member');
1038
        $user          = $memberHandler->getUser($uids);
1039
        if (!is_object($user)) {
1040
            return false;
1041
        }
1042
    }
1043
    $result = $xoopsDB->query('SELECT * FROM ' . $xoopsDB->prefix('users') . " WHERE uid='$uids'");
1044
    if ($xoopsDB->getRowsNum($result) <= 0) {
1045
        return false;
1046
    }
1047
    $row = $xoopsDB->fetchArray($result);
1048
1049
    return $row;
1050
}
1051
1052
    // Get all terms published by an author
1053
    /**

include/functions.php 1 location

@@ 603-623 (lines=21) @@
600
/**
601
 * Validate userid
602
 */
603
function lx_val_user_data($uids) {
604
    global $xoopsDB,$xoopsUser, $xoopsUserIsAdmin;
605
606
    if ($uids<=0) {
607
        return false;
608
    }
609
    if ($uids > 0) {
610
        $member_handler = xoops_gethandler('member');
611
        $user = $member_handler->getUser($uids);
612
        if (!is_object($user)) {
613
            return false;
614
        }
615
    }
616
    $result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("users")." WHERE uid='$uids'");
617
    if ($xoopsDB->getRowsNum($result)<=0) {
618
        return false;
619
    }
620
    $row = $xoopsDB->fetchArray($result);
621
622
    return $row;
623
}
624
625
// Get all terms published by an author
626
function lx_AuthorProfile($uid ) {