NextGEN Gallery – WordPress Gallery Plugin - Version 1.7.1

Version Description

  • 13.12.2010 =
  • Changed : Disable upgrade for PHP4 user
  • Changed : Disable colorpicker for option page
  • Bugfix : Compat fix for upgrade
Download this release

Release Info

Developer alexrabe
Plugin Icon 128x128 NextGEN Gallery – WordPress Gallery Plugin
Version 1.7.1
Comparing to
See all releases

Code changes from version 1.7.0 to 1.7.1

admin/admin.php CHANGED
@@ -215,7 +215,7 @@ class nggAdminPanel{
215
  break;
216
  case "nggallery-options" :
217
  wp_enqueue_script( 'jquery-ui-tabs' );
218
- wp_enqueue_script( 'ngg-colorpicker', NGGALLERY_URLPATH .'admin/js/colorpicker/js/colorpicker.js', array('jquery'), '1.0');
219
  break;
220
  case "nggallery-add-gallery" :
221
  wp_enqueue_script( 'jquery-ui-tabs' );
215
  break;
216
  case "nggallery-options" :
217
  wp_enqueue_script( 'jquery-ui-tabs' );
218
+ //wp_enqueue_script( 'ngg-colorpicker', NGGALLERY_URLPATH .'admin/js/colorpicker/js/colorpicker.js', array('jquery'), '1.0');
219
  break;
220
  case "nggallery-add-gallery" :
221
  wp_enqueue_script( 'jquery-ui-tabs' );
admin/album.php CHANGED
@@ -266,7 +266,7 @@ function showDialog() {
266
  width: 640,
267
  resizable : false,
268
  modal: true,
269
- title: '<?php _e('Edit Album', 'nggallery'); ?>'
270
  });
271
  jQuery('#editalbum .dialog-cancel').click(function() { jQuery( "#editalbum" ).dialog("close"); });
272
  }
@@ -275,15 +275,15 @@ function showDialog() {
275
 
276
  <div class="wrap album" id="wrap" >
277
  <?php screen_icon( 'nextgen-gallery' ); ?>
278
- <h2><?php _e('Manage Albums', 'nggallery') ?></h2>
279
  <form id="selectalbum" method="POST" onsubmit="ngg_serialize()" accept-charset="utf-8">
280
  <?php wp_nonce_field('ngg_album') ?>
281
  <input name="sortorder" type="hidden" />
282
  <div class="albumnav tablenav">
283
  <div class="alignleft actions">
284
- <?php _e('Select album', 'nggallery') ?>
285
  <select id="act_album" name="act_album" onchange="this.form.submit();">
286
- <option value="0" ><?php _e('No album selected', 'nggallery') ?></option>
287
  <?php
288
  if( is_array($this->albums) ) {
289
  foreach($this->albums as $album) {
@@ -294,18 +294,18 @@ function showDialog() {
294
  ?>
295
  </select>
296
  <?php if ($this->currentID > 0){ ?>
297
- <input class="button-primary" type="submit" name="update" value="<?php _e('Update', 'nggallery'); ?>"/>
298
  <?php if(nggGallery::current_user_can( 'NextGEN Edit album settings' )) { ?>
299
- <input class="button-secondary" type="submit" name="showThickbox" value="<?php _e( 'Edit album', 'nggallery'); ?>" onclick="showDialog(); return false;" />
300
  <?php } ?>
301
  <?php if(nggGallery::current_user_can( 'NextGEN Add/Delete album' )) { ?>
302
- <input class="button-secondary action "type="submit" name="delete" value="<?php _e('Delete', 'nggallery'); ?>" onclick="javascript:check=confirm('<?php _e('Delete album ?','nggallery'); ?>');if(check==false) return false;"/>
303
  <?php } ?>
304
  <?php } else { ?>
305
  <?php if(nggGallery::current_user_can( 'NextGEN Add/Delete album' )) { ?>
306
- <span><?php _e('Add new album', 'nggallery'); ?>&nbsp;</span>
307
  <input class="search-input" id="newalbum" name="newalbum" type="text" value="" />
308
- <input class="button-secondary action" type="submit" name="add" value="<?php _e('Add', 'nggallery'); ?>"/>
309
  <?php } ?>
310
  <?php } ?>
311
  </div>
@@ -316,11 +316,11 @@ function showDialog() {
316
 
317
  <div>
318
  <div style="float:right;">
319
- <a href="#" title="<?php _e('Show / hide used galleries','nggallery'); ?>" id="toggle_used"><?php _e('[Show all]', 'nggallery'); ?></a>
320
- | <a href="#" title="<?php _e('Maximize the widget content','nggallery'); ?>" id="all_max"><?php _e('[Maximize]', 'nggallery'); ?></a>
321
- | <a href="#" title="<?php _e('Minimize the widget content','nggallery'); ?>" id="all_min"><?php _e('[Minimize]', 'nggallery'); ?></a>
322
  </div>
323
- <?php _e('After you create and select a album, you can drag and drop a gallery or another album into your new album below','nggallery'); ?>
324
  </div>
325
 
326
  <br class="clear" />
@@ -330,7 +330,7 @@ function showDialog() {
330
  <!-- /#album container -->
331
  <div class="widget widget-right">
332
  <div class="widget-top">
333
- <h3><?php _e('Select album', 'nggallery'); ?></h3>
334
  </div>
335
  <div id="albumContainer" class="widget-holder">
336
  <?php
@@ -346,7 +346,7 @@ function showDialog() {
346
  <!-- /#select container -->
347
  <div class="widget widget-right">
348
  <div class="widget-top">
349
- <h3><?php _e('Select gallery', 'nggallery'); ?></h3>
350
  </div>
351
  <div id="selectContainer" class="widget-holder">
352
  <?php
@@ -375,7 +375,7 @@ function showDialog() {
375
  $album = $this->albums[$this->currentID];
376
  ?>
377
  <div class="widget-top">
378
- <h3><?php _e('Album ID', 'nggallery'); ?> <?php echo $album->id . ' : ' . $album->name; ?> </h3>
379
  </div>
380
  <div id="galleryContainer" class="widget-holder target">
381
  <?php
@@ -388,7 +388,7 @@ function showDialog() {
388
  {
389
  ?>
390
  <div class="widget-top">
391
- <h3><?php _e('No album selected!', 'nggallery'); ?></h3>
392
  </div>
393
  <div class="widget-holder target">
394
  <?php
@@ -408,22 +408,22 @@ function showDialog() {
408
  <table width="100%" border="0" cellspacing="3" cellpadding="3" >
409
  <tr>
410
  <th>
411
- <?php _e('Album name:', 'nggallery'); ?><br />
412
  <input class="search-input" id="album_name" name="album_name" type="text" value="<?php echo esc_attr( $album->name ); ?>" style="width:95%" />
413
  </th>
414
  </tr>
415
  <tr>
416
  <th>
417
- <?php _e('Album description:', 'nggallery'); ?><br />
418
  <textarea class="search-input" id="album_desc" name="album_desc" cols="50" rows="2" style="width:95%" ><?php echo esc_attr( $album->albumdesc ); ?></textarea>
419
  </th>
420
  </tr>
421
  <tr>
422
  <th>
423
- <?php _e('Select a preview image:', 'nggallery'); ?><br />
424
  <select id="previewpic" name="previewpic" style="width:95%" >
425
  <?php if ($album->previewpic == 0) ?>
426
- <option value="0"><?php _e('No picture', 'nggallery'); ?></option>
427
  <?php
428
  if ($album->previewpic == 0)
429
  echo '<option value="0" selected="selected">' . __('No picture', 'nggallery') . '</option>';
@@ -437,9 +437,9 @@ function showDialog() {
437
  </tr>
438
  <tr>
439
  <th>
440
- <?php _e('Page Link to', 'nggallery')?><br />
441
  <select name="pageid" style="width:95%">
442
- <option value="0" ><?php _e('Not linked', 'nggallery') ?></option>
443
  <?php
444
  if (!isset($album->pageid))
445
  $album->pageid = 0;
@@ -452,9 +452,9 @@ function showDialog() {
452
 
453
  <tr align="right">
454
  <td class="submit">
455
- <input type="submit" class="button-primary" name="update_album" value="<?php _e('OK', 'nggallery'); ?>" />
456
  &nbsp;
457
- <input class="button-secondary dialog-cancel" type="reset" value="<?php _e('Cancel', 'nggallery'); ?>"/>
458
  </td>
459
  </tr>
460
  </table>
266
  width: 640,
267
  resizable : false,
268
  modal: true,
269
+ title: '<?php echo esc_js( __('Edit Album', 'nggallery') ); ?>'
270
  });
271
  jQuery('#editalbum .dialog-cancel').click(function() { jQuery( "#editalbum" ).dialog("close"); });
272
  }
275
 
276
  <div class="wrap album" id="wrap" >
277
  <?php screen_icon( 'nextgen-gallery' ); ?>
278
+ <h2><?php esc_html_e('Manage Albums', 'nggallery') ?></h2>
279
  <form id="selectalbum" method="POST" onsubmit="ngg_serialize()" accept-charset="utf-8">
280
  <?php wp_nonce_field('ngg_album') ?>
281
  <input name="sortorder" type="hidden" />
282
  <div class="albumnav tablenav">
283
  <div class="alignleft actions">
284
+ <?php esc_html_e('Select album', 'nggallery') ?>
285
  <select id="act_album" name="act_album" onchange="this.form.submit();">
286
+ <option value="0" ><?php esc_html_e('No album selected', 'nggallery') ?></option>
287
  <?php
288
  if( is_array($this->albums) ) {
289
  foreach($this->albums as $album) {
294
  ?>
295
  </select>
296
  <?php if ($this->currentID > 0){ ?>
297
+ <input class="button-primary" type="submit" name="update" value="<?php esc_attr_e('Update', 'nggallery'); ?>"/>
298
  <?php if(nggGallery::current_user_can( 'NextGEN Edit album settings' )) { ?>
299
+ <input class="button-secondary" type="submit" name="showThickbox" value="<?php esc_attr_e( 'Edit album', 'nggallery'); ?>" onclick="showDialog(); return false;" />
300
  <?php } ?>
301
  <?php if(nggGallery::current_user_can( 'NextGEN Add/Delete album' )) { ?>
302
+ <input class="button-secondary action "type="submit" name="delete" value="<?php esc_attr_e('Delete', 'nggallery'); ?>" onclick="javascript:check=confirm('<?php esc_js('Delete album ?','nggallery'); ?>');if(check==false) return false;"/>
303
  <?php } ?>
304
  <?php } else { ?>
305
  <?php if(nggGallery::current_user_can( 'NextGEN Add/Delete album' )) { ?>
306
+ <span><?php esc_html_e('Add new album', 'nggallery'); ?>&nbsp;</span>
307
  <input class="search-input" id="newalbum" name="newalbum" type="text" value="" />
308
+ <input class="button-secondary action" type="submit" name="add" value="<?php esc_attr_e('Add', 'nggallery'); ?>"/>
309
  <?php } ?>
310
  <?php } ?>
311
  </div>
316
 
317
  <div>
318
  <div style="float:right;">
319
+ <a href="#" title="<?php esc_attr_e('Show / hide used galleries','nggallery'); ?>" id="toggle_used"><?php esc_html_e('[Show all]', 'nggallery'); ?></a>
320
+ | <a href="#" title="<?php esc_attr_e('Maximize the widget content','nggallery'); ?>" id="all_max"><?php esc_html_e('[Maximize]', 'nggallery'); ?></a>
321
+ | <a href="#" title="<?php esc_attr_e('Minimize the widget content','nggallery'); ?>" id="all_min"><?php esc_html_e('[Minimize]', 'nggallery'); ?></a>
322
  </div>
323
+ <?php esc_html_e('After you create and select a album, you can drag and drop a gallery or another album into your new album below','nggallery'); ?>
324
  </div>
325
 
326
  <br class="clear" />
330
  <!-- /#album container -->
331
  <div class="widget widget-right">
332
  <div class="widget-top">
333
+ <h3><?php esc_html_e('Select album', 'nggallery'); ?></h3>
334
  </div>
335
  <div id="albumContainer" class="widget-holder">
336
  <?php
346
  <!-- /#select container -->
347
  <div class="widget widget-right">
348
  <div class="widget-top">
349
+ <h3><?php esc_html_e('Select gallery', 'nggallery'); ?></h3>
350
  </div>
351
  <div id="selectContainer" class="widget-holder">
352
  <?php
375
  $album = $this->albums[$this->currentID];
376
  ?>
377
  <div class="widget-top">
378
+ <h3><?php esc_html_e('Album ID', 'nggallery'); ?> <?php echo $album->id . ' : ' . $album->name; ?> </h3>
379
  </div>
380
  <div id="galleryContainer" class="widget-holder target">
381
  <?php
388
  {
389
  ?>
390
  <div class="widget-top">
391
+ <h3><?php esc_html_e('No album selected!', 'nggallery'); ?></h3>
392
  </div>
393
  <div class="widget-holder target">
394
  <?php
408
  <table width="100%" border="0" cellspacing="3" cellpadding="3" >
409
  <tr>
410
  <th>
411
+ <?php esc_html_e('Album name:', 'nggallery'); ?><br />
412
  <input class="search-input" id="album_name" name="album_name" type="text" value="<?php echo esc_attr( $album->name ); ?>" style="width:95%" />
413
  </th>
414
  </tr>
415
  <tr>
416
  <th>
417
+ <?php esc_html_e('Album description:', 'nggallery'); ?><br />
418
  <textarea class="search-input" id="album_desc" name="album_desc" cols="50" rows="2" style="width:95%" ><?php echo esc_attr( $album->albumdesc ); ?></textarea>
419
  </th>
420
  </tr>
421
  <tr>
422
  <th>
423
+ <?php esc_html_e('Select a preview image:', 'nggallery'); ?><br />
424
  <select id="previewpic" name="previewpic" style="width:95%" >
425
  <?php if ($album->previewpic == 0) ?>
426
+ <option value="0"><?php esc_html_e('No picture', 'nggallery'); ?></option>
427
  <?php
428
  if ($album->previewpic == 0)
429
  echo '<option value="0" selected="selected">' . __('No picture', 'nggallery') . '</option>';
437
  </tr>
438
  <tr>
439
  <th>
440
+ <?php esc_html_e('Page Link to', 'nggallery')?><br />
441
  <select name="pageid" style="width:95%">
442
+ <option value="0" ><?php esc_html_e('Not linked', 'nggallery') ?></option>
443
  <?php
444
  if (!isset($album->pageid))
445
  $album->pageid = 0;
452
 
453
  <tr align="right">
454
  <td class="submit">
455
+ <input type="submit" class="button-primary" name="update_album" value="<?php esc_attr_e('OK', 'nggallery'); ?>" />
456
  &nbsp;
457
+ <input class="button-secondary dialog-cancel" type="reset" value="<?php esc_attr_e('Cancel', 'nggallery'); ?>"/>
458
  </td>
459
  </tr>
460
  </table>
admin/settings.php CHANGED
@@ -95,7 +95,7 @@ class nggOptions {
95
  if ( isset($_POST['createslugs']) ) {
96
  check_admin_referer('ngg_settings');
97
  include_once (dirname (__FILE__) . '/upgrade.php');
98
- ngg_rebuild_unique_slugs::init();
99
  }
100
 
101
  do_action( 'ngg_update_options_page' );
@@ -125,6 +125,7 @@ class nggOptions {
125
  });
126
  */
127
  jQuery('#slider').tabs({ fxFade: true, fxSpeed: 'fast' });
 
128
  jQuery('.picker').ColorPicker({
129
  onSubmit: function(hsb, hex, rgb, el) {
130
  jQuery(el).val(hex);
@@ -137,6 +138,7 @@ class nggOptions {
137
  .bind('keyup', function(){
138
  jQuery(this).ColorPickerSetColor(this.value);
139
  });
 
140
  });
141
 
142
  function insertcode(value) {
95
  if ( isset($_POST['createslugs']) ) {
96
  check_admin_referer('ngg_settings');
97
  include_once (dirname (__FILE__) . '/upgrade.php');
98
+ ngg_rebuild_unique_slugs::start_rebuild();
99
  }
100
 
101
  do_action( 'ngg_update_options_page' );
125
  });
126
  */
127
  jQuery('#slider').tabs({ fxFade: true, fxSpeed: 'fast' });
128
+ /*
129
  jQuery('.picker').ColorPicker({
130
  onSubmit: function(hsb, hex, rgb, el) {
131
  jQuery(el).val(hex);
138
  .bind('keyup', function(){
139
  jQuery(this).ColorPickerSetColor(this.value);
140
  });
141
+ */
142
  });
143
 
144
  function insertcode(value) {
admin/upgrade.php CHANGED
@@ -177,7 +177,7 @@ function ngg_upgrade() {
177
  <?php _e('Therefore it\'s needed to have a unique identifier for each image, gallery and album.', 'nggallery'); ?><br />
178
  <?php _e('Depend on the amount of database entries this will take a while, don\'t reload this page.', 'nggallery') ;?></p>
179
  <?php
180
- ngg_rebuild_unique_slugs::init();
181
  }
182
 
183
  }
@@ -380,11 +380,7 @@ function nggallery_start_upgrade($filepath) {
380
  */
381
  class ngg_rebuild_unique_slugs {
382
 
383
- static function init() {
384
- self::start_rebuild();
385
- }
386
-
387
- static function start_rebuild() {
388
  global $wpdb;
389
 
390
  $total = array();
177
  <?php _e('Therefore it\'s needed to have a unique identifier for each image, gallery and album.', 'nggallery'); ?><br />
178
  <?php _e('Depend on the amount of database entries this will take a while, don\'t reload this page.', 'nggallery') ;?></p>
179
  <?php
180
+ ngg_rebuild_unique_slugs::start_rebuild();
181
  }
182
 
183
  }
380
  */
381
  class ngg_rebuild_unique_slugs {
382
 
383
+ function start_rebuild() {
 
 
 
 
384
  global $wpdb;
385
 
386
  $total = array();
changelog.txt CHANGED
@@ -6,6 +6,11 @@ by Alex Rabe & NextGEN DEV Team
6
  * TODO : Facebook connector
7
  * TODO : Switch to Plupload (http://www.plupload.com/)
8
 
 
 
 
 
 
9
  = V1.7.0 - 11.12.2010 =
10
  * NEW : Publish a new post direct from the gallery admin page
11
  * NEW : Added filter hook 'ngg_get_image_metadata' to add more exif/iptc information
@@ -17,8 +22,8 @@ by Alex Rabe & NextGEN DEV Team
17
  * Bugfix : Better support for SSL blogs
18
  * Bugfix : Install/Upgrade failed when table prefix contain captial letters
19
  * Bugfix : Fix validation issues in Media-RSS
20
- * Bugifx : Empty tags in XMP Meta causes PHP error
21
- * Bugifx : Rework load mechanism for slideshow
22
  * Bugfix : Copy meta data when image is copied
23
  * Bugfix : Icon Support for Ozh' Admin Drop Down Menu
24
  * Bugfix : Use correct sort order in slideshow
6
  * TODO : Facebook connector
7
  * TODO : Switch to Plupload (http://www.plupload.com/)
8
 
9
+ = V1.7.1 - 13.12.2010 =
10
+ * Changed : Disable upgrade for PHP4 user
11
+ * Changed : Disable colorpicker for option page
12
+ * Bugfix : Compat fix for upgrade
13
+
14
  = V1.7.0 - 11.12.2010 =
15
  * NEW : Publish a new post direct from the gallery admin page
16
  * NEW : Added filter hook 'ngg_get_image_metadata' to add more exif/iptc information
22
  * Bugfix : Better support for SSL blogs
23
  * Bugfix : Install/Upgrade failed when table prefix contain captial letters
24
  * Bugfix : Fix validation issues in Media-RSS
25
+ * Bugfix : Empty tags in XMP Meta causes PHP error
26
+ * Bugfix : Rework load mechanism for slideshow
27
  * Bugfix : Copy meta data when image is copied
28
  * Bugfix : Icon Support for Ozh' Admin Drop Down Menu
29
  * Bugfix : Use correct sort order in slideshow
nggallery.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: NextGEN Gallery
4
  Plugin URI: http://alexrabe.de/?page_id=80
5
  Description: A NextGENeration Photo gallery for the Web 2.0.
6
  Author: Alex Rabe
7
- Version: 1.7.0
8
 
9
  Author URI: http://alexrabe.de/
10
 
@@ -34,7 +34,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
34
  if (!class_exists('nggLoader')) {
35
  class nggLoader {
36
 
37
- var $version = '1.7.0';
38
  var $dbversion = '1.7.0';
39
  var $minium_WP = '3.0';
40
  var $donators = 'http://nextgen.boelinger.com/donators.php';
@@ -415,7 +415,7 @@ class nggLoader {
415
 
416
  function activate() {
417
  global $wpdb;
418
- //Since version 1.4.0 it's tested only with PHP5.2, currently we keep PHP4 support a while
419
  //if (version_compare(PHP_VERSION, '5.2.0', '<')) {
420
  // deactivate_plugins(plugin_basename(__FILE__)); // Deactivate ourself
421
  // wp_die("Sorry, but you can't run this plugin, it requires PHP 5.2 or higher.");
@@ -479,8 +479,8 @@ class nggLoader {
479
  return $option;
480
 
481
  if( isset($option->response[ $this_plugin ]) ){
482
- //TODO:Clear its download link, not now but maybe later
483
- //$option->response[ $this_plugin ]->package = '';
484
 
485
  //Add a notice message
486
  if ($this->add_PHP5_notice == false){
4
  Plugin URI: http://alexrabe.de/?page_id=80
5
  Description: A NextGENeration Photo gallery for the Web 2.0.
6
  Author: Alex Rabe
7
+ Version: 1.7.1
8
 
9
  Author URI: http://alexrabe.de/
10
 
34
  if (!class_exists('nggLoader')) {
35
  class nggLoader {
36
 
37
+ var $version = '1.7.1';
38
  var $dbversion = '1.7.0';
39
  var $minium_WP = '3.0';
40
  var $donators = 'http://nextgen.boelinger.com/donators.php';
415
 
416
  function activate() {
417
  global $wpdb;
418
+ //Starting from version 1.8.0 it's works only with PHP5.2
419
  //if (version_compare(PHP_VERSION, '5.2.0', '<')) {
420
  // deactivate_plugins(plugin_basename(__FILE__)); // Deactivate ourself
421
  // wp_die("Sorry, but you can't run this plugin, it requires PHP 5.2 or higher.");
479
  return $option;
480
 
481
  if( isset($option->response[ $this_plugin ]) ){
482
+ //Clear it''s download link
483
+ $option->response[ $this_plugin ]->package = '';
484
 
485
  //Add a notice message
486
  if ($this->add_PHP5_notice == false){
readme.txt CHANGED
@@ -134,6 +134,11 @@ To show the most recent added mages : **[recent max=x ]**
134
 
135
  == Changelog ==
136
 
 
 
 
 
 
137
  = V1.7.0 - 11.12.2010 =
138
  * NEW : Publish a new post direct from the gallery admin page
139
  * NEW : Added filter hook 'ngg_get_image_metadata' to add more exif/iptc information
@@ -145,8 +150,8 @@ To show the most recent added mages : **[recent max=x ]**
145
  * Bugfix : Better support for SSL blogs
146
  * Bugfix : Install/Upgrade failed when table prefix contain captial letters
147
  * Bugfix : Fix validation issues in Media-RSS
148
- * Bugifx : Empty tags in XMP Meta causes PHP error
149
- * Bugifx : Rework load mechanism for slideshow
150
  * Bugfix : Copy meta data when image is copied
151
  * Bugfix : Icon Support for Ozh' Admin Drop Down Menu
152
  * Bugfix : Use correct sort order in slideshow
134
 
135
  == Changelog ==
136
 
137
+ = V1.7.1 - 13.12.2010 =
138
+ * Changed : Disable upgrade for PHP4 user
139
+ * Changed : Disable colorpicker for option page
140
+ * Bugfix : Compat fix for upgrade
141
+
142
  = V1.7.0 - 11.12.2010 =
143
  * NEW : Publish a new post direct from the gallery admin page
144
  * NEW : Added filter hook 'ngg_get_image_metadata' to add more exif/iptc information
150
  * Bugfix : Better support for SSL blogs
151
  * Bugfix : Install/Upgrade failed when table prefix contain captial letters
152
  * Bugfix : Fix validation issues in Media-RSS
153
+ * Bugfix : Empty tags in XMP Meta causes PHP error
154
+ * Bugfix : Rework load mechanism for slideshow
155
  * Bugfix : Copy meta data when image is copied
156
  * Bugfix : Icon Support for Ozh' Admin Drop Down Menu
157
  * Bugfix : Use correct sort order in slideshow