Creating a link to an album

Hi, I have successfully installed Zen Photo, created an album and now need to create a link on the web page the album is for to the album. I can,t seem to find a way to do this. Please offer your suggestions on solving this problem.
Thanks,
rhamblin60

Comments

  • I'm not sure I am understanding your request. Do you want to place a link to the page you are on on the page? Seems strange. Anyway, look at the functions guides for `printAlbumLink` and/or `getAlbumLink`. One of those or the object method equivalent should be what you want.
  • Hello

    I am in the process of integrating ZP with a new site. I am working with the latest ZP version 1.4.0.1.

    I needed to provide the URL to an image within the ZP album structure and had to work around what seems to be a problem with the ZP functions.

    (1) My hard drive album structure (default locations) is:
    myHardDrive/zenphoto/albums/myAlbums/

    (2) getAlbumFolder() returns:
    myHardDrive/zenphoto/albums/

    (3) getAlbumLinkURL() returns
    zenphoto/myAlbums/

    In (3) you will see that the "album" folder is missing in the URL. Is this as it should be? Zenphoto does not seem to be affected by this ommission but it means the getAlbumLinkURL() function cannot be used as a pointer to an images folder outside of ZP.

    Can anyone please advise?
  • acrylian Administrator, Developer
    Zenphoto does not access the images in the albums folder directly (unless you want to view the full image). `getAlbumLinkURL()` is the function to use for a link to an album page. `getAlbumFolder()` is for internal use.
    See also: http://www.zenphoto.org/2009/03/troubleshooting-zenphoto/#4
  • Thank you acrylian. However, as I tried to explain, getAlbumLinkURL() is returning the wrong path to the album page.

    Cheers
    rim
  • acrylian Administrator, Developer
    3) getAlbumLinkURL() returns
    zenphoto/myAlbums/

    You apparently did either not read or understand the link I posted. It does return the correct path to an album page which is simply not the same as the location of an album on the filesystem.
  • How can I make a simple list of albums and 1-st level subalbums on main page (index.php) e.g.

    Album 1
    • Subalbum 1
    • Subalbum 2
    • Subalbum 3

    Album 2
    • Subalbum 1
    • Subalbum 2

    etc.

    next_album is working for root albums only, and I can't figure out how to cycle through subalbums on index page.
  • acrylian Administrator, Developer
    Use the print_album_menu plugin. Look at the included Zenpage theme for an example.
  • Thank you, it works just fine.
  • acrylian, thank you for your patience. I clearly did not appreciate the difference well enough! What I am looking for is "the location of an album on the filesystem". Is there a function that does this? I am currently doing it with a composite of several functions.

    var imagePath = '<?php echo "http://"; echo substr(htmlspecialchars(getAlbumFolder()),10); echo substr(htmlspecialchars(getAlbumLinkURL()),10);?>';
  • acrylian Administrator, Developer
    `FULLWEBPATH.'/'.ALBUMFOLDER.'/'.$_zp_current_album->name` get the link to the album on the filename.
  • If you really want a file system link (as opposed to a WEB link to the file, there is a difference) then use `$_zp_current_album->localpath`
  • Thank you acrylian and sbillard, this is a great help.
Sign In or Register to comment.