Album.php combine Image.php

Hi,

I'm looking to combine the functionalities of Album.php and Image.php
I have no sub Albums so I'm not really interested in subalbums for now.
The concept is this:
List all the images in an album (as album.php) and display the first image of the album in a scaled view next to the list then when someone clicks another thumbnail, I want the page to relaod and the scaled image to changed to teh selected photo.

Illustration

Album.php shows thumbs of img1, img2,img3 and 500px by 500px display of img1. I click img2 thumb and the page relaods to show 500px by 500px img2.

Comments

  • acrylian Administrator, Developer
    Just copy the `next_image()` loop from your album.php page to image.php to achieve this. Please also read here how to skip the actual album display and link directly to image.php from index.php:
    http://www.zenphoto.org/support/topic.php?id=2877&replies=11#post-17258
    http://www.zenphoto.org/support/topic.php?id=63&replies=6

    And be sure to visit our theming tutorial, too.
  • lovely, you're a star. Theming tutorial was a great read :) support here is better ;) I'll post up a link to the finished theme once I'm done with it thanks!
  • Ok so I have achieved what I wanted except now I want the URL to look like the album.php URL (better for permalinks) So I'm skipping album.php but the url for image.php looks something like ~/zenphoto/album_name/imagefilename001.jpg.php

    Is there anyway I can have it look like ~/zenphoto/album_name/ only or atleast ~/zenphoto/album_name/image_title.php
  • No
  • An issue popped up more than once while i was putting up "next" and "back" here is my look:

    `

    <?php if (hasNextImage()) { ?>



    <?php } if (hasPrevImage()) { ?>



    <?php } ?>

    `

    That is in image.php
    My problem is that sometimes an album has a next image and you click "next" it goes to a different album. Any idea why this is happening?
  • acrylian Administrator, Developer
    Which version and which theme please?
  • 1.1.6 and my own theme that I'm making.
  • acrylian Administrator, Developer
    Does it happen with any of the standard themes, too?
  • Yep tested it on the default theme did the same thing.
  • Problem was solved when I refreshed the database.
    Next question :) I am now displaying the images and album thumbnails on the image.php page skipping album.php out. My question is, can I have users comment on the who album whilst viewing images. So for example if someone is viewing "image001.jpg.php" and clicks "next" to go to "image002.jpg.php" and makes a comment on "image002.jpg.php" ... I want the comment to appear on the whole album (ie on both "image002.jpg.php" and "image001.jpg.php".
  • That would not be easy to accomplish since the Comment posting will go to the image with the image specified. You could create a custom next_comment() function that consolodated all comments from the album and use it.
  • Ok the issue with hasNextImage() and hasPrevImage() popped up again and I know why but not a clue on how to solve it. If I search and click on a result of an album from the search page that takes me directly to the image.php page the "Next" functionality breaks and starts skipping albums. Here is the loop for albums on search.php

    ```

    <?php while (next_album(true)): $c++;?>

    <?php $firstimage = $_zp_current_album->getImages(); // get the first image of the current album in the loop?>





    image/images/tag.png" class="tagImage"/><?php printTags('links', null, 'taglist', ''); ?>





    <?php printLinklessRating("album"); ?>



    <?php printAlbumDesc(false); ?>





    <?php if($c%10 == 0) break; ?>

    <?php endwhile; ?>

    `

    and the hasNextImage() on image.php is listed above. I've searched around the forums and have been playing with it for a while but I'm completely stumped. I tried play with set_context(), what it seems to be doing is not realising that it is now within an album . If I click on a thumbnail after arriving from a search page that reloads the image.php page it works fine.

    Sorry for the trouble I'm just baffled :(
  • acrylian Administrator, Developer
    Sorry, I can't really reproduce this. Did you try disabling mod_rewrite. This can cause those things too (in lack of any better idea)
  • would it help if I paste the code for image.php and search.php here?
    mode_rewrite is an integral part of the theme.
  • acrylian Administrator, Developer
    mod_rewrite actually is nothing theme specific unless you hard code any urls. Please try disabling mod_rewrite to see if it works then in one of the standard themes.
  • alright disabled mod_rewrite, recoded the hardcoded urls so i go from search.php to /index.php?album=xx&image=xx.jpg and it still skips albums not images :( What weird is that I have all the images in the album listed and they're fine. It's just the nextImageUrl function on that specific page when accessed in that specific way @_@;

    Is there an alternative way for getNextImageURL and getPrevImageURL ??

    Ok, I think I should post up the link to show you.

    http://development.thepaperdump.com/dump/

    Search for "baskin robins" ignore the auto complete.
  • acrylian Administrator, Developer
    No, there is no alternative to those functions. I see the problem now and I can partly reproduce that the next image in the image view is not always the next image in the search results, but actually I don't have any idea. I believe we had that problem before and actually solved it. Maybe sbillard has any idea.
  • do you reckon the solution is still on the forums? I'm having trouble finding it.
    It seems erratic it'll work sometimes and wont at other times. I'll wait and see what sbillard has to say :)
  • acrylian Administrator, Developer
    We had a problem with the prev/next, but that was way before 1.1.6 and should already be in there...
  • hmmm ... possible that it happened again in 1.1.6 then? @_@;
  • acrylian Administrator, Developer
    I believe, sbillard found the problem and is already working on it.
  • It is fixed in the nightly build
  • updated zp-core with latest nightly build, it's doing the same thing and now it's doing something else. It has a "prev" link to the next image (search baskin robins on my site) and it's still doing the album skipping (search for computer city)
  • acrylian Administrator, Developer
    If you update you also should update the other files like the root index.php (in this case nothing was changed there but to be sure...)

    There was another problem with next/prev that has been fixed after the nightly was generated. So please either wait until the next nightly or use the svn version directly.
  • cool, I'll wait until the next nightly :) yeah I update every file except my themes folder. Then plug in changes I make to the new template-functions.php. Anyway, I'll update in the morning and see what happens.
  • Ok, 11th June nightly build still does the "next image is sometimes next album's image" problem but it stopped doing the weird "back" is "next". Search http://development.thepaperdump.com/dump/ for "computer city".
  • any idea?
Sign In or Register to comment.