query("SELECT t1.TreePosition, t1.TreeID, t1.TreeLevel, (SELECT t2.TreePosition FROM invite_tree AS t2 WHERE TreeID=t1.TreeID AND TreeLevel=t1.TreeLevel AND t2.TreePosition>t1.TreePosition ORDER BY TreePosition LIMIT 1 ) AS MaxPosition FROM invite_tree AS t1 WHERE t1.UserID=$UserID"); list ($TreePosition, $TreeID, $TreeLevel, $MaxPosition) = $DB->next_record(); if (!$MaxPosition) { $MaxPosition = 1000000; } // $MaxPermission is null if the user is the last one in that tree on that level if (!$TreeID) { return; } $DB->query(" SELECT UserID FROM invite_tree WHERE TreeID=$TreeID AND TreePosition>$TreePosition AND TreePosition<$MaxPosition AND TreeLevel>$TreeLevel ORDER BY TreePosition"); $BanList = array(); while (list ($Invitee) = $DB->next_record()) { $BanList[] = $Invitee; } foreach ($BanList as $Key => $InviteeID) { if ($_POST['perform'] == 'nothing') { Tools::update_user_notes($InviteeID, $Comment . "\n\n"); $Msg = "Successfully commented on entire invite tree!"; } elseif ($_POST['perform'] == 'disable') { Tools::disable_users($InviteeID, $Comment); $Msg = "Successfully banned entire invite tree!"; } elseif ($_POST['perform'] == 'inviteprivs') { // DisableInvites =1 Tools::update_user_notes($InviteeID, $Comment . "\n\n"); $DB->query("UPDATE users_info SET DisableInvites='1' WHERE UserID='" . $InviteeID . "'"); $Msg = "Successfully removed invite privileges from entire tree!"; } else { error(403); } } } ?>

UserID Mandatory comment!
Action: