(invisible) links to pictures before and after the actual album page

2»

Comments

  • Solved it - with absolute values right now. Maybe I look for the variables for "thumbs on each row / page" ...

    `
    <?
    $albumseiten = getTotalPages();
    $aktuelleseite = getCurrentPage();
    $subalbumzeilen = floor(($_zp_current_album->getNumAlbums() + 2) / 3);
    $thumbsersteseite = (12 - (3 * $subalbumzeilen));
    if (($albumseiten > 1) AND ($aktuelleseite > 1)) {
    for($vorseite = 1; $vorseite < $aktuelleseite; ++$vorseite) {
    $bilder = $_zp_current_album->getImages($vorseite, $thumbsersteseite);
    $i=0;
    foreach ($bilder as $bild) {
    $bild = $bilder[$i];
    $imageobject = newImage($_zp_current_album,$bild);
    $bildnummer = $imageobject->getIndex()+1;
    ++$i;
    echo'getFullImage().'" title="'.$imageobject->getDefaultTitle().' ('.$bildnummer.'/'.$_zp_current_album->getNumImages().')">'."\n";
    }
    }
    }
    ?>


    <?php while (next_image()): ?>

    <?php endwhile; ?>

    <?
    $albumseiten = getTotalPages();
    $aktuelleseite = getCurrentPage();
    $subalbumzeilen = floor(($_zp_current_album->getNumAlbums() + 2) / 3);
    $thumbsersteseite = (12 - (3 * $subalbumzeilen));
    if (($albumseiten > 1) AND ($aktuelleseite < $albumseiten)) {
    for($nachseite = ($aktuelleseite+1); $nachseite < ($albumseiten+1); ++$nachseite) {
    $bilder = $_zp_current_album->getImages($nachseite, $thumbsersteseite);
    $i=0;
    foreach ($bilder as $bild) {
    $bild = $bilder[$i];
    $imageobject = newImage($_zp_current_album,$bild);
    $bildnummer = $imageobject->getIndex()+1;
    ++$i;
    echo'getFullImage().'" title="'.$imageobject->getDefaultTitle().' ('.$bildnummer.'/'.$_zp_current_album->getNumImages().')">'."\n";
    }
    }
    }
    ?>
    `
    Wete
  • I read the next_image()'s code, but I felt like I did not reach the Age of Enlightment right now. :)
  • acrylian Administrator, Developer
    Great..:-)
  • There is a global varaiable `$_firstPageImages` which should contain the number you want. If it is not setup then you need to call the `setThemeColumns()` function.
  • Great. This saved 2 hours of brain-squeezing - if I had known this fact yesterday.
    :)
  • Exactly what I was needing. Thank you very much Wete for sharing your code!

    Regards,
    Adrian
  • Sorry for bringing this thread up again.. I have a little problem with this piece of code from Wete's script:

    `$imageobject->getDefaultTitle()`

    Printing the title attribute for the hidden links doesn't print the string value from the database, it just prints the filename without the extension (i.e. "filename_13" instead of "Filename Thirteen"). This messes up the image presentation a bit for paginated albums. All of this is happening while it's counterpart in the visible thumb links loop

    `<?php echo html_encode(getAnnotatedImageTitle()); ?>`

    works just fine.. Also I would like to know if there is any way to get the image description?

    (Something similar to this
    `<?php echo html_encode(getImageDesc());?>`
    I have tried looking here but with no succes http://www.zenphoto.org/documentation/classes/_Image.html )

    Thank you very much!
  • acrylian Administrator, Developer
    Of course, you can get everything via the object model. `$imageobject->getDesc()`. `$imageobject->getTitle()`. The image class has parent classes shared with albums that provides this by inheritance (one definition for both):
    http://www.zenphoto.org/news/zenphotos-object-model-framework#zenphotos-main-classes
  • Thank you very much Acrylian. It seems I really must spend some time learning about php object programming and zenpohto object model.

    Regards,
    Adrian
  • Well, actually, this function really should have been a private method (of the image object). But I guess it got mised. PHP 4 did not allow for private methods so none existed when we did still support PHP 4. Perhaps not all that should be private got discovered when we changed for PHP 5 and marked methods private.

    At any case, the documentation will generally tell you the use of a function. In this case no such documentation would be an indication that the function is not inteneded for general use.
Sign In or Register to comment.