summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2012-09-30 16:59:32 +0100
committerlsces <lester@lsces.co.uk>2012-09-30 16:59:32 +0100
commitc35391e3e7ce948c42e2b73c57081f7d94345e46 (patch)
tree55f4162d6e5079715eedc750f5d970247589f9b0 /modules
parentc86b1f4f77354cc127ee51e3128eae6763cf4ac6 (diff)
downloadfisheye-c35391e3e7ce948c42e2b73c57081f7d94345e46.tar.gz
fisheye-c35391e3e7ce948c42e2b73c57081f7d94345e46.tar.bz2
fisheye-c35391e3e7ce948c42e2b73c57081f7d94345e46.zip
Base for a gallery based site banner library.
A fisheye gellery holds the images used, on a site banner, and this allows images to be easily changed by the user. This module simply displays a random selection from the gallery. module_rows has been borrowed to identify the gallery to be used, and title is used to select an image size. extra-large thumbnail is needed to support up to 1024 pixel wide imsages. The size of the image uploaded needs to match the banner size!
Diffstat (limited to 'modules')
-rw-r--r--modules/mod_banner_rand.php34
-rw-r--r--modules/mod_banner_rand.tpl9
2 files changed, 43 insertions, 0 deletions
diff --git a/modules/mod_banner_rand.php b/modules/mod_banner_rand.php
new file mode 100644
index 0000000..66f5267
--- /dev/null
+++ b/modules/mod_banner_rand.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * @version $Header$
+ * @package fisheye
+ * @subpackage modules
+ */
+
+global $gQueryUserId, $gContent, $moduleParams;
+
+// makes things in older modules easier
+extract( $moduleParams );
+
+/**
+ * required setup
+ */
+require_once( FISHEYE_PKG_PATH.'FisheyeGallery.php' );
+
+$image = new FisheyeImage();
+
+$display = TRUE;
+
+$listHash = $module_params;
+
+$listHash['size'] = $title;
+$listHash['gallery_id'] = $module_rows;
+$listHash['max_records'] = 1;
+$listHash['sort_mode'] = 'random';
+
+$images = $image->getList( $listHash );
+$moduleTitle = 'Banner Image';
+$gBitSmarty->assign( 'moduleTitle', $title );
+$gBitSmarty->assign( 'modImages', $images );
+$gBitSmarty->assign( 'module_params', $module_params );
+?>
diff --git a/modules/mod_banner_rand.tpl b/modules/mod_banner_rand.tpl
new file mode 100644
index 0000000..8131c5e
--- /dev/null
+++ b/modules/mod_banner_rand.tpl
@@ -0,0 +1,9 @@
+{strip}
+<div id="banner">
+ <div id="background">
+ {foreach from=$modImages item=modImg}
+ <img src="{$modImg.thumbnail_url}" title="{$modImg.title|escape}" alt="{$modImg.title|escape}" />
+ {/foreach}
+ </div>
+</div>
+{/strip}