summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-07-30 21:24:34 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-07-30 21:24:34 +0000
commit2cdc3b76dc51d4d7a7675117974ce3c6b004cb63 (patch)
tree74a3e372957c773be7e7aec6611c9d7962d90978
parent8335cc388672614395481d8519276e746fad3248 (diff)
Fixes issue where relative_path_cache is null because the image hasn't been viewed and cached yet.
-rw-r--r--helpers/randimg.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/helpers/randimg.php b/helpers/randimg.php
index acc7b8d..91bf5cb 100644
--- a/helpers/randimg.php
+++ b/helpers/randimg.php
@@ -25,7 +25,7 @@ class randimg_Core {
SELECT i1.name, i1.title, i1.description, i1.relative_path_cache, i1.relative_url_cache, i1.slug AS imgslug, i2.slug
FROM {$table_prefix}items i1 JOIN {$table_prefix}items i2
ON i1.parent_id = i2.id
- WHERE i1.type != 'album'
+ WHERE i1.type != 'album' AND i1.relative_path_cache IS NOT NULL
ORDER BY RAND()
LIMIT 1;
";