Fix: NextGen Gallery 1.9 compatibility

This commit is contained in:
bastianonm 2013-10-20 13:42:35 +00:00
parent d2e558c079
commit 44e2616175
3 changed files with 25 additions and 19 deletions

View File

@ -5,7 +5,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Tags: maps, gpx, gps, graph, chart, google maps, track, garmin, image, nextgen-gallery, nextgen, exif, OpenStreetMap, OpenCycleMap, Hike&Bike, heart rate, heartrate, cadence
Requires at least: 2.0.0
Tested up to: 3.6.1
Stable tag: 1.2.0
Stable tag: 1.2.1
Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map.
@ -176,6 +176,8 @@ Yes!
1. Altitude & Speed & Hearth rate
== Changelog ==
= 1.2.1 =
* Fix: NextGen Gallery 1.9 compatibility
= 1.2.0 =
* NextGen Gallery 2 support
* NextGen Gallery Pro support

View File

@ -3,7 +3,7 @@
Plugin Name: WP-GPX-Maps
Plugin URI: http://www.devfarm.it/
Description: Draws a gpx track with altitude graph
Version: 1.2.0
Version: 1.2.1
Author: Bastianon Massimo
Author URI: http://www.pedemontanadelgrappa.it/
*/

View File

@ -71,29 +71,33 @@
/* START FIX NEXT GEN GALLERY 2.x */
$renderer = C_Component_Registry::get_instance()->get_utility('I_Displayed_Gallery_Renderer');
$params['gallery_ids'] = $ngGalleries;
$params['image_ids'] = $ngImages;
$params['display_type'] = NEXTGEN_GALLERY_BASIC_THUMBNAILS;
$params['images_per_page'] = 999;
// also add js references to get the gallery working
$dummy = $renderer->display_images($params, $inner_content);
/* START FIX NEXT GEN GALLERY PRO */
if (preg_match("/data-nplmodal-gallery-id=[\"'](.*?)[\"']/", $dummy, $m))
if ( class_exists("C_Component_Registry") )
{
$galid = $m[1];
if ($galid)
$renderer = C_Component_Registry::get_instance()->get_utility('I_Displayed_Gallery_Renderer');
$params['gallery_ids'] = $ngGalleries;
$params['image_ids'] = $ngImages;
$params['display_type'] = NEXTGEN_GALLERY_BASIC_THUMBNAILS;
$params['images_per_page'] = 999;
// also add js references to get the gallery working
$dummy = $renderer->display_images($params, $inner_content);
/* START FIX NEXT GEN GALLERY PRO */
if (preg_match("/data-nplmodal-gallery-id=[\"'](.*?)[\"']/", $dummy, $m))
{
for($i = 0; $i < count($result); ++$i)
$galid = $m[1];
if ($galid)
{
$result[$i]["data"] = str_replace("%PRO_LIGHTBOX_GALLERY_ID%", $galid, $result[$i]["data"]);
for($i = 0; $i < count($result); ++$i)
{
$result[$i]["data"] = str_replace("%PRO_LIGHTBOX_GALLERY_ID%", $galid, $result[$i]["data"]);
}
}
}
/* END FIX NEXT GEN GALLERY PRO */
}
/* END FIX NEXT GEN GALLERY PRO */
/* END FIX NEXT GEN GALLERY 2.x */