From 37e82a433cd09995988bc52e5cc23f35860fcd69 Mon Sep 17 00:00:00 2001 From: Nathan Kinkade Date: Sun, 9 Jan 2011 17:37:23 +0000 Subject: Overhaul of module, with a good many changes suggested by danneh3826 on the gallery forum. --- views/randimg.html.php | 46 +++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) (limited to 'views/randimg.html.php') diff --git a/views/randimg.html.php b/views/randimg.html.php index 52d4d78..59817a6 100644 --- a/views/randimg.html.php +++ b/views/randimg.html.php @@ -1,21 +1,41 @@ - $img_title - + // URL to Gallery3 + $g3path = "{$_SERVER['HTTP_HOST']}{$_SERVER['SCRIPT_NAME']}"; + $link_path = $item->relative_url(); + $img_title = $item->title; + switch (Input::instance()->get("size")) { + case "fullsize": + $thumb_url = $item->file_url(true); + break; + case "resize": + $thumb_url = $item->resize_url(true); + break; + case "thumb": + default: + $thumb_url = $item->thumb_url(true); + } + + $width = Input::instance()->get("width"); + $width = $width ? "width: {$width}px;" : ""; + + echo << + + $img_title + + HTML; -?> +} -- cgit v1.2.3