/************************************************************************ //------------// 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'); include_once(SERVER_ROOT.'/classes/class_paranoia.php'); 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.Paranoia, 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(6, 'Paranoia')); // 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, $Paranoia, $LastAccess, $Avatar) = $Friend; ?> } // while // close