Benjamin
Forum Replies Created
-
“Attach-To-Post” is just the name given, it works equally with WordPress pages and posts.
The filter will work with it and shortcodes as well, by the way.
Hi dh333,
There isn’t presently a way to do this with NextGen 2.1 but I’ve added a filter (‘ngg_manage_albums_items_order’) that will be in the next release. You can edit your current instance with my same change to use it right away in an upgrade-safe way; just edit nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/album.php and add this after line 90:
if (apply_filters('ngg_manage_albums_items_order', 'ASC') == 'DESC') { $this->albums = array_reverse($this->albums, TRUE); $this->galleries = array_reverse($this->galleries, TRUE); }If you’d like to change the order of galleries displayed in the frontend you use a custom template and rather than calling
foreach($galleries as $gallery)useforeach(array_reverse($galleries, TRUE) as $gallery)Could you determine which of the conditions in the validate_ajax_request() if clause is failing?
We began ‘compiling’ NextGen’s PHP for public releases around 2.0.79 by combining all files in a given module into the package file you see in our public releases. The plugin code is hosted on Bitbucket where our classes are kept in separate files during development.
Hi rphair,
C_Gallery_Storage::get_instance()->get_gallery_abspath($gallery_id)Will return the gallery absolute path, or you inspect the path attribute of a gallery:
C_Gallery_Mapper::get_instance()->find($gallery_id)->pathThere are a few similar management classes, with C_(Gallery|Album|Image)_Mapper used to find and retrieve items from the database, and C_(Gallery|Image|Album)_Storage are available to determine file paths or URI.
I believe the standard path changed Multisite/3.5 (see codex entry on multisite network admin. Since then the new standard is in WP_CONTENT/uploads/sites/
$this->validate_ajax_request(NULL, TRUE)should return TRUE when the first parameter is NULL or empty. Is the above the result of validate_ajax_request(‘nextgen_upload_image’), and if not could you post that?We don’t currently support Bedrock and it’s not too likely we’ll support it in the very next update, but it’s been requested enough I’m going to try to include compatibility in the release after 2.1.1.
Could you tell us what a var_dump($sec_token) right above the second if returns? It could be that token generation may not be right on your system.
Check out the file nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnails_controller.php and its index_method() action. If you set $_REQUEST[‘ajax_pagination_referrer’] you can control how pagination urls work.
You can use the parameter images_per_page in the shortcode to control that setting with the basic thumbnails.
TiKu, we may not support persisting the sort order of that page but bookmarking it in your browser would save you a step.
I’ve checked in a change that replaces our !is_admin() checks with a filter (‘ngg_load_frontend_logic’) with two parameters: enabled (set to default at priority -10 if !is_admin()) and our module ID (in case one may wish to only enable certain display types). It should be in our next release and I think it should solve this problem.
We used is_admin() as a kind of performance optimization so that we could avoid loading the gallery rendering logic in the /wp-admin/ area. It’s a decent request so I’ll be updating that check tomorrow to include a filter for users that want to enable (or disable?) loading our frontend logic.
The template would not be the appropriate place; because of the options for watermarking & reflections there is some logic in the singlepic controller that helps provide images at the right dimension. You could set those options in “Gallery Settings” however and it will apply to all shortcodes that don’t have their own width or height parameters set.
Shortcodes pull their default values from those set in the “Gallery Settings” page, all you need to do is set the template field there in the Basic Singlepic accordion.