Index to Image Link

Hi All,

I'm trying to make it so that albums that have only 1 video or image, link directly from index.php to image.php. Basically I am trying to eliminate the album page for albums that only have 1 entry. Usually for videos on our site.

I have tried `getAlbumLinkURL().getImageLinkURL()`, it returns the album link but not the image portion.

Any help would be appreciated, thank you.

Comments

  • Try something like: if (getNumImages() <= 1) { echo '';} else { do all you do normal }

    Works fine for me, all folders with more than one image get shown.
  • Thank you for the reply. The problem isn't with images not showing.

    From the index.php page you click the thumbnail of an album, that brings you to album.php where you can select an image you want to view that will take you to image.php.

    I am trying to take album.php out of the equation for albums with only 1 image/video. To go from index.php directly to image.php.

    SO basically I am looking for a way to return the value of the URL to the single image/video on the index page.
  • acrylian Administrator, Developer
    You will have to use the object model to achieve that. Please see the user guide for info.
  • Mhm, isnt it the same like:
    if (getNumImages() == 1) { show me the image direct } else { do all you do normal }

    i think so, but this time ive not tested.
  • acrylian Administrator, Developer
    Yes, that tells you if there is only one image in the album. But not the link to it. You need to know which image you want to link to. Within the album loop you don't know that unless you use the object model to get the images of the album and telling which you want to use. It always comes down to the object model which is the core of everything.
  • I know, but what i've meaned was when i insert the function he checks it out, the function to show the image should be:
    if (getNumImages() == 1) {
    echo '<h3>getTitle())) . '">'.html_encode($randomImage->getTitle()).'</h3>'; } else { do all you do normal }

    Or not?! Also untesed and it should be just the link to the image not the image itself, but with the mansonry theme it works in this way. He jumps direct to the image, it should also work for videos. Mansonry theme line 39 to 57...

    And by the way, its an interesting thing to hide. Maybe a photograph got a nude folder, it dont should shown. Have you includet a function to hide albums in the script?
  • acrylian Administrator, Developer
    The code you posted is truncated as you did not escape it correctly (see below the form).

    In any case `$randomImage` must be an image object and that needs to be setup somehow. Within the `next_album` loop there is no "current image" so you have to setup it via the said object model first which image to get.

    Regarding hiding: You can unpublish albums so only persons who know the link can see it. Or password protect it. Also you can of course use a specific image as the album thumb so it is "save".
  • acrylian, i just ask a question about working/not working things and sait wich theme it comes from. So if someone needs it, he could find it out there. ;)

    And if someone talk about it, he also can see what i mean and agree/disagree...

    As the album thump, but not in the random image sliding function. This is we talking about, and the photograph wants to publish the files, but dont want to show it in the image slider. (dont ask me why :D) I mean i can write a little code wich checks if its a nude picture, but it is easier to use an existing function to hide or something like that. Without unpublish. But your answer is then: no, there is no existing function, right?!
  • acrylian Administrator, Developer
    I am just trying to put on the right track what to do if you want to do this.

    As for the thumb if it is published it will appear in the places where needed. There is no other way without making custom functions with specific checks (for a specific tag).
  • I thought the same, give it a special tag, or maybe a database hide function to hide/unhide. Easiest way i think is the database function, but i dont want to go so deep in the core while an update could destroy all the work.

    But thx ;)
  • acrylian Administrator, Developer
    Well the database hide function is not publishing..;)
Sign In or Register to comment.