Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter pawelo

    (@pawelo)

    Like I said for some reason the: $picturelist = nggdb::get_gallery($image->gid); in functions:

    ipHasVotedOnGalleryImage(),
    userHasVotedOnGalleryImage()

    was returning empty array(), so:

    WHERE pid IN (“.implode(‘, ‘, $inPid).”)

    generate SQL syntax error.

    Because I don’t known code of your plugin, I go around with the images IDs.

    I get the IDs from NextGen gallery plugin, just before displaing images from gallery ( adding a second loop ), something like:

    <?php $imagesIds = array(); ?>
    <?php
    for ($i=0; $i<count($images); $i++){
    $image = $images[$i];
    $imagesIds[] = esc_attr($image->{$image->id_field});
    }
    ?>

    and then pass the ids throu the, voting form initializer:

    <?php echo nggv_imageVoteForm($image->pid, 0, $imagesIds); ?>

    then in voting plugin I added:

    if(empty($inPid))
    $inPid = $imagesIds

    And now it works. But it’s a way around, you probably fix it better.

    Thread Starter pawelo

    (@pawelo)

    i already figured it out. thanks!

    Thread Starter pawelo

    (@pawelo)

    yes, I have gallery and three images inside. Images are displaying in page and also the stars or hands icons too, but checking if IP already voted is broken also ajax request not working after click on voting icon.

    clicked image “$image->gid” is correct, and then I need to get all images from gallery which have this ID. the nggdb::get_gallery($image->gid); is not working correct, is there any other method to get the images objects fromt the gallery?

Viewing 3 replies - 1 through 3 (of 3 total)