Made sure at least one page is generated for the picture gallery, even if no users have pictures.

svn path=/trunk/boinc/; revision=1709
This commit is contained in:
Dan Werthimer 2003-07-17 18:57:26 +00:00
parent 7e007fb594
commit 485493cd1c
1 changed files with 11 additions and 7 deletions

View File

@ -30,16 +30,20 @@ function build_picture_pages($width, $height) {
mysql_free_result($result); mysql_free_result($result);
if (count($userIds) == 0) { if (count($userIds) > 0) {
page_tail(); // Randomize the ordering of users.
exit(); shuffle($userIds);
} }
// Randomize the ordering of users.
shuffle($userIds);
$numPages = ceil(count($userIds)/($width * $height)); $numPages = ceil(count($userIds)/($width * $height));
// Make sure that a page is generated even when no profiles with pictures
// exist in order to avoid 404 errors from the profile_menu page.
if ($numPages == 0) {
$numPages = 1;
}
echo "Generating $numPages pages.<br>"; echo "Generating $numPages pages.<br>";
$count = 0; $count = 0;