summaryrefslogtreecommitdiff
path: root/modules/mod_images.php
blob: 05ffb142d214a376236c61ff0872c438c1347872 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
// $Header: /cvsroot/bitweaver/_bit_fisheye/modules/mod_images.php,v 1.2 2005/06/21 18:17:51 squareing Exp $
global $gQueryUserId, $module_rows, $module_params;

require_once( FISHEYE_PKG_PATH.'FisheyeImage.php' );

$image = new FisheyeImage();

$listHash = $module_params;
$listHash['max_records'] = $module_rows;
$listHash['user_id'] = $gQueryUserId;

// this is needed to avoid wrong sort_modes entered resulting in db errors
$sort_options = array( 'hits', 'created' );
if( !empty( $module_params['sort_mode'] ) && in_array( $module_params['sort_mode'], $sort_options ) ) {
	$sort_mode = $module_params['sort_mode'].'_asc';
} else {
	$sort_mode = 'random';
}
$listHash['sort_mode'] = $sort_mode;

$images = $image->getList( $listHash );

$smarty->assign( 'modImages', $images );
$smarty->assign( 'module_params', $module_params );
$smarty->assign( 'maxlen', isset( $module_params["maxlen"] ) ? $module_params["maxlen"] : 0 );
$smarty->assign( 'maxlendesc', isset( $module_params["maxlendesc"] ) ? $module_params["maxlendesc"] : 0 );
?>