= UC_GLOBAL_MODERATOR) { $ret = sql_query("SELECT username, donor, warned, status, invitees FROM users WHERE user_id = $id") or sqlerr(__FILE__, __LINE__); $arr = mysql_fetch_assoc($ret); if ($arr) $user = "$arr[username]".get_user_icons($arr, true); } if (!$user) { $id = $CURUSER["user_id"]; $arr = $CURUSER; } if ($CURUSER["class"] < UC_GLOBAL_MODERATOR) $num = 3; else $num = 10; if ($arr["invitees"] < 1) stderr("No invitees", "It appears that ".($arr == $CURUSER ? "you have" : "the user you are trying to view the invite tree of has")." not yet invited any users."); for ($i = 1; $i <= $num; $i++) { $fields[] = "u{$i}.username as user{$i}_username, u{$i}.downloaded AS user{$i}_downloaded, u{$i}.uploaded AS user{$i}_uploaded, u{$i}.user_id AS user{$i}_user_id, u{$i}.donor AS user{$i}_donor, u{$i}.warned AS user{$i}_warned, u{$i}.status AS user{$i}_status"; $where[] = "LEFT JOIN users AS u{$i} ON u{$i}.invited_by = u".($i - 1).".user_id"; $order[] = "user{$i}_username ASC"; } stdhead("Invite Tree"); print("

".($user ? "Invite tree of $user" : "My invite tree")."

\n"); print("
\n"); print("\n"); print("
\n"); stdfoot(); ?>