How to get full-size image path

Phoca Gallery - image gallery extension
anthonytl
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 26 Mar 2009, 22:02

How to get full-size image path

Post 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?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How to get full-size image path

Post by Jan »

See helper class, there are methods to get different paths of the images:

administrator\components\com_phocagallery\helpers\phocagallery.php

Jan
If you find Phoca extensions useful, please support the project
anthonytl
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 26 Mar 2009, 22:02

Re: How to get full-size image path

Post 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
apgraham
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 07 Aug 2009, 04:31

Re: How to get full-size image path

Post by apgraham »

'images/phocagallery/' . $this->item->filenameno
Post Reply