summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FisheyeBase.php13
-rw-r--r--FisheyeGallery.php22
-rw-r--r--FisheyeImage.php44
-rw-r--r--admin/admin_fisheye_inc.php1
-rw-r--r--browse.php8
-rw-r--r--display_fisheye_gallery_inc.php9
-rw-r--r--display_fisheye_image_inc.php8
-rw-r--r--edit.php8
-rw-r--r--edit_gallery_perms.php8
-rw-r--r--edit_image.php21
-rw-r--r--find_user.php9
-rw-r--r--gallery_lookup_inc.php6
-rw-r--r--gallery_tree.php8
-rw-r--r--image_lookup_inc.php6
-rw-r--r--image_order.php9
-rw-r--r--list_galleries.php9
-rw-r--r--modules/help_mod_images.tpl7
-rw-r--r--modules/mod_images.php88
-rw-r--r--modules/mod_images.tpl6
-rw-r--r--templates/admin_fisheye.tpl13
-rw-r--r--templates/menu_fisheye.tpl2
-rw-r--r--templates/upload_fisheye.tpl2
-rwxr-xr-xthumbnailer.php23
-rw-r--r--upload.php8
-rw-r--r--view.php8
-rw-r--r--view_image.php9
26 files changed, 305 insertions, 50 deletions
diff --git a/FisheyeBase.php b/FisheyeBase.php
index 8bcbc03..331dfc3 100644
--- a/FisheyeBase.php
+++ b/FisheyeBase.php
@@ -1,6 +1,18 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/FisheyeBase.php,v 1.4 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ */
+
+/**
+ * required setup
+ */
require_once( LIBERTY_PKG_PATH.'LibertyAttachable.php' ); // FisheyeGallery base class
+/**
+ * @package fisheye
+ * @subpackage FisheyeBase
+ */
class FisheyeBase extends LibertyAttachable
{
// Path of gallery images to get breadcrumbs
@@ -202,7 +214,6 @@ class FisheyeBase extends LibertyAttachable
$ret = isset( $userPerms[$pPermName]['user_id'] ) && ( $userPerms[$pPermName]['user_id'] == $gBitUser->mUserId );
}
}
- vd( $ret );
}
*/
}
diff --git a/FisheyeGallery.php b/FisheyeGallery.php
index d5c354d..c68d8c5 100644
--- a/FisheyeGallery.php
+++ b/FisheyeGallery.php
@@ -1,10 +1,22 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/FisheyeGallery.php,v 1.2 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ */
+
+/**
+ * required setup
+ */
require_once( FISHEYE_PKG_PATH.'FisheyeImage.php' ); // A gallery is composed of FisheyeImages
define('FISHEYEGALLERY_CONTENT_TYPE_GUID', 'fisheyegallery' );
-// FisheyeBase extends LibertyAttachable, which this class doesn't need, but we need a common base class
-
+/**
+ * FisheyeBase extends LibertyAttachable, which this class doesn't need, but we need a common base class
+ *
+ * @package fisheye
+ * @subpackage FisheyeGallery
+ */
class FisheyeGallery extends FisheyeBase {
var $mGalleryId; // tiki_fisheye_gallery.gallery_id
var $mItems; // Array of FisheyeImage class instances which belong to this gallery
@@ -207,10 +219,6 @@ class FisheyeGallery extends FisheyeBase {
$this->mErrors[] = "You must specify a title for this image gallery";
}
- if (empty($pStorageHash['edit'])) {
- $pStorageHash['edit'] = (!empty($this->mInfo['data']) ? $this->mInfo['data'] : '');
- }
-
$pStorageHash['content_type_guid'] = FISHEYEGALLERY_CONTENT_TYPE_GUID;
return (count($this->mErrors) == 0);
@@ -345,7 +353,6 @@ class FisheyeGallery extends FisheyeBase {
}
function expunge( $pRecursiveDelete = FALSE ) {
-//$this->debug();
if( $this->isValid() ) {
$this->mDb->StartTrans();
@@ -380,7 +387,6 @@ class FisheyeGallery extends FisheyeBase {
vd( $this->mErrors );
}
}
-//$this->debug(0);
return( count( $this->mErrors ) == 0 );
}
diff --git a/FisheyeImage.php b/FisheyeImage.php
index a1d228d..978f6f5 100644
--- a/FisheyeImage.php
+++ b/FisheyeImage.php
@@ -1,8 +1,20 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/FisheyeImage.php,v 1.3 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ */
+
+/**
+ * required setup
+ */
require_once( FISHEYE_PKG_PATH.'FisheyeBase.php' );
define('FISHEYEIMAGE_CONTENT_TYPE_GUID', 'fisheyeimage');
+/**
+ * @package fisheye
+ * @subpackage FisheyeImage
+ */
class FisheyeImage extends FisheyeBase {
var $mImageId;
@@ -75,12 +87,23 @@ class FisheyeImage extends FisheyeBase {
// }
// $ret = FisheyeBase::parseData( $pData );
// $ret .= '<img src="'.$this->mInfo['image_file']['source_url'].'" width="400" height="300" />';
- $ret = array( 'type' => FISHEYEIMAGE_CONTENT_TYPE_GUID,
- 'landscape' => $this->isLandscape(),
- 'url' => $this->getDisplayUrl(),
- 'content_id' => $this->mContentId,
- 'bleed' => TRUE,
- );
+ $ret = NULL;
+ // make sure we have a valid image file.
+ if( $this->isValid() && ($details = $this->getImageDetails( BIT_ROOT_PATH.$this->mInfo['image_file']['storage_path'] ) ) ) {
+ if( $this->mInfo['width'] != $details['width'] || $this->mInfo['height'] != $details['height'] ) {
+ // if our data got out of sync with the database, force an update
+ $query = "UPDATE `".BIT_DB_PREFIX."tiki_fisheye_image` SET `width`=?, `height`=? WHERE `content_id`=?";
+ $this->query( $query, array( $details['width'], $details['height'], $this->mContentId ) );
+ $this->mInfo['width'] = $details['width'];
+ $this->mInfo['height'] = $details['height'];
+ }
+ $ret = array( 'type' => FISHEYEIMAGE_CONTENT_TYPE_GUID,
+ 'landscape' => $this->isLandscape(),
+ 'url' => $this->getDisplayUrl(),
+ 'content_id' => $this->mContentId,
+ 'bleed' => TRUE,
+ );
+ }
return $ret;
}
@@ -184,6 +207,7 @@ class FisheyeImage extends FisheyeBase {
$rotateFunc = ($gBitSystem->getPreference( 'image_processor' ) == 'imagick' ) ? 'liberty_imagick_rotate_image' : 'liberty_gd_rotate_image';
if( $rotateFunc( $fileHash ) ) {
liberty_clear_thumbnails( $fileHash );
+ $this->query( "UPDATE `".BIT_DB_PREFIX."tiki_fisheye_image` SET `width`=`height`, `height`=`width` WHERE `content_id`=?", array( $this->mContentId ) );
$this->generateThumbnails();
} else {
$this->mErrors['rotate'] = $fileHash['error'];
@@ -375,6 +399,7 @@ class FisheyeImage extends FisheyeBase {
$this->prepGetList( $pListHash );
$bindVars = array();
+ $distinct = '';
$select = '';
$mid = '';
$join = '';
@@ -382,8 +407,13 @@ class FisheyeImage extends FisheyeBase {
if( !empty( $pListHash['user_id'] ) && is_numeric( $pListHash['user_id'] )) {
$mid .= " AND tc.`user_id` = ? ";
$bindVars[] = $pListHash['user_id'];
+ } elseif( !empty( $pListHash['recent_users'] )) {
+ $distinct = " DISTINCT ON ( uu.`user_id` ) ";
+ $pListHash['sort_mode'] = 'uu.user_id_desc';
}
+
+
if( !empty( $pListHash['gallery_id'] ) && is_numeric( $pListHash['gallery_id'] )) {
$mid .= " AND tfg.`gallery_id` = ? ";
$bindVars[] = $pListHash['gallery_id'];
@@ -406,7 +436,7 @@ class FisheyeImage extends FisheyeBase {
$mid .= " ORDER BY ".$this->convert_sortmode( $pListHash['sort_mode'] )." ";
}
- $query = "SELECT tfi.`image_id` AS `hash_key`, tfi.*, tf.*, tc.*, tfg.gallery_id, uu.`login`, uu.`real_name` $select
+ $query = "SELECT $distinct tfi.`image_id` AS `hash_key`, tfi.*, tf.*, tc.*, tfg.gallery_id, uu.`login`, uu.`real_name` $select
FROM `".BIT_DB_PREFIX."tiki_fisheye_image` tfi
INNER JOIN `".BIT_DB_PREFIX."tiki_attachments` ta ON(ta.`content_id`=tfi.`content_id`)
INNER JOIN `".BIT_DB_PREFIX."tiki_files` tf ON(ta.`foreign_id`=tf.`file_id`)
diff --git a/admin/admin_fisheye_inc.php b/admin/admin_fisheye_inc.php
index e5ef429..13cabdb 100644
--- a/admin/admin_fisheye_inc.php
+++ b/admin/admin_fisheye_inc.php
@@ -119,6 +119,7 @@ if (!empty($_REQUEST['fisheyeAdminSubmit'])) {
foreach ($formGalleryLists as $item => $data) {
simple_set_toggle($item);
}
+ $gBitSystem->storePreference('fisheye_list_thumbnail_size', $_REQUEST['list_thumbnail_size']);
$gBitSystem->storePreference('fisheye_gallery_default_thumbnail_size', $_REQUEST['default_gallery_thumbnail_size']);
$gBitSystem->storePreference('fisheye_gallery_default_rows_per_page', $_REQUEST['rows_per_page']);
$gBitSystem->storePreference('fisheye_gallery_default_cols_per_page', $_REQUEST['cols_per_page']);
diff --git a/browse.php b/browse.php
index 7eac5b3..8af0c50 100644
--- a/browse.php
+++ b/browse.php
@@ -1,5 +1,13 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/browse.php,v 1.2 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
+/**
+ * required setup
+ */
require_once( '../bit_setup_inc.php' );
require_once( FISHEYE_PKG_PATH.'FisheyeGallery.php');
diff --git a/display_fisheye_gallery_inc.php b/display_fisheye_gallery_inc.php
index 8c13510..31e59d1 100644
--- a/display_fisheye_gallery_inc.php
+++ b/display_fisheye_gallery_inc.php
@@ -1,4 +1,9 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/display_fisheye_gallery_inc.php,v 1.2 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
if( !$gContent->hasUserAccess( 'bit_p_view_fisheye' ) ) {
if ( !empty($_REQUEST['submit_answer'])) { // User is attempting to authenticate themseleves to view this gallery
@@ -16,7 +21,9 @@ if( !$gContent->hasUserAccess( 'bit_p_view_fisheye' ) ) {
}
}
-
+/**
+ * categories setup
+ */
if( $gBitSystem->isPackageActive( 'categories' ) ) {
$cat_obj_type = FISHEYEGALLERY_CONTENT_TYPE_GUID;
$cat_objid =$gContent->mContentId;
diff --git a/display_fisheye_image_inc.php b/display_fisheye_image_inc.php
index 7be7c1e..fba7099 100644
--- a/display_fisheye_image_inc.php
+++ b/display_fisheye_image_inc.php
@@ -1,4 +1,9 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/display_fisheye_image_inc.php,v 1.2 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
if( !$gContent->isValid() ) {
$gBitSystem->fatalError( "No image exists with the given ID" );
@@ -20,6 +25,9 @@ if( !$gContent->hasUserAccess( 'bit_p_view_fisheye' ) ) {
}
}
+/**
+ * categories setup
+ */
if( $gBitSystem->isPackageActive( 'categories' ) ) {
$cat_obj_type = FISHEYEIMAGE_CONTENT_TYPE_GUID;
$cat_objid = $gContent->mContentId;
diff --git a/edit.php b/edit.php
index 7509ed5..33c39b0 100644
--- a/edit.php
+++ b/edit.php
@@ -1,5 +1,13 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/edit.php,v 1.3 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
+/**
+ * required setup
+ */
require_once( '../bit_setup_inc.php' );
require_once( FISHEYE_PKG_PATH.'FisheyeGallery.php');
diff --git a/edit_gallery_perms.php b/edit_gallery_perms.php
index 26ee9e6..f89a18a 100644
--- a/edit_gallery_perms.php
+++ b/edit_gallery_perms.php
@@ -1,5 +1,13 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/edit_gallery_perms.php,v 1.2 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
+/**
+ * required setup
+ */
require_once( '../bit_setup_inc.php' );
require_once( FISHEYE_PKG_PATH.'FisheyeGallery.php');
diff --git a/edit_image.php b/edit_image.php
index 07ec5bf..72a92bc 100644
--- a/edit_image.php
+++ b/edit_image.php
@@ -1,5 +1,13 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/edit_image.php,v 1.2 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
+/**
+ * required setup
+ */
require_once( '../bit_setup_inc.php' );
require_once( FISHEYE_PKG_PATH.'FisheyeGallery.php');
@@ -31,9 +39,6 @@ if( !empty($_REQUEST['saveImage']) || !empty($_REQUEST['regenerateThumbnails'] )
$_REQUEST['upload']['process_storage'] = STORAGE_IMAGE;
}
$_REQUEST['purge_from_galleries'] = TRUE;
- if( !empty( $_REQUEST['rotate_image'] ) ) {
- $gContent->rotateImage( $_REQUEST['rotate_image'] );
- }
if( $gContent->store($_REQUEST) ) {
$gContent->addToGalleries( $_REQUEST['galleryAdditions'] );
// maybe we need to resize the original and generate thumbnails
@@ -43,6 +48,10 @@ if( !empty($_REQUEST['saveImage']) || !empty($_REQUEST['regenerateThumbnails'] )
if( !empty( $_REQUEST['generate_thumbnails'] ) ) {
$gContent->generateThumbnails();
}
+ // This needs to happen after the store, else the image width/hieght are screwed for people using the background thumbnailer
+ if( !empty( $_REQUEST['rotate_image'] ) ) {
+ $gContent->rotateImage( $_REQUEST['rotate_image'] );
+ }
if ( $gBitSystem->isPackageActive('categories') ) {
$cat_desc = $gLibertySystem->mContentTypes[FISHEYEIMAGE_CONTENT_TYPE_GUID]['content_description'].' by '.$gBitUser->getDisplayName( FALSE, array( 'real_name' => $gContent->mInfo['creator_real_name'], 'user' => $gContent->mInfo['creator_user'], 'user_id'=>$gContent->mInfo['user_id'] ) );
$cat_name = $gContent->getTitle();
@@ -75,6 +84,12 @@ if( !empty($_REQUEST['saveImage']) || !empty($_REQUEST['regenerateThumbnails'] )
}
+if ( $gBitSystem->isPackageActive('categories') ) {
+ $cat_type = FISHEYEGALLERY_CONTENT_TYPE_GUID;
+ $cat_objid = $gContent->mContentId;
+ include_once( CATEGORIES_PKG_PATH.'categorize_list_inc.php' );
+}
+
$errors = $gContent->mErrors;
$smarty->assign_by_ref('errors', $errors);
diff --git a/find_user.php b/find_user.php
index 16d10a0..bb19c9c 100644
--- a/find_user.php
+++ b/find_user.php
@@ -1,4 +1,13 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/find_user.php,v 1.2 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
+
+/**
+ * required setup
+ */
include_once( "../bit_setup_inc.php" );
if (empty($gBitLoc['styleSheet'])) {
diff --git a/gallery_lookup_inc.php b/gallery_lookup_inc.php
index 7d628a4..3534649 100644
--- a/gallery_lookup_inc.php
+++ b/gallery_lookup_inc.php
@@ -1,4 +1,10 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/gallery_lookup_inc.php,v 1.2 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
+
global $gContent;
if (!empty($_REQUEST['gallery_id']) && is_numeric($_REQUEST['gallery_id'])) {
diff --git a/gallery_tree.php b/gallery_tree.php
index 619a83e..a3f5b07 100644
--- a/gallery_tree.php
+++ b/gallery_tree.php
@@ -1,5 +1,13 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/gallery_tree.php,v 1.2 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
+/**
+ * required setup
+ */
require_once( '../bit_setup_inc.php' );
require_once( FISHEYE_PKG_PATH.'FisheyeGallery.php');
diff --git a/image_lookup_inc.php b/image_lookup_inc.php
index 536f2e5..036f59d 100644
--- a/image_lookup_inc.php
+++ b/image_lookup_inc.php
@@ -1,4 +1,10 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/image_lookup_inc.php,v 1.2 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
+
global $gContent, $gGallery;
if (!empty($_REQUEST['image_id']) && is_numeric($_REQUEST['image_id'])) {
diff --git a/image_order.php b/image_order.php
index 3aa1cae..e4e5606 100644
--- a/image_order.php
+++ b/image_order.php
@@ -1,4 +1,13 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/image_order.php,v 1.2 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
+
+/**
+ * required setup
+ */
require_once( '../bit_setup_inc.php' );
require_once( FISHEYE_PKG_PATH.'FisheyeGallery.php');
diff --git a/list_galleries.php b/list_galleries.php
index e7107fa..72bf507 100644
--- a/list_galleries.php
+++ b/list_galleries.php
@@ -1,5 +1,13 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/list_galleries.php,v 1.2 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
+/**
+ * required setup
+ */
require_once( '../bit_setup_inc.php' );
require_once( FISHEYE_PKG_PATH.'FisheyeGallery.php');
@@ -21,6 +29,7 @@ if (!empty($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id'])) {
$template = 'list_galleries.tpl';
}
+$_REQUEST['thumbnail_size'] = $gBitSystem->getPreference( 'fisheye_list_thumbnail_size', 'small' );
$galleryList = $gFisheyeGallery->getList( $_REQUEST );
$smarty->assign_by_ref('galleryList', $galleryList);
diff --git a/modules/help_mod_images.tpl b/modules/help_mod_images.tpl
index b808de4..a47675c 100644
--- a/modules/help_mod_images.tpl
+++ b/modules/help_mod_images.tpl
@@ -1,4 +1,4 @@
-{tr}<strong>Summary</strong>: Display the most recently changed content.{/tr}<br />
+{tr}<strong>Summary</strong>: Display images from the fisheye gallery.{/tr}<br />
<table class="data">
<tr>
<th style="width:20%;">{tr}Parameter{/tr}</th>
@@ -25,4 +25,9 @@
<td>( {tr}numeric{/tr} )</td>
<td>{tr}Truncate the description to the specified number of letters.{/tr}</td>
</tr>
+ <tr class="odd">
+ <td>recent_users</td>
+ <td>( {tr}boolean{/tr} )</td>
+ <td>{tr}This will display the most recent image from the most recent users.{/tr}</td>
+ </tr>
</table>
diff --git a/modules/mod_images.php b/modules/mod_images.php
index 05ffb14..b937bb1 100644
--- a/modules/mod_images.php
+++ b/modules/mod_images.php
@@ -1,28 +1,82 @@
<?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;
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/modules/mod_images.php,v 1.3 2005/06/28 07:45:43 spiderr Exp $
+ * @package fisheye
+ * @subpackage modules
+ */
+global $gQueryUserId, $module_rows, $module_params, $gContent;
+
+/**
+ * required setup
+ */
require_once( FISHEYE_PKG_PATH.'FisheyeImage.php' );
$image = new FisheyeImage();
-$listHash = $module_params;
-$listHash['max_records'] = $module_rows;
-$listHash['user_id'] = $gQueryUserId;
+$display = 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'].'_asc';
-} else {
- $sort_mode = 'random';
+$listHash = $module_params;
+if( !empty( $gContent ) && $gContent->mInfo['content_type_guid'] == FISHEYEGALLERY_CONTENT_TYPE_GUID ) {
+ $displayCount = empty( $gContent->mItems ) ? 0 : count( $gContent->mItems );
+ $thumbCount = $gContent->mInfo['rows_per_page'] * $gContent->mInfo["cols_per_page"];
+ $listHash['gallery_id'] = $_REQUEST['gallery_id'];
+ $display = $displayCount >= $thumbCount;
}
-$listHash['sort_mode'] = $sort_mode;
-$images = $image->getList( $listHash );
+if( $display ) {
+
+ $listHash['max_records'] = $module_rows;
+ if( $gQueryUserId ) {
+ $listHash['user_id'] = $gQueryUserId;
+ } elseif( !empty( $_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';
+ } else {
+ $sort_mode = 'random';
+ }
+ $listHash['sort_mode'] = $sort_mode;
-$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 );
+ $images = $image->getList( $listHash );
+
+ if( empty( $module_title ) && $images ) {
+ $moduleTitle = '';
+ if( !empty( $module_params['sort_mode'] ) ) {
+ if( $module_params['sort_mode'] == 'random' ) {
+ $moduleTitle = 'Random';
+ } elseif( $module_params['sort_mode'] == 'created' ) {
+ $moduleTitle = 'Recent';
+ } elseif( $module_params['sort_mode'] == 'hits' ) {
+ $moduleTitle = 'Popular';
+ }
+ } else {
+ $moduleTitle = 'Recent';
+ }
+
+ $moduleTitle .= ' Images';
+ $moduleTitle = tra( $moduleTitle );
+
+ if( !empty( $listHash['user_id'] ) ) {
+ $moduleTitle .= ' '.tra('by').' '.BitUser::getDisplayName( TRUE, current( $images ) );
+ } elseif( !empty( $listHash['recent_users'] ) ) {
+ $moduleTitle .= ' '.tra( 'by' ).' <a href="'.USERS_PKG_URL.'">'.tra( 'New Users' ).'</a>';
+ }
+
+ $listHash['sort_mode'] = $sort_mode;
+ $smarty->assign( 'moduleTitle', $moduleTitle );
+ }
+
+ $smarty->assign( 'imageSort', $sort_mode );
+ $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 );
+}
?>
diff --git a/modules/mod_images.tpl b/modules/mod_images.tpl
index a8adc95..8f27a37 100644
--- a/modules/mod_images.tpl
+++ b/modules/mod_images.tpl
@@ -1,12 +1,12 @@
-{* $Header: /cvsroot/bitweaver/_bit_fisheye/modules/mod_images.tpl,v 1.1 2005/06/21 10:24:40 squareing Exp $ *}
+{* $Header: /cvsroot/bitweaver/_bit_fisheye/modules/mod_images.tpl,v 1.2 2005/06/28 07:45:43 spiderr Exp $ *}
{strip}
-{if $gBitSystem->isPackageActive( 'fisheye' )}
+{if $gBitSystem->isPackageActive( 'fisheye' ) && $modImages}
{bitmodule title="$moduleTitle" name="fisheye_images"}
<ul class="data">
{foreach from=$modImages item=modImg}
<li class="{cycle values='odd,even'} item">
<a href="{$modImg.display_url}" title="{$modImg.title} - {$modImg.last_modified|bit_short_datetime}, by {displayname user=$modImg.modifier_user real_name=$modImg.modifier_real_name nolink=1}{if (strlen($modImg.title) > $maxlen) AND ($maxlen > 0)}, {$modImg.title}{/if}">
- <img src="{$modImg.thumbnail_url}" />
+ <img src="{$modImg.thumbnail_url}" title="{$modImg.title}" alt="{$modImg.title}" />
{if !$modImg.has_machine_name}
<br />
diff --git a/templates/admin_fisheye.tpl b/templates/admin_fisheye.tpl
index 89a69ac..7a897fc 100644
--- a/templates/admin_fisheye.tpl
+++ b/templates/admin_fisheye.tpl
@@ -35,6 +35,15 @@
{/forminput}
</div>
{/foreach}
+ <div class="row">
+ {formlabel label="List Thumbnail Size"}
+ {forminput}
+ {html_radios values="avatar" output="Avatar (100x75)" name="list_thumbnail_size" checked=$gBitSystemPrefs.fisheye_list_thumbnail_size}<br />
+ {html_radios values="small" output="Small (160x120)" name="list_thumbnail_size" checked=$gBitSystemPrefs.fisheye_list_thumbnail_size}<br />
+ {html_radios values="medium" output="Medium (400x300)" name="list_thumbnail_size" checked=$gBitSystemPrefs.fisheye_list_thumbnail_size}<br />
+ {html_radios values="large" output="Large (800x600)" name="list_thumbnail_size" checked=$gBitSystemPrefs.fisheye_list_thumbnail_size}
+ {/forminput}
+ </div>
{/legend}
{/jstab}
@@ -81,10 +90,10 @@
{html_radios values="large" output="Large (800x600)" name="default_gallery_thumbnail_size" checked=$gBitSystemPrefs.fisheye_gallery_default_thumbnail_size}
{/forminput}
</div>
-
+
{/legend}
{/jstab}
-
+
{jstab title="Image Display Settings"}
{legend legend="Image Display Settings"}
{formhelp note="The options below determine what information is displayed on the image display page."}
diff --git a/templates/menu_fisheye.tpl b/templates/menu_fisheye.tpl
index b32e310..32b3cc7 100644
--- a/templates/menu_fisheye.tpl
+++ b/templates/menu_fisheye.tpl
@@ -1,6 +1,8 @@
{strip}
<ul>
+ {if $gBitUser->hasPermission('bit_p_view_fisheye')}
<li><a class="item" href="{$gBitLoc.FISHEYE_PKG_URL}list_galleries.php">{biticon ipackage=liberty iname=list iexplain="list galleries" iforce="icon"} {tr}List Galleries{/tr}</a></li>
+ {/if}
{if $gBitUser->hasPermission('bit_p_create_fisheye')}
<li><a class="item" href="{$gBitLoc.FISHEYE_PKG_URL}list_galleries.php?user_id={$gBitUser->mUserId}">{biticon ipackage=liberty iname=spacer iexplain="my galleries" iforce="icon"} {tr}My Galleries{/tr}</a></li>
<li><a class="item" href="{$gBitLoc.FISHEYE_PKG_URL}edit.php">{biticon ipackage=liberty iname=new iexplain="create galleries" iforce="icon"} {tr}Create a Gallery{/tr}</a></li>
diff --git a/templates/upload_fisheye.tpl b/templates/upload_fisheye.tpl
index fec408b..c07c901 100644
--- a/templates/upload_fisheye.tpl
+++ b/templates/upload_fisheye.tpl
@@ -28,7 +28,7 @@
</div>
<div class="row">
- {formlabel label="Add This Image to These Galleries"}
+ {formlabel label="Add Image(s) to these Galleries"}
{forminput}
{foreach from=$galleryList key=galId item=gal}
<input type="checkbox" name="galleryAdditions[]" value="{$galId}"
diff --git a/thumbnailer.php b/thumbnailer.php
index ea20b24..1ea292a 100755
--- a/thumbnailer.php
+++ b/thumbnailer.php
@@ -1,10 +1,18 @@
<?php
- // usage is simple:
- // php -q thumbnailer.php [# of thumbnails]
- // example:
- // php -q thumbnailer.php 20
- // suggested crontab entry runs the thumbnailer every minute:
- // * * * * * apache php -q /path/to/bitweaver/fisheye/thumbnailer.php 20 >> /var/log/httpd/thumbnail_log
+/**
+ * Thumbnailer
+ *
+ * usage is simple:
+ * php -q thumbnailer.php [# of thumbnails]
+ * example:
+ * php -q thumbnailer.php 20
+ * suggested crontab entry runs the thumbnailer every minute:
+ * * * * * * apache php -q /path/to/bitweaver/fisheye/thumbnailer.php 20 >> /var/log/httpd/thumbnail_log
+ *
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/thumbnailer.php,v 1.3 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
global $gBitSystem, $_SERVER;
@@ -14,6 +22,9 @@
$_SERVER['HTTP_HOST'] = '';
$_SERVER['SERVER_NAME'] = '';
+/**
+ * required setup
+ */
if( !empty( $argc ) ) {
// reduce feedback for command line to keep log noise way down
define( 'BIT_PHP_ERROR_REPORTING', E_ERROR | E_PARSE );
diff --git a/upload.php b/upload.php
index 6b654c0..dfeafa4 100644
--- a/upload.php
+++ b/upload.php
@@ -1,5 +1,13 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/upload.php,v 1.2 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
+/**
+ * required setup
+ */
require_once( '../bit_setup_inc.php' );
require_once( FISHEYE_PKG_PATH.'FisheyeGallery.php');
diff --git a/view.php b/view.php
index df6e379..beb90e4 100644
--- a/view.php
+++ b/view.php
@@ -1,5 +1,13 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/view.php,v 1.2 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
+/**
+ * required setup
+ */
require_once( '../bit_setup_inc.php' );
require_once( FISHEYE_PKG_PATH.'FisheyeGallery.php');
diff --git a/view_image.php b/view_image.php
index c9eef75..bbaf7bb 100644
--- a/view_image.php
+++ b/view_image.php
@@ -1,4 +1,13 @@
<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/view_image.php,v 1.2 2005/06/28 07:45:42 spiderr Exp $
+ * @package fisheye
+ * @subpackage functions
+ */
+
+/**
+ * required setup
+ */
require_once( '../bit_setup_inc.php' );
require_once( FISHEYE_PKG_PATH.'FisheyeGallery.php');