summaryrefslogtreecommitdiff
path: root/utils/album.php
diff options
context:
space:
mode:
authordeva <deva>2008-10-24 10:20:04 +0000
committerdeva <deva>2008-10-24 10:20:04 +0000
commit96b8bc5ff5882f33114137d6b07db32e17b8ad87 (patch)
tree24ee6be2390627fc005b0e2ec12829c0fc5aef47 /utils/album.php
parent9bca27c9342bd4f34bed77dd3eb8c51dd686cdf1 (diff)
Did a lot of work on the page and module systems.
Diffstat (limited to 'utils/album.php')
-rw-r--r--utils/album.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/utils/album.php b/utils/album.php
index 1b6b662..696e75e 100644
--- a/utils/album.php
+++ b/utils/album.php
@@ -122,10 +122,12 @@ function getRandomPhoto()
$numphotos = sizeof($album->photos);
$rphoto = rand(0, $numphotos-1);
- foreach($album->photos as $p) {
- $photo = $p;
- $rphoto--;
- if(!$rphoto) break;
+ if($album->photos) {
+ foreach($album->photos as $p) {
+ $photo = $p;
+ $rphoto--;
+ if(!$rphoto) break;
+ }
}
// echo "<p>".$numalbums . " " .$ralbum . " ".$numphotos . " ".$rphoto . "</p>";