Click photo on photo page to zoom full screen

mauricen

Joined: 2009-07-19
Posts: 25
Posted: Sat, 2009-09-12 05:43

This may sound pretty basic, but I want to be able to click the 640x480 photo in photo view and have it zoom to the full screen view pop-up, instead of (or along with) the icon above the photo. Where can I set this or how do I change my theme to support this?

I am using the theme Carbon and I have been looking through the photo.tpl file to try to figure this out.

Thanks for any direction here...

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2009-09-12 21:14

There is a couple of themes that have the lightbox effect.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
mauricen

Joined: 2009-07-19
Posts: 25
Posted: Sat, 2009-09-12 21:43

I wonder how hard they would be to move to the Carbon theme. I am kind of committed to that theme.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2009-09-13 05:06

Never tried:
http://codex.gallery2.org/Gallery2:Lightbox_JS_Tutorial

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
mauricen

Joined: 2009-07-19
Posts: 25
Posted: Mon, 2009-09-14 05:17

Well, I ended up writing my own code. had to change a few template files in Carbon, but it works well. Thanks for the input!

 
qitnl

Joined: 2010-02-24
Posts: 3
Posted: Wed, 2010-02-24 06:16

Hi maurcien or anyone else who might be able to help:

I came across this Q/A while searching the forum for this exact topic. I recently changed webhosts and have upgraded from Gallery v1 to v2. This is a feature I miss in the newer version, which otherwise is excellent.

I'm using the Carbon theme as well; trying to keep the site as simple as possible - Q is for Quiet. I've modified a number of the theme files and such to accomplish this, so I'm not afraid to go under the hood.

If anyone could point me to the sections of which files need to be modified, offer any hints as to the code I should insert, that would be very much appreciated!

I was able to answer a lot of my previous questions via searching this forum. As a first-time poster I'll list my system info below and give everyone involved many thanks!

Thanks - Joe

Gallery URL (optional but very useful): http://www.qitnl.com
Gallery version: 2.3 core 1.3.0 / theme = carbon
Apache version: 2.2.14 (Unix)
PHP version: 5.2.11
Graphics Toolkit: Exif, Getid3, ImageMagick, Thumbnail
Operating system: Linux
Web browser/version (if applicable): Primarily Camino/Mac

 
qitnl

Joined: 2010-02-24
Posts: 3
Posted: Tue, 2010-03-02 04:45

Okay, I hacked around and think I might have figured this out, it seems to be working. Most of this code is completely foreign to me so I'm open to suggestions, maybe you spot some obvious errors. The following is a hack, beware.

First of all, I did some sleuthing by viewing page source:

page code for standard photo display:

<div id="gsImageView" class="gbBlock">
<div id="photo">
<img src="/d/3544-9/aaa.jpg" width="768" height="576" id="IFid1" class="ImageFrame_none" alt="aaa.jpg"/>
</div>

page code for full size popup window:

<td class="gsActionIcon">
<div class="buttonPopup"><a href="/d/11556-3/aaa.jpg" target="_blank"
onclick="popImage(this.href, ''); return false;"
title="Full Size"></a></div>
</td>
</tr>

Note: The above the code that Gallery2/Carbon generates.

In themes/carbon/templates, I find reference to the first in photo.tpl :

<div id="gsImageView" class="gbBlock">
{if !empty($theme.imageViews)}
{capture name="fallback"}
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`"
forceFullUrl=true forceSessionId=true}">
{g->text text="Download %s" arg1=$theme.sourceImage.itemTypeName.1}
</a>
{/capture}
{if ($image.viewInline)}
{if isset($theme.photoFrame)}
{g->container type="imageframe.ImageFrame" frame=$theme.photoFrame
width=$image.width height=$image.height}
<div id="photo">
{g->image id="%ID%" item=$theme.item image=$image
fallback=$smarty.capture.fallback class="%CLASS%"}
</div>
{/g->container}
{else}
<div id="photo">
{g->image item=$theme.item image=$image fallback=$smarty.capture.fallback}
</div>
{/if}
{else}
{$smarty.capture.fallback}
{/if}
{else}
{g->text text="There is nothing to view for this item."}
{/if}
</div>

and the second in navigator.tpl:

{if $theme.params.fullSize && !empty($theme.sourceImage) && count($theme.imageViews) > 1}
{capture name=
arg2="itemId=`$theme.sourceImage.id`"}{/capture}
<td class="gsActionIcon">
<div class="buttonPopup"><a href="{$smarty.capture.url}" target="_blank"
onclick="popImage(this.href, '{$theme.item.title|escape:"quotes"}'); return false;"
title="{g->text text="Full Size"}"></a></div>
</td>
{/if}

I stick the chocolate in the peanut butter just to see what happens. I replaced the first section of photo.tpl with this:

<div id="gsImageView" class="gbBlock">
{if !empty($theme.imageViews)}
{capture name="fallback"}
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`"
forceFullUrl=true forceSessionId=true}">
{g->text text="Download %s" arg1=$theme.sourceImage.itemTypeName.1}
</a>
{/capture}
{if ($image.viewInline)}
{if isset($theme.photoFrame)}
{g->container type="imageframe.ImageFrame" frame=$theme.photoFrame
width=$image.width height=$image.height}
<div id="photo"><a href="{$smarty.capture.url}" target="_blank"
onclick="popImage(this.href, '{$theme.item.title|escape:"quotes"}'); return false;"
title="{g->text text="Full Size"}">

{g->image id="%ID%" item=$theme.item image=$image
fallback=$smarty.capture.fallback class="%CLASS%"}
</a></div>
{/g->container}
{else}
<div id="photo"><a href="{$smarty.capture.url}" target="_blank"
onclick="popImage(this.href, '{$theme.item.title|escape:"quotes"}'); return false;"
title="{g->text text="Full Size"}">

{g->image item=$theme.item image=$image fallback=$smarty.capture.fallback}
</a></div>
{/if}
{else}
{$smarty.capture.fallback}
{/if}
{else}
{g->text text="There is nothing to view for this item."}
{/if}
</div>

Bold is what I added. And everything is Reese's Peanut Butter! At least so far, fingers crossed, not bad for someone who doesn't know what he is doing.

 
qitnl

Joined: 2010-02-24
Posts: 3
Posted: Fri, 2010-08-27 09:08

Update: I was checking my stats and noticed a few clicks from this page. Thought I'd let you know that my script is working perfectly - I haven't thought about it since.

In fact I'm glad I listed the details here for documentation. I had already forgot!