/************************************************************************ //------------// Main friends page //----------------------------------// This page lists a user's friends. There's no real point in caching this page. I doubt users load it that much. ************************************************************************/ // Number of users per page define('FRIENDS_PER_PAGE', '20'); show_header('Friends'); $UserID = $LoggedUser['ID']; list($Page,$Limit) = page_limit(FRIENDS_PER_PAGE); // Main query $DB->query("SELECT SQL_CALC_FOUND_ROWS f.FriendID, f.Comment, m.Username, m.Uploaded, m.Downloaded, m.PermissionID, m.Enabled, m.Paranoia, i.Donor, i.Warned, m.Title, m.LastAccess, i.Avatar FROM friends AS f JOIN users_main AS m ON f.FriendID=m.ID JOIN users_info AS i ON f.FriendID=i.UserID WHERE f.UserID='$UserID' ORDER BY Username LIMIT $Limit"); $Friends = $DB->to_array(false, MYSQLI_BOTH, array(7)); // Number of results (for pagination) $DB->query('SELECT FOUND_ROWS()'); list($Results) = $DB->next_record(); // Start printing stuff ?>
You have no friends! :(
'; } // Start printing out friends foreach($Friends as $Friend) { list($FriendID, $Comment, $Username, $Uploaded, $Downloaded, $Class, $Enabled, $Paranoia, $Donor, $Warned, $Title, $LastAccess, $Avatar) = $Friend; ?> } // while // close