From d70b62b5d39984be56602406cc20b1fd42a18a6e Mon Sep 17 00:00:00 2001 From: Max Kremmel Date: Wed, 17 Sep 2008 06:54:04 +0000 Subject: fix for fish and mime interaction - rushed commit cos i have to run --- FisheyeImage.php | 16 ++++++++++------ templates/view_image.tpl | 2 +- view_image.php | 4 ++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/FisheyeImage.php b/FisheyeImage.php index d0bd00b..ef45c93 100644 --- a/FisheyeImage.php +++ b/FisheyeImage.php @@ -1,6 +1,6 @@ mInfo['title'] = $this->getTitle(); $this->mInfo['display_url'] = $this->getDisplayUrl(); - // LibertyMime will load the attachment details + + // LibertyMime will load the attachment details in $this->mStorage LibertyMime::load( NULL, $pPluginParams ); // parse the data after parent load so we have our html prefs $this->mInfo['parsed_data'] = $this->parseData(); - // copy mStorage to mInfo for easy access - // Duplicate copy to mInfo['image_file'] for legacy tpl's + // Copy mStorage to mInfo['image_file'] for easy access if( !empty( $this->mStorage ) && count( $this->mStorage ) > 0 ) { + // it seems that this is not necessary and causes confusing copies of the same stuff all over the place + //$this->mInfo = array_merge( current( $this->mStorage ), $this->mInfo ); + // copy the image data by reference to reduce memory reset( $this->mStorage ); - $this->mInfo = array_merge( current( $this->mStorage ), $this->mInfo ); - $this->mInfo['image_file'] = current($this->mStorage); + $this->mInfo['image_file'] =& current( $this->mStorage ); + // override original display_url that mime knows where we keep the image + $this->mInfo['image_file']['display_url'] = $this->getDisplayUrl(); } else { $this->mInfo['image_file'] = NULL; } diff --git a/templates/view_image.tpl b/templates/view_image.tpl index 7bde54a..d89974e 100644 --- a/templates/view_image.tpl +++ b/templates/view_image.tpl @@ -30,7 +30,7 @@ {/if} {/if} - {include file=$gLibertySystem->getMimeTemplate('view',$gContent->mInfo.attachment_plugin_guid) attachment=$gContent->mInfo} + {include file=$gLibertySystem->getMimeTemplate('view',$gContent->mInfo.attachment_plugin_guid) attachment=$gContent->mInfo.image_file} {if $gBitSystem->isFeatureActive('fisheye_image_list_description') and $gContent->mInfo.data ne ''}

{$gContent->mInfo.parsed_data}

diff --git a/view_image.php b/view_image.php index aaf2459..19cd3f2 100644 --- a/view_image.php +++ b/view_image.php @@ -1,6 +1,6 @@ isCommentable() ) { $gContent->addHit(); -$gContent->mInfo['original'] = TRUE; +$gContent->mInfo['image_file']['original'] = TRUE; require_once( FISHEYE_PKG_PATH.'display_fisheye_image_inc.php' ); ?> -- cgit v1.3