mirror of https://github.com/BOINC/boinc.git
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:
parent
7e007fb594
commit
485493cd1c
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue