[SOLVED] Click resized image for full sized

nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2005-05-07 17:31

Direct link to solution for G2 final release:
http://gallery.menalto.com/node/30144#comment-136055

EDIT: This is for the old layout/theme system:
I see I need to edit singleBody.tpl, but I'm having a hard time understanding what to edit to make this happen.

I want to be able to click on the resized image to view the full sized (or next size larger) image if the person has permissions to view the full sized image. I'd also like to go back down one resized image when viewing the full size image.

I can see I need to edit this line

            {g->image item=$layout.item image=$image id="%ID%" class="%CLASS%"}

But I'm not sure to what.

Thanks

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-05-07 19:18

there are links to the other sizes on that page.. see if you can figure it out from those..

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2005-05-07 19:31

That's exactly what I was trying to do, but I don't understand the code.

I did modify this

      {if ($layout.viewInline[$layout.imageViewsIndex])}
        {if isset($layout.photoFrame)}
          {g->block type="imageframe" frame=$layout.photoFrame}
            {g->image item=$layout.item image=$image id="%ID%" class="%CLASS%"}
          {/g->block}
        {else}
          {g->image item=$layout.item image=$image fallback=$smarty.capture.fallback}
        {/if}
      {else}
        {$smarty.capture.fallback}
      {/if}

to this

        {if isset($layout.photoFrame)}
          {g->block type="imageframe" frame=$layout.photoFrame}
              {if count($layout.imageViews) > 1}
                <a href="{g->url arg1="view=core:ShowItem" arg2="itemId=`$layout.item.id`"
                 arg3="imageViewsIndex=`$layout.sourceImageViewIndex`"}">
                  {$smarty.capture.fullSize}
                    {g->image item=$layout.item image=$image id="%ID%" class="%CLASS%"}
               </a>
              {else}
                {$smarty.capture.fullSize}
              {/if}
          {/g->block}
        {else}
          {g->image item=$layout.item image=$image fallback=$smarty.capture.fallback}
        {/if}

But the full size then doesn't go back to the smaller size and I get border around the image when hovering over it with the mouse.

I know I can understand the code in G2 better if I get a few pointers on what is what. Which leads me to my next question in the latest topic I'm about to post...

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-05-07 20:34

you're on the right track.. i suppose this takes some tricky smarty handling. here are some tips:
you've got $layout.imageViews which is an array of info about all the image sizes the user can see.. the fullsize is in there at $layout.sourceImageViewIndex if available, $layout.imageViewsIndex is the one currently being shown.
i think you could do this: {assign var="nextIndex" value=($layout.imageViewsIndex+1)%count($layout.imageViews)}
this will get you the index of the next bigger size, or wrap around from the biggest to the smallest. then use $nextIndex in your link instead of $layout.sourceImageViewIndex.
maybe put border="0" in the g->image to avoid the border?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2005-05-07 21:11

I think I'm very close and I think I think I know what needs to be modified. I just don't know PHP to fix it.

The code you provided is almost there. When I use this
{assign var="nextIndex" value=($layout.imageViewsIndex+1)%count($layout.imageViews)}
I keep getting a page with no image, but a link to down load the file

If I change it to this:
{assign var="nextIndex" value=$layout.imageViewsIndex+1}
Then it at least goes from the resized image to the full size image. However, there is nothing larger than the full size image so it doesn't go any farther.

This is that section of code I've edited so far:

      {if ($layout.viewInline[$layout.imageViewsIndex])}
        {if isset($layout.photoFrame)}
          {g->block type="imageframe" frame=$layout.photoFrame}
            {if count($layout.imageViews) > 1}
              {assign var="nextIndex" value=$layout.imageViewsIndex+1}
               <a href="{g->url arg1="view=core:ShowItem" arg2="itemId=`$layout.item.id`"
                arg3="imageViewsIndex=`$nextIndex`"}">
                {g->image item=$layout.item image=$image id="%ID%" class="%CLASS%"}
               </a>
            {else}
              {$smarty.capture.fullSize}
            {/if}
          {/g->block}
        {else}
          {g->image item=$layout.item image=$image fallback=$smarty.capture.fallback}
        {/if}
      {else}
        {$smarty.capture.fallback}
      {/if}

Thanks for all the help you've provided me today 'mindless'

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2005-05-07 23:48

HAHA! I finally got something working. I'm sure it could be made more effecient. Took a bit of trial and error not knowing proper syntax for PHP and then not knowing Smarty at all and learning there's a difference here.

Here's what I kludged together

             {if count($layout.imageViews) > 1}
              {if $layout.imageViewsIndex==0}
                {assign var="nextIndex" value=1}
              {elseif $layout.imageViewsIndex==count($layout.imageViews)-1}
                {assign var="nextIndex" value=0}
              {else}
                {assign var="nextIndex" value=$layout.imageViewsIndex+1}
              {/if}
               <a href="{g->url arg1="view=core:ShowItem" arg2="itemId=`$layout.item.id`"
                arg3="imageViewsIndex=`$nextIndex`"}">
                {g->image item=$layout.item image=$image id="%ID%" class="%CLASS%"}
               </a>
            {else}
              {$smarty.capture.fullSize}
            {/if}

I don't know if I need the last else statment in there. I would greatly appreciate any feedback on what could be made better with the above code.

 
matt2051b
matt2051b's picture

Joined: 2005-06-01
Posts: 14
Posted: Thu, 2005-06-02 23:34

Kevin nice work! I was trying to do the same thing with now luck.

I'm trying your kludged together code and it works great for me! and yes I do belive you need theat last {else} statement.

 
lockjaw

Joined: 2005-06-03
Posts: 1
Posted: Fri, 2005-06-03 13:21

For all those dorks that use photo frames - I updated this amazingly useful code to include photoframe support. This is my first code posting so please be gentle.

{if count($layout.imageViews) > 1}
              {if $layout.imageViewsIndex==0}
                    {assign var="nextIndex" value=1}
              {elseif $layout.imageViewsIndex==count($layout.imageViews)-1}
                    {assign var="nextIndex" value=0}
              {else}
                    {assign var="nextIndex" value=$layout.imageViewsIndex+1}
              {/if}
              {if isset($layout.photoFrame)}
 {g->block type="imageframe" frame=$layout.photoFrame}
               <a href="{g->url arg1="view=core:ShowItem" arg2="itemId=`$layout.item.id`" arg3="imageViewsIndex=`$nextIndex`"}">
                    {g->image item=$layout.item image=$image id="%ID%" class="%CLASS%"}
               </a>
 {/g->block}
{else}
               <a href="{g->url arg1="view=core:ShowItem" arg2="itemId=`$layout.item.id`" arg3="imageViewsIndex=`$nextIndex`"}">
                    {g->image item=$layout.item image=$image id="%ID%" class="%CLASS%"}
               </a>
{/if}
            {else}
              {$smarty.capture.fullSize}
            {/if}
    {else}
      {g->text text="There is nothing to view for this item."}
    {/if}

Thank you very much for posting the original. I was working on the same - but mine was way more ugly!

LJ

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2005-06-04 02:31

Nice catch. Thanks. I've revised my code so the end result is a little cleaner to the end user.

1) No <a href... if the user can't view anymore than the one image.

2) Retains the "smarty.capture.fallback" stuff, what ever that's for. I hope a dev person can explain that to me.

EDIT: This is solved, minor typo in the code:

Quote:
Can someone please explain why the URL to the larger sizes doesn't use the short URLs? It does on the "Full size" link near the top of the page and as far as I can tell there's not much difference in the code for generating the URLs.

Here's a link for you to see what I'm talking about,
EDIT: removed link

Please feel free to pipe in if there's a better way to code this.

EDIT: view=core:ShowItem should be view=core.ShowItem. Note the period (.) instead of the colon (:)
Had to run that through beyond compare to figure out what the heck was going.

See the code here

{if ($layout.viewInline[$layout.imageViewsIndex])}
        {if count($layout.imageViews) > 1}
          {if $layout.imageViewsIndex==0}
            {assign var="nextIndex" value=1}
          {elseif $layout.imageViewsIndex==count($layout.imageViews)-1}
            {assign var="nextIndex" value=0}
          {else}
            {assign var="nextIndex" value=$layout.imageViewsIndex+1}
          {/if}
          {if isset($layout.photoFrame)}
            {g->block type="imageframe" frame=$layout.photoFrame}
              <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$layout.item.id`"
              arg3="imageViewsIndex=`$nextIndex`"}">
                {g->image item=$layout.item image=$image id="%ID%" class="%CLASS%"}
              </a>
            {/g->block}
          {else}
            <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$layout.item.id`"
            arg3="imageViewsIndex=`$nextIndex`"}">
              {g->image item=$layout.item image=$image fallback=$smarty.capture.fallback}
            </a>
          {/if}
        {else}
          {if isset($layout.photoFrame)}
            {g->block type="imageframe" frame=$layout.photoFrame}
              {g->image item=$layout.item image=$image id="%ID%" class="%CLASS%"}
            {/g->block}
          {else}
              {g->image item=$layout.item image=$image fallback=$smarty.capture.fallback}
          {/if}
        {/if}
      {else}
        {$smarty.capture.fallback}
      {/if}
 
ScaryFast

Joined: 2005-06-09
Posts: 4
Posted: Tue, 2005-06-14 04:32
nivekiam wrote:
Nice catch. Thanks. I've revised my code so the end result is a little cleaner to the end user.

1) No <a href... if the user can't view anymore than the one image.

2) Retains the "smarty.capture.fallback" stuff, what ever that's for. I hope a dev person can explain that to me.

EDIT: This is solved, minor typo in the code:

Quote:
Can someone please explain why the URL to the larger sizes doesn't use the short URLs? It does on the "Full size" link near the top of the page and as far as I can tell there's not much difference in the code for generating the URLs.

Here's a link for you to see what I'm talking about,
EDIT: removed link

Please feel free to pipe in if there's a better way to code this.

EDIT: view=core:ShowItem should be view=core.ShowItem. Note the period (.) instead of the colon (:)
Had to run that through beyond compare to figure out what the heck was going.

See the code here

{if ($layout.viewInline[$layout.imageViewsIndex])}
        {if count($layout.imageViews) > 1}
          {if $layout.imageViewsIndex==0}
            {assign var="nextIndex" value=1}
          {elseif $layout.imageViewsIndex==count($layout.imageViews)-1}
            {assign var="nextIndex" value=0}
          {else}
            {assign var="nextIndex" value=$layout.imageViewsIndex+1}
          {/if}
          {if isset($layout.photoFrame)}
            {g->block type="imageframe" frame=$layout.photoFrame}
              <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$layout.item.id`"
              arg3="imageViewsIndex=`$nextIndex`"}">
                {g->image item=$layout.item image=$image id="%ID%" class="%CLASS%"}
              </a>
            {/g->block}
          {else}
            <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$layout.item.id`"
            arg3="imageViewsIndex=`$nextIndex`"}">
              {g->image item=$layout.item image=$image fallback=$smarty.capture.fallback}
            </a>
          {/if}
        {else}
          {if isset($layout.photoFrame)}
            {g->block type="imageframe" frame=$layout.photoFrame}
              {g->image item=$layout.item image=$image id="%ID%" class="%CLASS%"}
            {/g->block}
          {else}
              {g->image item=$layout.item image=$image fallback=$smarty.capture.fallback}
          {/if}
        {/if}
      {else}
        {$smarty.capture.fallback}
      {/if}

Thanks very much for this code, it works wonderfully for me. Now if only I could figure out how to make it open the image in a popup, just the image by itself.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2005-06-14 05:20
 
ScaryFast

Joined: 2005-06-09
Posts: 4
Posted: Tue, 2005-06-14 05:40

yes, thanks. after I posted that I continued my search and ended up just making the full-size link under the drop down open the image in a new window. I need to look into how I can make it open the image in a new window and let me click the image in the new window to close the window and go back to the original.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2005-06-14 05:45

Ah, you may also want to look at this thread, http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=30995&start=0

You might be able to have a javascript popup to open a new window with a special template setup for viewing just the image. The window wouldn't be just the image as it would actually be an HTML page showing as much or as little as you want. Then you could include javascript so you could click on the image to close the window.

Just an idea.

 
ScaryFast

Joined: 2005-06-09
Posts: 4
Posted: Tue, 2005-06-14 06:12

Thanks again. I figured some javascript would be the way to go but I know nothing about this stuff. I tent to try and find someone else who did it and then just copy their code and play with it till it does what I want. At least I'm learning more about html and other stuff :P

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2005-06-14 06:22

Hey, that's how I've learned most of the stuff I know about HTML, CSS, PHP and JavaScript. Not that it's much at all. ;)

 
viper99
viper99's picture

Joined: 2004-01-22
Posts: 19
Posted: Fri, 2005-08-19 02:57

I really want to try this code. Would you please let me know, which file to edit
for G2-RC1? Thanks!

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2005-08-19 03:12

Thanks to who ever edited out my obsolete links.

You'd edit photo.tpl. I don't know how much of that code is still valid.

One of these days when I create my own theme, this will be one of the features of it ;)

 
pippin88

Joined: 2005-09-17
Posts: 23
Posted: Tue, 2005-09-20 06:17

An update to this would be great.

Don't think it'll work with a fair bit of modification - there is nothing in photo.tpl similar to this: {g->image item=$layout.item image=$image id="%ID%" class="%CLASS%"} (That I can see)

 
ZyreX

Joined: 2004-03-04
Posts: 43
Posted: Wed, 2005-09-21 07:04

Can't see that this is Solved, as when I use that code, my gallery breaks, it won't show the picture at all.. any updates would be great...

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Thu, 2005-09-22 02:13

It is solved depending on what you're trying to achieve and have enough patience to read multiple topics and threads :-). The problem I see is that this topic along with several other topics have a conglomeration of similar multiple methods (see links posted by nivekiam above) that produce different results. Some folks wanted the full size image to open in a new window when clicking on the resized image, others wanted just a text link, some wanted both, some wanted full-size to display within same browser, window, etc., and of course which code snippets to insert and or replace into which files based on how you want it to display.
Depending on what you're trying to achieve check out this thread

So, since G2 1.0 is now released it would be great if some kind soul would wrap-up these topics/threads and put the applicable, correct modifications into a single howto topic along with a pointer on the codex site.

Another option is to submit a feature request, specifying something like the mgmt interface would offer the admin the ability to select how the full-size image should be displayed.

 
weeguy

Joined: 2004-01-18
Posts: 12
Posted: Fri, 2005-09-23 15:48

I believe the migration from phpbb reformatted most of the brackets used in scripts posted earlier on. Sad to say, this rendered most of the useful scripts as plain gibberish (unless someone has the time and effort to slowly decipher what those &#123, &lt or &gt means).

So if someone still has a functional copy of the patched files, do consider posting it up. Thanks.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2005-09-25 15:56

UPDATED FOR G2 FINAL RELEASE!!!
ZyreX, it was solved for the old theme/layout system. Here's the solution for the theme system that's now in place. This works for the matrix theme, edit /themes/matrix/templates/photo.tpl and save it to /themes/matrix/templates/local/photo.tpl

I didn't try this with any of the other themes.
Replace this code

	    {if ($image.viewInline)}
	      {if isset($theme.photoFrame)}
		{g->container type="imageframe.ImageFrame" frame=$theme.photoFrame}
		  {g->image id="%ID%" item=$theme.item image=$image fallback=$smarty.capture.fallback class="%CLASS%"}
		{/g->container}
	      {else}
		{g->image item=$theme.item image=$image fallback=$smarty.capture.fallback}
	      {/if}

With this code:

	    {if ($image.viewInline)}
	      {if count($theme.imageViews) > 1}
		{if $theme.imageViewsIndex==0}
		  {assign var="nextIndex" value=1}
		{elseif $theme.imageViewsIndex==count($theme.imageViews)-1}
		  {assign var="nextIndex" value=0}
		{else}
		  {assign var="nextIndex" value=$theme.imageViewsIndex+1}
		{/if}
		{if isset($theme.photoFrame)}
		  {g->container type="imageframe.ImageFrame" frame=$theme.photoFrame}
		    <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.item.id`"
			arg3="imageViewsIndex=`$nextIndex`"}">
		      {g->image id="%ID%" item=$theme.item image=$image fallback=$smarty.capture.fallback class="%CLASS%"}
		    </a>
		  {/g->container}
		{else}
		  <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.item.id`"
		      arg3="imageViewsIndex=`$nextIndex`"}">
		    {g->image item=$theme.item image=$image fallback=$smarty.capture.fallback}
		  </a>
		{/if}
	      {else}
		{if isset($theme.photoFrame)}
		  {g->container type="imageframe.ImageFrame" frame=$theme.photoFrame}
		    {g->image id="%ID%" item=$theme.item image=$image fallback=$smarty.capture.fallback class="%CLASS%"}
		  {/g->container}
		{else}
		  {g->image item=$theme.item image=$image fallback=$smarty.capture.fallback}
		{/if}
	      {/if}
 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2005-09-25 16:03

Swordfish, there is a "how to" page and a "user contribs" section on the codex:
http://codex.gallery2.org/index.php/Gallery2:How_Tos

http://codex.gallery2.org/index.php/Gallery2:UserContributions (check out the Mods/Patches) section

Feel free to add anything you like :)

 
pippin88

Joined: 2005-09-17
Posts: 23
Posted: Sun, 2005-09-25 21:34

Works great, thankyou very much.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2005-09-25 21:41

Great to hear that! Thanks for letting me know.

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live [url=href="http://photos.kevinnehls.com]here[/url]

 
ZyreX

Joined: 2004-03-04
Posts: 43
Posted: Mon, 2005-09-26 06:12

yeah, thanks, now it works great! :D

 
gumnaam1

Joined: 2006-05-04
Posts: 4
Posted: Sat, 2006-07-15 23:35

I modified it even a bit more to make the fullsize image show up using the lightbox javascript effects.

Just change

Quote:
<a href="{g->url arg1="view=core.ShowItem"

To

Quote:
<a rel="lightbox" href="{g->url arg1="view=core.DownloadItem"

In the patch mentioned above, and add lightbox javascripts and css to theme.tpl.

For a demo see
http://bhaskarvk.info/gallery/wildlife/birds/macaws/img_3983.jpg.html

Click on the image to see the lightbox effect.

 
Mr. X
Mr. X's picture

Joined: 2006-07-14
Posts: 3
Posted: Tue, 2006-07-18 16:50

I got this error:

Quote:
Fatal error: Smarty error: [in gallery:themes/matrix/templates/photo.tpl line 24]: syntax error: unrecognized tag: g->theme include="sidebar.tpl" (Smarty_Compiler.class.php, line 436) in \gallery2\lib\smarty\Smarty.class.php on line 1088

I just used the nivekiam's steps in the "G2 final release"...

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2006-07-19 03:29

What is the version of your G2 install, can you provide a link to it? I'll double check that code with 2.1.1

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
Mr. X
Mr. X's picture

Joined: 2006-07-14
Posts: 3
Posted: Wed, 2006-07-19 11:24

I run the gallery on localhost.

Quote:
Gallery version = 2.1.1 core 1.1.0.1
PHP version = 5.1.4 apache2handler
Webserver = Apache/2.2.2 (Win32) DAV/2 mod_ssl/2.2.2 OpenSSL/0.9.8b mod_autoindex_color PHP/5.1.4
Database = mysql 5.0.21-community-nt, lock.system=database
Toolkits = Thumbnail, ImageMagick
Acceleration = partial/21600, partial/21600
Operating system = Windows NT CKOMP 5.1 build 2600
Default theme = matrix
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060710 Firefox/2.0b1

I think I edited template wrong... I used Nvu and Notepad (I don't have Dreamweaver at the moment).
Here's the file I got.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2006-07-19 12:48

Ah, yes, just use Notepad and try it again with. I've not used Nvu to edit Gallery template files, but what little I have used of Nvu it has completely reformated my into an unreadable mess.

Just looked at the file. Yep, Nvu messed the code up. Get a clean copy of photo.tpl, hopefully you backed it up before changing it. Then make the edits in Notepad.

I see every where Nvu saw:
{g->

It replaced it with:
{g&gt;}

Along with some other similar messiness like &quot;[code] and changing this [code]{g->url to this %7Bg-%3Eurl%20
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
Mr. X
Mr. X's picture

Joined: 2006-07-14
Posts: 3
Posted: Wed, 2006-07-19 14:12

Yea I made all the changes in \local folder

I edited the file in notepad once again, but now it's acting like no changes were made...
It's giving me the regular photo page, not a full size image.

Here's the photo.tpl file again...

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2006-07-20 02:28

That looks about right, make sure you clear the template cache in Site Admin > Maintenance > Delete template cache.

One thing to note is that it appears this functionality has made it into the core of Gallery. I'm not running a current release but a newer code base checked out from Subversion (SVN) and this functionality is there without me having to have made any changes. So this functionality will most likely be in the next release of G2.

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
c0nsumer

Joined: 2002-07-25
Posts: 25
Posted: Thu, 2006-08-24 21:37

Just FYI, on my site this seems to break the stuff which causes Gallery to allow one to download items such as ZIP files and PDFs in their original formats. You can see this problem here with the ZIP files and PDFs.

I'm looking into fixing it now, but I'm curious if anyone else has run into this and already resolved this, or if maybe I did something wrong?

Thanks...

-Steve

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2006-08-25 14:43

If you still have the "{else}
{$smarty.capture.fallback}" code just below the modified section, and you still have the {capture name="fallback"} section above, then you should see the download link for these.

 
jcummings

Joined: 2003-01-06
Posts: 20
Posted: Sat, 2006-09-09 18:23

Ok, I tried this (G2 final release above) in g2.02 and it has an interesting side effect. It cycles through all the available image sizes getting smaller and smaller and then looping around to full-size, then back down through the various resized images. I.e. it goes resizedLarge -> ResizedMedium -> ResizedSmall -> FullSize -> resizedLarge

I think this is a *Great* side effect, but is there an easy way to change the direction it goes? I.e. I want it to go resizedMedium -> resizedLarge -> FullSize -> resizedSmall -> resizedMedium ->resizedLarge, etc.

-James

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2006-09-10 22:30

rewrite the logic that assigns the nextIndex value in the code posted above

 
freakQNC
freakQNC's picture

Joined: 2006-09-14
Posts: 8
Posted: Sun, 2006-09-24 17:50
Mr. X wrote:
Yea I made all the changes in \local folder

I edited the file in notepad once again, but now it's acting like no changes were made...
It's giving me the regular photo page, not a full size image.

Here's the photo.tpl file again...

Hey Mr. X... could you make the file available via a static link on your site or something like that. The link you posted a while ago on Rapidshare is no longer working as file has been deleted. Thanks!

Peace.

~*~ I am an hot blooded Italian, I never get upset... I may get real pissed... but never upset ~*~

 
freakQNC
freakQNC's picture

Joined: 2006-09-14
Posts: 8
Posted: Sun, 2006-09-24 18:33

OK I replaced this codebelow in the Classic Template:

if ($image.viewInline)}
if isset($theme.photoFrame)}
g->container type="imageframe.ImageFrame" frame=$theme.photoFrame
width=$image.width height=$image.height}
g->image id="%ID%" item=$theme.item image=$image
fallback=$smarty.capture.fallback class="%CLASS%"}
{/g->container}
{else}
{g->image item=$theme.item image=$image fallback=$smarty.capture.fallback}
{/if}
{else}
{$smarty.capture.fallback}
{/if}

With this code that has been posted here:

{if ($image.viewInline)}
{if count($theme.imageViews) > 1}
{if $theme.imageViewsIndex==0}
{assign var="nextIndex" value=1}
{elseif $theme.imageViewsIndex==count($theme.imageViews)-1}
{assign var="nextIndex" value=0}
{else}
{assign var="nextIndex" value=$theme.imageViewsIndex+1}
{/if}
{if isset($theme.photoFrame)}
{g->container type="imageframe.ImageFrame" frame=$theme.photoFrame}
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.item.id`"
arg3="imageViewsIndex=`$nextIndex`"}">
{g->image id="%ID%" item=$theme.item image=$image fallback=$smarty.capture.fallback class="%CLASS%"}
</a>
{/g->container}
{else}
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.item.id`"
arg3="imageViewsIndex=`$nextIndex`"}">
{g->image item=$theme.item image=$image fallback=$smarty.capture.fallback}
</a>
{/if}
{else}
{if isset($theme.photoFrame)}
{g->container type="imageframe.ImageFrame" frame=$theme.photoFrame}
{g->image id="%ID%" item=$theme.item image=$image fallback=$smarty.capture.fallback class="%CLASS%"}
{/g->container}
{else}
{g->image item=$theme.item image=$image fallback=$smarty.capture.fallback}
{/if}
{/if}

What happened is that photos are no longer displayed. Any ideas why?

Peace.

~*~ I am an hot blooded Italian, I never get upset... I may get real pissed... but never upset ~*~