NextGEN Gallery – WordPress Gallery Plugin - Version 1.9.6

Version Description

  • 07.21.2012 =
  • Changed: Implemented workaround for bug found in WordPress SEO, resulting in no images being added to sitemap
  • Bugfix: Fixed an issue with users not being able to dismiss the "Photocrati Acquisition Notice"
  • Bugfix: Adjusted Javascript for activating social media pages to load on NextGEN Gallery pages only.
  • Bugfix: Fixed compatibility issue with Simple Facebook Connect
  • Bugfix: Using correct Facebook Page ID in Like button
Download this release

Release Info

Developer photocrati
Plugin Icon 128x128 NextGEN Gallery – WordPress Gallery Plugin
Version 1.9.6
Comparing to
See all releases

Code changes from version 1.9.5 to 1.9.6

admin/admin.php CHANGED
@@ -186,6 +186,22 @@ class nggAdminPanel{
186
  // no need to go on if it's not a plugin page
187
  if( !isset($_GET['page']) )
188
  return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
 
190
  wp_register_script('ngg-ajax', NGGALLERY_URLPATH . 'admin/js/ngg.ajax.js', array('jquery'), '1.4.1');
191
  wp_localize_script('ngg-ajax', 'nggAjaxSetup', array(
186
  // no need to go on if it's not a plugin page
187
  if( !isset($_GET['page']) )
188
  return;
189
+
190
+ // If we're on a NextGen Page
191
+ if (preg_match("/ngg|nextgen-gallery/", $_GET['page'])) {
192
+ wp_register_script('ngg_social_media', path_join(
193
+ NGGALLERY_URLPATH,
194
+ 'admin/js/ngg_social_media.js'
195
+ ), array('jquery'));
196
+
197
+ wp_register_style('ngg_social_media', path_join(
198
+ NGGALLERY_URLPATH,
199
+ 'admin/css/ngg_social_media.css'
200
+ ));
201
+
202
+ wp_enqueue_style('ngg_social_media');
203
+ wp_enqueue_script('ngg_social_media');
204
+ }
205
 
206
  wp_register_script('ngg-ajax', NGGALLERY_URLPATH . 'admin/js/ngg.ajax.js', array('jquery'), '1.4.1');
207
  wp_localize_script('ngg-ajax', 'nggAjaxSetup', array(
admin/css/ngg_social_media.css CHANGED
@@ -18,7 +18,9 @@
18
 
19
  #ngg_facebook_like {
20
  position: absolute;
21
- right: -368px;
 
 
22
  }
23
 
24
  #ngg_social_media .twitter-follow-button {
18
 
19
  #ngg_facebook_like {
20
  position: absolute;
21
+ right: 0px;
22
+ width: 81px;
23
+ overflow: hidden;
24
  }
25
 
26
  #ngg_social_media .twitter-follow-button {
admin/js/ngg_news_notice.js CHANGED
@@ -3,11 +3,7 @@ jQuery(function($){
3
  content: nggAdmin.content,
4
  pointerClass: 'pointer ngg_latest_news_notice',
5
  close: function(){
6
- var data = {
7
- action: 'hide_news_notice',
8
- nonce: nggAdmin.nonce
9
- }
10
- jQuery.post(ajaxurl, data);
11
  }
12
  }).pointer('open');
13
  });
3
  content: nggAdmin.content,
4
  pointerClass: 'pointer ngg_latest_news_notice',
5
  close: function(){
6
+ setUserSetting(nggAdmin.setting, 1);
 
 
 
 
7
  }
8
  }).pointer('open');
9
  });
admin/js/ngg_social_media.js CHANGED
@@ -3,6 +3,6 @@
3
  var js, fjs = d.getElementsByTagName(s)[0];
4
  if (d.getElementById(id)) return;
5
  js = d.createElement(s); js.id = id;
6
- js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=66864567775";
7
  fjs.parentNode.insertBefore(js, fjs);
8
  }(document, 'script', 'facebook-jssdk'));
3
  var js, fjs = d.getElementsByTagName(s)[0];
4
  if (d.getElementById(id)) return;
5
  js = d.createElement(s); js.id = id;
6
+ js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
7
  fjs.parentNode.insertBefore(js, fjs);
8
  }(document, 'script', 'facebook-jssdk'));
admin/templates/facebook_like_button.php CHANGED
@@ -1,2 +1,2 @@
1
  <div id="fb-root"></div>
2
- <div id="ngg_facebook_like" class="fb-like" data-href="https://www.facebook.com/NextGENGallery" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>
1
  <div id="fb-root"></div>
2
+ <div id="ngg_facebook_like" class="fb-like" data-href="http://www.facebook.com/nextgengallery" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>
changelog.txt CHANGED
@@ -1,6 +1,13 @@
1
  NextGEN Gallery
2
  by Photocrati Media
3
 
 
 
 
 
 
 
 
4
  = V1.9.5 - 07.18.2012 =
5
  * Changed: Branding changes following Photocrati acquisition (removed donation messages and updated links)
6
  * Secured: Use WordPress-bundled JavaScript libraries for swfobject and swfupload instead of bundling our own
1
  NextGEN Gallery
2
  by Photocrati Media
3
 
4
+ = V1.9.6 - 07.21.2012 =
5
+ * Changed: Implemented workaround for bug found in WordPress SEO, resulting in no images being added to sitemap
6
+ * Bugfix: Fixed an issue with users not being able to dismiss the "Photocrati Acquisition Notice"
7
+ * Bugfix: Adjusted Javascript for activating social media pages to load on NextGEN Gallery pages only.
8
+ * Bugfix: Fixed compatibility issue with Simple Facebook Connect
9
+ * Bugfix: Using correct Facebook Page ID in Like button
10
+
11
  = V1.9.5 - 07.18.2012 =
12
  * Changed: Branding changes following Photocrati acquisition (removed donation messages and updated links)
13
  * Secured: Use WordPress-bundled JavaScript libraries for swfobject and swfupload instead of bundling our own
lib/sitemap.php CHANGED
@@ -1,127 +1,127 @@
1
- <?php
2
- /**
3
- * Main PHP Class for XML Image Sitemaps
4
- *
5
- * @author Alex Rabe
6
- * @version 1.0
7
- *
8
- *
9
- */
10
- class nggSitemaps {
11
-
12
- var $images = false;
13
-
14
- /**
15
- * nggSitemaps::__construct()
16
- *
17
- * @return
18
- */
19
- function __construct() {
20
-
21
- add_filter('wpseo_sitemap_urlimages', array( &$this, 'add_wpseo_xml_sitemap_images'), 10, 2);
22
-
23
- }
24
-
25
- /**
26
- * Filter support for WordPress SEO by Yoast 0.4.0 or higher ( http://wordpress.org/extend/plugins/wordpress-seo/ )
27
- *
28
- * @since Version 1.8.0
29
- * @param array $images
30
- * @param int $post ID
31
- * @return array $image list of all founded images
32
- */
33
- function add_wpseo_xml_sitemap_images( $images, $post_id ) {
34
-
35
- $this->images = $images;
36
-
37
- // first get the content of the post/page
38
- $p = get_post($post_id);
39
-
40
- // Backward check for older images
41
- $p->post_content = NextGEN_Shortcodes::convert_shortcode($p->post_content);
42
-
43
- // Don't process the images in the normal way
44
- remove_all_shortcodes();
45
-
46
- // We cannot parse at this point a album, just galleries & single images
47
- add_shortcode( 'singlepic', array(&$this, 'add_images' ) );
48
- add_shortcode( 'thumb', array(&$this, 'add_images' ) );
49
- add_shortcode( 'nggallery', array(&$this, 'add_gallery') );
50
- add_shortcode( 'imagebrowser', array(&$this, 'add_gallery' ) );
51
- add_shortcode( 'slideshow', array(&$this, 'add_gallery' ) );
52
-
53
- // Search now for shortcodes
54
- do_shortcode( $p->post_content );
55
-
56
- return $this->images;
57
- }
58
-
59
- /**
60
- * Parse the gallery/imagebrowser/slideshow shortcode and return all images into an array
61
- *
62
- * @param string $atts
63
- * @return
64
- */
65
- function add_gallery( $atts ) {
66
-
67
- global $wpdb;
68
-
69
- extract(shortcode_atts(array(
70
- 'id' => 0
71
- ), $atts ));
72
-
73
- // backward compat for user which uses the name instead, still deprecated
74
- if( !is_numeric($id) )
75
- $id = $wpdb->get_var( $wpdb->prepare ("SELECT gid FROM $wpdb->nggallery WHERE name = '%s' ", $id) );
76
-
77
- $images = nggdb::get_gallery($id, 'pid', 'ASC', true, 1000);
78
-
79
- foreach ($images as $image) {
80
- $src = $image->imageURL;
81
- $newimage = array();
82
- if ( !empty($image->title) )
83
- $newimage['title'] = $image->title;
84
- if ( !empty($image->alttext) )
85
- $newimage['alt'] = $image->alttext;
86
- $this->images[$src] = $newimage;
87
- }
88
-
89
- return;
90
- }
91
-
92
- /**
93
- * Parse the single image shortcode and return all images into an array
94
- *
95
- * @param array $atts
96
- * @return
97
- */
98
- function add_images( $atts ) {
99
-
100
- extract(shortcode_atts(array(
101
- 'id' => 0
102
- ), $atts ));
103
-
104
- // make an array out of the ids (for thumbs shortcode))
105
- $pids = explode( ',', $id );
106
-
107
- // Some error checks
108
- if ( count($pids) == 0 )
109
- return;
110
-
111
- $images = nggdb::find_images_in_list( $pids );
112
-
113
- foreach ($images as $image) {
114
- $src = $image->imageURL;
115
- $newimage = array();
116
- if ( !empty($image->title) )
117
- $newimage['title'] = $image->title;
118
- if ( !empty($image->alttext) )
119
- $newimage['alt'] = $image->alttext;
120
- $this->images[$src] = $newimage;
121
- }
122
-
123
- return;
124
- }
125
-
126
- }
127
- $nggSitemaps = new nggSitemaps();
1
+ <?php
2
+ /**
3
+ * Main PHP Class for XML Image Sitemaps
4
+ *
5
+ * @author Alex Rabe
6
+ * @version 1.0
7
+ * @copyright Copyright 2011
8
+ *
9
+ */
10
+ class nggSitemaps {
11
+
12
+ var $images = false;
13
+
14
+ /**
15
+ * nggSitemaps::__construct()
16
+ *
17
+ * @return
18
+ */
19
+ function __construct() {
20
+
21
+ add_filter('wpseo_sitemap_urlimages', array( &$this, 'add_wpseo_xml_sitemap_images'), 10, 2);
22
+
23
+ }
24
+
25
+ /**
26
+ * Filter support for WordPress SEO by Yoast 0.4.0 or higher ( http://wordpress.org/extend/plugins/wordpress-seo/ )
27
+ *
28
+ * @since Version 1.8.0
29
+ * @param array $images
30
+ * @param int $post ID
31
+ * @return array $image list of all founded images
32
+ */
33
+ function add_wpseo_xml_sitemap_images( $images, $post_id ) {
34
+
35
+ $this->images = $images;
36
+
37
+ // first get the content of the post/page
38
+ $p = get_post($post_id);
39
+
40
+ // Backward check for older images
41
+ $p->post_content = NextGEN_Shortcodes::convert_shortcode($p->post_content);
42
+
43
+ // Don't process the images in the normal way
44
+ remove_all_shortcodes();
45
+
46
+ // We cannot parse at this point a album, just galleries & single images
47
+ add_shortcode( 'singlepic', array(&$this, 'add_images' ) );
48
+ add_shortcode( 'thumb', array(&$this, 'add_images' ) );
49
+ add_shortcode( 'nggallery', array(&$this, 'add_gallery') );
50
+ add_shortcode( 'imagebrowser', array(&$this, 'add_gallery' ) );
51
+ add_shortcode( 'slideshow', array(&$this, 'add_gallery' ) );
52
+
53
+ // Search now for shortcodes
54
+ do_shortcode( $p->post_content );
55
+
56
+ return $this->images;
57
+ }
58
+
59
+ /**
60
+ * Parse the gallery/imagebrowser/slideshow shortcode and return all images into an array
61
+ *
62
+ * @param string $atts
63
+ * @return
64
+ */
65
+ function add_gallery( $atts ) {
66
+
67
+ global $wpdb;
68
+
69
+ extract(shortcode_atts(array(
70
+ 'id' => 0
71
+ ), $atts ));
72
+
73
+ // backward compat for user which uses the name instead, still deprecated
74
+ if( !is_numeric($id) )
75
+ $id = $wpdb->get_var( $wpdb->prepare ("SELECT gid FROM $wpdb->nggallery WHERE name = '%s' ", $id) );
76
+
77
+ $images = nggdb::get_gallery($id, 'pid', 'ASC', true, 1000);
78
+
79
+ foreach ($images as $image) {
80
+ $newimage = array();
81
+ $newimage['src'] = $newimage['sc'] = $image->imageURL;
82
+ if ( !empty($image->title) )
83
+ $newimage['title'] = $image->title;
84
+ if ( !empty($image->alttext) )
85
+ $newimage['alt'] = $image->alttext;
86
+ $this->images[] = $newimage;
87
+ }
88
+
89
+ return;
90
+ }
91
+
92
+ /**
93
+ * Parse the single image shortcode and return all images into an array
94
+ *
95
+ * @param array $atts
96
+ * @return
97
+ */
98
+ function add_images( $atts ) {
99
+
100
+ extract(shortcode_atts(array(
101
+ 'id' => 0
102
+ ), $atts ));
103
+
104
+ // make an array out of the ids (for thumbs shortcode))
105
+ $pids = explode( ',', $id );
106
+
107
+ // Some error checks
108
+ if ( count($pids) == 0 )
109
+ return;
110
+
111
+ $images = nggdb::find_images_in_list( $pids );
112
+
113
+ foreach ($images as $image) {
114
+ $newimage = array();
115
+ $newimage['src'] = $newimage['sc'] = $image->imageURL;
116
+ if ( !empty($image->title) )
117
+ $newimage['title'] = $image->title;
118
+ if ( !empty($image->alttext) )
119
+ $newimage['alt'] = $image->alttext;
120
+ $this->images[] = $newimage;
121
+ }
122
+
123
+ return;
124
+ }
125
+
126
+ }
127
+ $nggSitemaps = new nggSitemaps();
nggallery.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.nextgen-gallery.com/
5
  Description: A NextGENeration Photo Gallery for WordPress
6
  Author: Photocrati
7
  Author URI: http://www.photocrati.com/
8
- Version: 1.9.5
9
 
10
  Copyright (c) 2007-2011 by Alex Rabe & NextGEN DEV-Team
11
  Copyright (c) 2012 Photocrati Media
@@ -45,7 +45,7 @@ if (!class_exists('E_Clean_Exit')) {
45
  if (!class_exists('nggLoader')) {
46
  class nggLoader {
47
 
48
- var $version = '1.9.5';
49
  var $dbversion = '1.8.0';
50
  var $minimum_WP = '3.2';
51
  var $donators = 'http://www.nextgen-gallery.com/donators.php';
@@ -105,9 +105,6 @@ if (!class_exists('nggLoader')) {
105
  // Handle upload requests
106
  add_action('init', array(&$this, 'handle_upload_request'));
107
 
108
- // Adds scripts used for social media buttons
109
- add_action('admin_init', array(&$this, 'enqueue_social_media_resources'));
110
-
111
  // Display "Photocrati Acquisition Announcement"
112
  add_action('admin_init', array(&$this, 'display_update_notice'));
113
 
@@ -575,41 +572,7 @@ if (!class_exists('nggLoader')) {
575
  */
576
  function get_notice_flag()
577
  {
578
- return $this->update_notice_setting.$this->version;
579
- }
580
-
581
-
582
- /**
583
- * Hides the update notice
584
- */
585
- function hide_news_notice()
586
- {
587
- if (wp_verify_nonce($_POST['nonce'])) {
588
- update_user_meta(get_current_user_id(), $this->get_notice_flag(), -1);
589
- echo "-1\n";
590
- }
591
- else
592
- echo "1\n";
593
- }
594
-
595
-
596
- /**
597
- * Enqueues JS required for Social Media Buttons
598
- */
599
- function enqueue_social_media_resources()
600
- {
601
- wp_register_script('ngg_social_media', path_join(
602
- NGGALLERY_URLPATH,
603
- 'admin/js/ngg_social_media.js'
604
- ), array('jquery'));
605
-
606
- wp_register_style('ngg_social_media', path_join(
607
- NGGALLERY_URLPATH,
608
- 'admin/css/ngg_social_media.css'
609
- ));
610
-
611
- wp_enqueue_style('ngg_social_media');
612
- wp_enqueue_script('ngg_social_media');
613
  }
614
 
615
 
@@ -620,13 +583,21 @@ if (!class_exists('nggLoader')) {
620
  {
621
  if (is_admin() &&
622
  current_user_can('administrator') &&
623
- get_user_meta(get_current_user_id(), $this->get_notice_flag(), TRUE) != -1) {
624
 
625
  // Register a new script
 
 
 
 
 
 
 
 
626
  wp_register_script('ngg_news_notice', path_join(
627
  NGGALLERY_URLPATH,
628
  'admin/js/ngg_news_notice.js'
629
- ), array('wp-pointer'));
630
 
631
  // Get the announcement notice content
632
  ob_start();
@@ -640,6 +611,7 @@ if (!class_exists('nggLoader')) {
640
  // Display the pointer
641
  wp_enqueue_style( 'wp-pointer' );
642
  wp_enqueue_script( 'utils' ); // for user settings
 
643
  wp_enqueue_script('ngg_news_notice');
644
  wp_localize_script('ngg_news_notice', 'nggAdmin', array(
645
  'content' => $content,
5
  Description: A NextGENeration Photo Gallery for WordPress
6
  Author: Photocrati
7
  Author URI: http://www.photocrati.com/
8
+ Version: 1.9.6
9
 
10
  Copyright (c) 2007-2011 by Alex Rabe & NextGEN DEV-Team
11
  Copyright (c) 2012 Photocrati Media
45
  if (!class_exists('nggLoader')) {
46
  class nggLoader {
47
 
48
+ var $version = '1.9.6';
49
  var $dbversion = '1.8.0';
50
  var $minimum_WP = '3.2';
51
  var $donators = 'http://www.nextgen-gallery.com/donators.php';
105
  // Handle upload requests
106
  add_action('init', array(&$this, 'handle_upload_request'));
107
 
 
 
 
108
  // Display "Photocrati Acquisition Announcement"
109
  add_action('admin_init', array(&$this, 'display_update_notice'));
110
 
572
  */
573
  function get_notice_flag()
574
  {
575
+ return str_replace('.', '', $this->update_notice_setting.$this->version);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
576
  }
577
 
578
 
583
  {
584
  if (is_admin() &&
585
  current_user_can('administrator') &&
586
+ !(get_user_setting($this->get_notice_flag(), FALSE))) {
587
 
588
  // Register a new script
589
+ wp_register_style('ngg_social_media', path_join(
590
+ NGGALLERY_URLPATH,
591
+ 'admin/css/ngg_social_media.css'
592
+ ));
593
+ wp_register_script('ngg_social_media', path_join(
594
+ NGGALLERY_URLPATH,
595
+ 'admin/js/ngg_social_media.js'
596
+ ), array('jquery'));
597
  wp_register_script('ngg_news_notice', path_join(
598
  NGGALLERY_URLPATH,
599
  'admin/js/ngg_news_notice.js'
600
+ ), array('wp-pointer', 'ngg_social_media'));
601
 
602
  // Get the announcement notice content
603
  ob_start();
611
  // Display the pointer
612
  wp_enqueue_style( 'wp-pointer' );
613
  wp_enqueue_script( 'utils' ); // for user settings
614
+ wp_enqueue_style('ngg_social_media');
615
  wp_enqueue_script('ngg_news_notice');
616
  wp_localize_script('ngg_news_notice', 'nggAdmin', array(
617
  'content' => $content,
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === NextGEN Gallery ===
2
  Contributors: photocrati
3
  Tags: photos,flash,slideshow,images,gallery,media,admin,post,photo-albums,pictures,widgets,photo,picture,image,nextgen-gallery,nextgen gallery
4
- Requires at least: 3.3
5
- Tested up to: 3.4
6
  Stable tag: trunk
7
  License: GPLv2
8
 
@@ -192,6 +192,13 @@ Yes, NextGEN Gallery has been translated into dozens of languages - <a href="htt
192
 
193
  == Changelog ==
194
 
 
 
 
 
 
 
 
195
  = V1.9.5 - 18.07.2012 =
196
  * Changed: Branding changes following Photocrati acquisition (removed donation messages and updated links)
197
  * Secured: Use WordPress-bundled JavaScript libraries for swfobject and swfupload instead of bundling our own
1
  === NextGEN Gallery ===
2
  Contributors: photocrati
3
  Tags: photos,flash,slideshow,images,gallery,media,admin,post,photo-albums,pictures,widgets,photo,picture,image,nextgen-gallery,nextgen gallery
4
+ Requires at least: 3.4
5
+ Tested up to: 3.4.1
6
  Stable tag: trunk
7
  License: GPLv2
8
 
192
 
193
  == Changelog ==
194
 
195
+ = V1.9.6 - 07.21.2012 =
196
+ * Changed: Implemented workaround for bug found in WordPress SEO, resulting in no images being added to sitemap
197
+ * Bugfix: Fixed an issue with users not being able to dismiss the "Photocrati Acquisition Notice"
198
+ * Bugfix: Adjusted Javascript for activating social media pages to load on NextGEN Gallery pages only.
199
+ * Bugfix: Fixed compatibility issue with Simple Facebook Connect
200
+ * Bugfix: Using correct Facebook Page ID in Like button
201
+
202
  = V1.9.5 - 18.07.2012 =
203
  * Changed: Branding changes following Photocrati acquisition (removed donation messages and updated links)
204
  * Secured: Use WordPress-bundled JavaScript libraries for swfobject and swfupload instead of bundling our own