summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2005-06-20 06:03:55 +0000
committerChristian Fowler <spider@viovio.com>2005-06-20 06:03:55 +0000
commit42469def3c8c9dd5036a32b22763c71275861d47 (patch)
tree4d0908c73cbb77ce82acf875e140514fe012e898 /modules
parent2c4e4ca223d082e9b4da185ee8d9ff4621ccefad (diff)
downloadfisheye-42469def3c8c9dd5036a32b22763c71275861d47.tar.gz
fisheye-42469def3c8c9dd5036a32b22763c71275861d47.tar.bz2
fisheye-42469def3c8c9dd5036a32b22763c71275861d47.zip
add mod_random_images
Diffstat (limited to 'modules')
-rw-r--r--modules/mod_random_images.php28
-rw-r--r--modules/mod_random_images.tpl22
2 files changed, 50 insertions, 0 deletions
diff --git a/modules/mod_random_images.php b/modules/mod_random_images.php
new file mode 100644
index 0000000..1f63de3
--- /dev/null
+++ b/modules/mod_random_images.php
@@ -0,0 +1,28 @@
+<?php
+global $gQueryUserId, $module_rows, $module_params, $gGallery;
+
+require_once( FISHEYE_PKG_PATH.'FisheyeImage.php' );
+
+$image = new FisheyeImage();
+
+$listHash = $module_params;
+$listHash['max_records'] = $module_rows;
+$listHash['user_id'] = $gQueryUserId;
+$listHash['sort_mode'] = 'random';
+
+if( empty( $module_title ) ) {
+ if( !empty( $module_params['content_type_guid'] ) && !empty( $gLibertySystem->mContentTypes[$module_params['content_type_guid']] ) ) {
+ $title = tra( "Random Images" ).': '.tra( $gLibertySystem->mContentTypes[$module_params['content_type_guid']]['content_description'] );
+ } else {
+ $smarty->assign( 'showContentType', TRUE );
+ $title = tra( "Random Images" );
+ }
+ $smarty->assign( 'moduleTitle', $title );
+}
+
+$images = $image->getList( $listHash );
+
+$smarty->assign('modImages', $images );
+$smarty->assign('maxlen', isset($module_params["maxlen"]) ? $module_params["maxlen"] : 0);
+$smarty->assign('nonums', isset($module_params["nonums"]) ? $module_params["nonums"] : 'y');
+?>
diff --git a/modules/mod_random_images.tpl b/modules/mod_random_images.tpl
new file mode 100644
index 0000000..40615fd
--- /dev/null
+++ b/modules/mod_random_images.tpl
@@ -0,0 +1,22 @@
+{* $Header: /cvsroot/bitweaver/_bit_fisheye/modules/Attic/mod_random_images.tpl,v 1.1 2005/06/20 06:03:55 spiderr Exp $ *}
+{strip}
+{if $gBitSystem->isPackageActive( 'fisheye' )}
+ {bitmodule title="$moduleTitle" name="randomimages"}
+ <ul>
+ {foreach from=$modImages item=img key=imageId}
+ <li><a href="{$img.display_url}" title="{$img.title} - {$img.last_modified|bit_short_datetime}, by {displayname user=$img.modifier_user real_name=$img.modifier_real_name nolink=1}{if (strlen($img.title) > $maxlen) AND ($maxlen > 0)}, {$img.title}{/if}"><img src="{$img.thumbnail_url}" />
+ <h4>{if !$img.has_machine_name}{if $maxlen gt 0}
+ {$img.title|truncate:$maxlen:"...":true}
+ {else}
+ {$img.title}
+ {/if}
+ {/if}</h4>
+ </a>
+ </li>
+ {foreachelse}
+ <li></li>
+ {/foreach}
+ </ul>
+ {/bitmodule}
+{/if}
+{/strip}