fisheye
[ class tree: fisheye ] [ index: fisheye ] [ all elements ]

Source for file mod_images.php

Documentation is available at mod_images.php

  1. <?php
  2. /**
  3.  * @version $Header: /cvsroot/bitweaver/_bit_fisheye/modules/mod_images.php,v 1.8 2006/11/03 01:26:08 squareing Exp $
  4.  * @package fisheye
  5.  * @subpackage modules
  6.  */
  7.  
  8. global $gQueryUserId$module_rows$module_params$module_title$gContent;
  9.  
  10. /**
  11.  * required setup
  12.  */
  13. require_onceFISHEYE_PKG_PATH.'FisheyeImage.php' );
  14.  
  15. $image new FisheyeImage();
  16.  
  17. $display TRUE;
  18.  
  19. $listHash $module_params;
  20. if!empty$gContent && $gContent->getField'content_type_guid' == FISHEYEGALLERY_CONTENT_TYPE_GUID {
  21.     $displayCount empty$gContent->mItems count$gContent->mItems );
  22.     $thumbCount $gContent->mInfo['rows_per_page'$gContent->mInfo["cols_per_page"];
  23.     $listHash['gallery_id'$gContent->mGalleryId;
  24.     $display $displayCount >= $thumbCount;
  25. }
  26.  
  27. if$display {
  28.  
  29.     $listHash['max_records'$module_rows;
  30.     if$gQueryUserId {
  31.         $listHash['user_id'$gQueryUserId;
  32.     elseif!empty$_REQUEST['user_id') ) {
  33.         $gBitSmarty->assign'userGallery'$_REQUEST['user_id');
  34.         $listHash['user_id'$_REQUEST['user_id'];
  35.     elseif!empty$module_params['recent_users') ) {
  36.         $listHash['recent_users'TRUE;
  37.     }
  38.  
  39.     // this is needed to avoid wrong sort_modes entered resulting in db errors
  40.     $sort_options array'hits''created' );
  41.     if!empty$module_params['sort_mode'&& in_array$module_params['sort_mode']$sort_options ) ) {
  42.         $sort_mode $module_params['sort_mode'].'_desc';
  43.     else {
  44.         $sort_mode 'random';
  45.     }
  46.     $listHash['sort_mode'$sort_mode;
  47.  
  48.     $images $image->getList$listHash );
  49.  
  50.     ifempty$module_title && $images {
  51.         $moduleTitle '';
  52.         if!empty$module_params['sort_mode') ) {
  53.             if$module_params['sort_mode'== 'random' {
  54.                 $moduleTitle 'Random';
  55.             elseif$module_params['sort_mode'== 'created' {
  56.                 $moduleTitle 'Recent';
  57.             elseif$module_params['sort_mode'== 'hits' {
  58.                 $moduleTitle 'Popular';
  59.             }
  60.         else {
  61.             $moduleTitle 'Random';
  62.         }
  63.  
  64.         $moduleTitle .= ' Images';
  65.         $moduleTitle tra$moduleTitle );
  66.  
  67.         if!empty$listHash['user_id') ) {
  68.             $moduleTitle .= ' '.tra('by').' '.BitUser::getDisplayNameTRUEcurrent$images ) );
  69.         elseif!empty$listHash['recent_users') ) {
  70.             $moduleTitle .= ' '.tra'by' ).' <a href="'.USERS_PKG_URL.'">'.tra'New Users' ).'</a>';
  71.         }
  72.  
  73.         $listHash['sort_mode'$sort_mode;
  74.         $gBitSmarty->assign'moduleTitle'$moduleTitle );
  75.     }
  76.  
  77.     $gBitSmarty->assign'imageSort'$sort_mode );
  78.     $gBitSmarty->assign'modImages'$images );
  79.     $gBitSmarty->assign'module_params'$module_params );
  80.     $gBitSmarty->assign'maxlen'isset$module_params["maxlen"$module_params["maxlen");
  81.     $gBitSmarty->assign'maxlendesc'isset$module_params["maxlendesc"$module_params["maxlendesc");
  82. }
  83. ?>

Documentation generated on Thu, 15 Feb 2007 20:45:15 +0000 by phpDocumentor 1.3.0