summaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-03-19 23:47:23 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-03-19 23:47:23 +0000
commite4b87dc58c86e1a03fa4a3529e060cb5e193030d (patch)
treed487a44bf69e11026ea8fb4457febb6dd025047e /helpers
parent79f4038d0e05c57082e841ac36fc2559dd70ea77 (diff)
Apparently some new changes in Gallery3 broke this module. This change defines a diff between the src of an img and the link address to the image itself.
Diffstat (limited to 'helpers')
-rw-r--r--helpers/randimg.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/helpers/randimg.php b/helpers/randimg.php
index 2310271..a9a5380 100644
--- a/helpers/randimg.php
+++ b/helpers/randimg.php
@@ -22,7 +22,7 @@ class randimg_Core {
$db = Database::instance();
$table_prefix = $db->table_prefix;
$query = "
- SELECT i1.name, i1.title, i1.description, i2.slug
+ SELECT i1.name, i1.title, i1.description, 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'
@@ -32,8 +32,10 @@ class randimg_Core {
$result = $db->query($query)->current();
$randimg = new View("randimg.html");
+ $linkpath = "$result->slug/$result->imgslug";
$relpath = "$result->slug/$result->name";
$randimg->imgpath = $relpath;
+ $randimg->linkpath = $linkpath;
$randimg->img_title = $result->title;
return $randimg;