Source for file mod_images.php
Documentation is available at mod_images.php
global $gQueryUserId, $gContent, $moduleParams;
// makes things in older modules easier
require_once( FISHEYE_PKG_PATH. 'FisheyeGallery.php' );
$listHash = $module_params;
$displayCount = empty( $gContent->mItems ) ? 0 : count( $gContent->mItems );
$thumbCount = $gContent->mInfo['rows_per_page'] * $gContent->mInfo["cols_per_page"];
$listHash['gallery_id'] = $gContent->mGalleryId;
$display = $displayCount >= $thumbCount;
$listHash['max_records'] = $module_rows;
$listHash['user_id'] = $gQueryUserId;
} elseif( !empty( $_REQUEST['user_id'] ) ) {
$_template->tpl_vars['userGallery'] = new Smarty_variable( $_REQUEST['user_id'] );
$listHash['user_id'] = $_REQUEST['user_id'];
} elseif( !empty( $module_params['recent_users'] ) ) {
$listHash['recent_users'] = TRUE;
// 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']. '_desc';
$listHash['sort_mode'] = $sort_mode;
$images = $image->getList( $listHash );
if( empty( $title ) && $images ) {
if( !empty( $module_params['sort_mode'] ) ) {
if( $module_params['sort_mode'] == 'random' ) {
} elseif( $module_params['sort_mode'] == 'created' ) {
} elseif( $module_params['sort_mode'] == 'hits' ) {
$moduleTitle = 'Popular';
$moduleTitle .= ' Images';
$moduleTitle = tra( $moduleTitle );
if( !empty( $listHash['user_id'] ) ) {
} elseif( !empty( $listHash['recent_users'] ) ) {
$moduleTitle .= ' '. tra( 'by' ). ' <a href="'. USERS_PKG_URL. '">'. tra( 'New Users' ). '</a>';
$listHash['sort_mode'] = $sort_mode;
$_template->tpl_vars['moduleTitle'] = new Smarty_variable( $moduleTitle );
$_template->tpl_vars['moduleTitle'] = new Smarty_variable( $title );
$_template->tpl_vars['imageSort'] = new Smarty_variable( $sort_mode );
$_template->tpl_vars['modImages'] = new Smarty_variable( $images );
$_template->tpl_vars['module_params'] = new Smarty_variable( $module_params );
$_template->tpl_vars['maxlen'] = new Smarty_variable( isset ( $module_params["maxlen"] ) );
$_template->tpl_vars['maxlendesc'] = new Smarty_variable( isset ( $module_params["maxlendesc"] ) );
|