Benjamin
Forum Replies Created
-
I’ve looked through the jquery lightbox code but I don’t see a _show_image function; could you paste your code so far if you’re still having an issue?
We don’t currently support this, but I’ve made an entry in our todo list for the next release.
We don’t currently support this, but I’ll try to include a filter on our use of ‘ngg_tag’ in the next release.
Please forgive my formatting, but I’ve adjusted our basic thumbnails template to fit what you describe. You’ll need to hook up your own styling and javascript to handle hiding the ngg-image- div, but I think this should get you started:
<div class="ngg-galleryoverview" id="<?php echo $gallery->anchor ?>"> <?php $counter = 0; $limit = 5; $header = is_null($this->object->get_routed_app()->get_parameter('page')) ? TRUE : FALSE; foreach ($images as $image) { if ($header && $counter == 0) ?><ul><?php if ($header && $counter <= $limit) { ?> <li> <a href="<?php echo nextgen_esc_url($image->imageURL) ?>" title="<?php echo esc_attr($image->description) ?>" <?php echo $image->thumbcode ?> > <?php if ( !$image->hidden ) { ?> <img title="<?php echo esc_attr($image->alttext) ?>" alt="<?php echo esc_attr($image->alttext) ?>" src="<?php echo nextgen_esc_url($image->thumbnailURL) ?>" <?php echo $image->size ?>/> <?php } ?> </a> </li> <?php if ($counter == $limit) ?></ul> <?php } else { ?> <div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style; ?> > <div class="ngg-gallery-thumbnail" > <a href="<?php echo nextgen_esc_url($image->imageURL) ?>" title="<?php echo esc_attr($image->description) ?>" <?php echo $image->thumbcode ?> > <?php if ( !$image->hidden ) { ?> <img title="<?php echo esc_attr($image->alttext) ?>" alt="<?php echo esc_attr($image->alttext) ?>" src="<?php echo nextgen_esc_url($image->thumbnailURL) ?>" <?php echo $image->size ?>/> <?php } ?> </a> </div> </div> <?php } ?> <?php $counter++; } echo $pagination; ?> </div>
I think your code is just fine. If I can make a recommendation, you are setting the slug to the result of
sanitize_file_name($fileparts['filename']))
– NextGen uses the image alttext which can be the EXIF/IPTC name. If the image lacks metadata it is given to the image filename, so it may not be an issue for you.You can flush the gallery cache afterwards in code by calling
C_Photocrati_Cache::flush('all');
You’re right, I’ll try to have your change included in 2.0.67. Thanks for letting us know!
The JSON API is going to be deprecated in the next release, and has been in the current public beta (2.0.67.45). I would recommend using or switching to the XMLRPC API.
In particular you want to use get_images() whose parameter is gallery_id, which is the gallery whose images you wish to retrieve.
Hi Squazz, I hope I’m interpreting your question correctly.
To do this I believe you will need to know the ID of the page that has been linked to by your album(s):
$page_id = 776; $album_mapper = C_Album_Mapper::get_instance(); $albums = $album_mapper->find_all(array('pageid = %s', $page_id), TRUE); foreach ($albums as $album) { $galleries = $album->get_galleries(TRUE); // $album may also be inspected through var_dump($album->get_entity()) foreach ($galleries as $gallery) { // $gallery may also be inspected through var_dump($gallery->get_entity()); // retrieve images belonging to this gallery var_dump($gallery->get_images()); } }
I hope that helps!
the server support staff were able to determine from the logs that the breach occurred in the /nextgen-gallery/ directory
Could you please let us know what files were determined to be responsible for the breach?
Assuming this is a template for the basic thumbnails display you can use the following:
$gallery->displayed_gallery->get_entity()->container_ids
which is an array of all of the gallery ids (users can select more than one).
Our templates are provided with
$images
as a variable, why would you want to repeat that process (of retrieving images from the db)?You can use one of our two actions that upload_base64_image() runs:
ngg_added_new_image (passes $image object)
ngg_after_new_images_added (passes gallery id and image id)add_action('ngg_added_new_image', 'check_ngg_palette'); function check_ngg_palette($image) { $storage = C_Gallery_Storage::get_instance(); $image_fs_path = $storage->get_image_abspath($image); }
You should be able to safely add attributes to $image and save them with the following:
$image_mapper = C_Image_Mapper::get_instance(); $image_mapper->save($image);
but I would generally recommend using your own storage methods for any attributes that NextGen doesn’t set itself.
I hope that helps!
qTranslate, WPML, and i18n support will finally be coming in the next release.
I believe this is due to a bug in WordPress, see https://core.trac.www.ads-software.com/ticket/17817
If you create a filter that triggers itself a second time any remaining actions will be ignored for the outter filter flow. The nextgen shortcode filter on the_content is given priority PHP_INT_MAX-1 however, so setting your own priority to PHP_INT_MAX will solve your incompatibility.
Forum: Plugins
In reply to: [Flattr] Does not work together with NextGEN GalleryI believe this is due to a bug in how WordPress handles recursion on filters. The next release of NextGEN will include a workaround just for Flattr.
Unfortunately ‘get_gallery’ is just an example and hasn’t been implemented.