PHP Code:
938 $user = $DB_site->query_first("
939 SELECT " .
940 iif(($option & 16), ' administrator.*, ') . "
941 userfield.*, usertextfield.*, user.*, UNIX_TIMESTAMP(passworddate) AS passworddate,
942 IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid" .
943 iif(($option & 1) AND $vboptions['reputationenable'] == 1, ', level') .
944 iif(($option & 2) AND $vboptions['avatarenabled'], ', avatar.avatarpath, NOT ISNULL(customavatar.avatardata) AS hascustomavatar, customavatar.dateline AS avatardateline').
945 iif(($option & 8), ', customprofilepic.userid AS profilepic, customprofilepic.dateline AS profilepicdateline') .
946 iif(!isset($vbphrase), fetch_language_fields_sql(), '') . "
947 FROM " . TABLE_PREFIX . "user AS user
948 LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON (user.userid = userfield.userid)
949 LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON (usertextfield.userid = user.userid) " .
950 iif(($option & 1) AND $vboptions['reputationenable'] == 1, "LEFT JOIN " . TABLE_PREFIX . "reputationlevel AS reputationlevel ON (user.reputationlevelid = reputationlevel.re putationlevelid) ").
951 iif(($option & 2) AND $vboptions['avatarenabled'], "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON (avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customa vatar AS customavatar ON (customavatar.userid = user.userid) ") .
952 iif(($option & 8), "LEFT JOIN " . TABLE_PREFIX . "customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid) ") .
953 iif(($option & 16), "LEFT JOIN " . TABLE_PREFIX . "administrator AS administrator ON (administrator.userid = user.userid) ") .
954 iif(!isset($vbphrase), "INNER JOIN " . TABLE_PREFIX . "language AS language ON (language.languageid = IF(user.languageid = 0, " . intval($vboptions['languageid']) . ", user. languageid)) ")."
955 WHERE user.userid = $userid
956 ");