Page 1 of 1

How to get full-size image path

Posted: 03 Apr 2009, 15:57
by anthonytl
When a user is viewing photos in a popup, I want the large thumbnail image to link to the original full-size image instead of closing the popup. I changed this line in components/com_phocagallery/views/detail/tmpl/default.php :

FROM:
<div id="image-box" style="width:<?php echo $this->tmpl['realimagewidth'];?>px;"><a href="#" onclick="<?php echo $this->tmpl['detailwindowclose']; ?>"><?php echo JHTML::_( 'image.site', $this->file->linkthumbnailpath, ''); ?></a><?php

TO:
<div id="image-box" style="width:<?php echo $this->tmpl['realimagewidth'];?>px;"><a target=_blank href="<?php echo $this->file->filename;?>"><?php echo JHTML::_( 'image.site', $this->file->linkthumbnailpath, ''); ?></a><?php

but $this->file->filename does not contain the full path to the original image. I could use linkthumbnailpath and delete "thumbs/phoca_thumb_l_" from that string, but is there a more efficient way to get the full path to the original file?

Re: How to get full-size image path

Posted: 16 Apr 2009, 01:08
by Jan
See helper class, there are methods to get different paths of the images:

administrator\components\com_phocagallery\helpers\phocagallery.php

Jan

Re: How to get full-size image path

Posted: 16 Apr 2009, 15:35
by anthonytl
I couldn't figure out how to get the original image path which included the category directory, so I just did this in the views/detail/tmpl/default.php file:

<div id="image-box" style="width:<?php echo $this->tmpl['realimagewidth'];?>px;"><a target=_blank href="<?php echo str_replace("thumbs/phoca_thumb_l_", "", $this->file->linkthumbnailpath);?>"><?php echo JHTML::_( 'image.site', $this->file->linkthumbnailpath, ''); ?></a><?php

Re: How to get full-size image path

Posted: 07 Aug 2009, 06:17
by apgraham
'images/phocagallery/' . $this->item->filenameno