• Well, I have an album with 5 pictures. 3 of them are excluded.

    On frontend, when I display albums listing, my album display 5 pictures, not 3. And when I m going into this album, I have only 3 pictures.

    The patch :
    File /nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery.php

    597c597,600
    < array(“galleryid IN %s”, $gallery_ids))->group_by(‘galleryid’)->run_query(FALSE, TRUE);

    > array(
    > array(“galleryid IN %s”, $gallery_ids),
    > array(‘exclude = %d’, 0)
    > ))->group_by(‘galleryid’)->run_query(FALSE, TRUE);

    https://wordpress.org/plugins/nextgen-gallery/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @v.guerard – I can recreate what I believe you are describing but your “patch” code is a bit hard to read here … do you have a link to a more code friendly site for this patch?

    – Cais.

    Thread Starter v.guerard

    (@vguerard)

    Here is the entire file : http://pastebin.com/zkhJrV1u

    line 597 : on query, I just a the exclude=0

    Old code :
    array(“galleryid IN %s”, $gallery_ids))->group_by(‘galleryid’)->run_query(FALSE, TRUE);

    New code :
    array(array(“galleryid IN %s”, $gallery_ids), array(‘exclude = %d’, 0)))->group_by(‘galleryid’)->run_query(FALSE, TRUE);

    There s also a correction for gallery with all excluded picture

    line 618: just test if gallery counter is great than 0 to add it in $retval array

    Old code :
    $retval[] = $gallery;

    New code :
    if ($gallery->counter > 0) {
    $retval[] = $gallery;
    }

    Plugin Contributor photocrati

    (@photocrati)

    @v.guerard – I’ll update our internal notes for this as well.

    Thanks for the follow-ups!

    – Cais.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Number of pictures in gallery is wrong with excluded picture’ is closed to new replies.