Code Duplication    Length = 21-22 lines in 2 locations

class/Utility.php 1 location

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

include/functions.php 1 location

@@ 727-747 (lines=21) @@
724
/**
725
 * Validate userid
726
 */
727
function lx_val_user_data($uids) {
728
    global $xoopsDB,$xoopsUser, $xoopsUserIsAdmin;
729
730
    if ($uids<=0) {
731
        return false;
732
    }
733
    if ($uids > 0) {
734
        $member_handler = xoops_gethandler('member');
735
        $user = $member_handler->getUser($uids);
736
        if (!is_object($user)) {
737
            return false;
738
        }
739
    }
740
    $result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("users")." WHERE uid='$uids'");
741
    if ($xoopsDB->getRowsNum($result)<=0) {
742
        return false;
743
    }
744
    $row = $xoopsDB->fetchArray($result);
745
746
    return $row;
747
}
748
749
// Get all terms published by an author
750
function lx_AuthorProfile($uid ) {