From e4b87dc58c86e1a03fa4a3529e060cb5e193030d Mon Sep 17 00:00:00 2001 From: Nathan Kinkade Date: Fri, 19 Mar 2010 23:47:23 +0000 Subject: 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. --- helpers/randimg.php | 4 +++- views/randimg.html.php | 2 +- 2 files changed, 4 insertions(+), 2 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; diff --git a/views/randimg.html.php b/views/randimg.html.php index 6cf0943..52d4d78 100644 --- a/views/randimg.html.php +++ b/views/randimg.html.php @@ -12,7 +12,7 @@ $virtpath = $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']); $g3path = "{$_SERVER['HTTP_HOST']}{$_SERVER['SCRIPT_NAME']}"; echo << + $img_title -- cgit v1.2.3