Version Description
- 12.07.2011 =
- Bugfix : Set pagination variables for search result, otherwise update failed
- Bugfix : Update failed for paged galleries since WordPress 3.2
Download this release
Release Info
Developer | alexrabe |
Plugin | NextGEN Gallery – WordPress Gallery Plugin |
Version | 1.8.2 |
Comparing to | |
See all releases |
Code changes from version 1.8.1 to 1.8.2
- admin/manage-galleries.php +1 -1
- admin/manage-images.php +2 -1
- admin/manage.php +34 -21
- changelog.txt +4 -0
- lib/ngg-db.php +6 -2
- nggallery.php +2 -2
- readme.txt +4 -0
admin/manage-galleries.php
CHANGED
@@ -60,7 +60,7 @@ function nggallery_manage_gallery_main() {
|
|
60 |
}, true);
|
61 |
}
|
62 |
|
63 |
-
if ( document.activeElement.name == '
|
64 |
return true;
|
65 |
|
66 |
var numchecked = getNumChecked(document.getElementById('editgalleries'));
|
60 |
}, true);
|
61 |
}
|
62 |
|
63 |
+
if ( document.activeElement.name == 'post_paged' )
|
64 |
return true;
|
65 |
|
66 |
var numchecked = getNumChecked(document.getElementById('editgalleries'));
|
admin/manage-images.php
CHANGED
@@ -164,7 +164,7 @@ function checkSelected() {
|
|
164 |
}, true);
|
165 |
}
|
166 |
|
167 |
-
if ( document.activeElement.name == '
|
168 |
return true;
|
169 |
|
170 |
if(numchecked < 1) {
|
@@ -658,6 +658,7 @@ class _NGG_Images_List_Table extends WP_List_Table {
|
|
658 |
}
|
659 |
|
660 |
function get_column_info() {
|
|
|
661 |
$columns = get_column_headers( $this->_screen );
|
662 |
$hidden = get_hidden_columns( $this->_screen );
|
663 |
$_sortable = $this->get_sortable_columns();
|
164 |
}, true);
|
165 |
}
|
166 |
|
167 |
+
if ( document.activeElement.name == 'post_paged' )
|
168 |
return true;
|
169 |
|
170 |
if(numchecked < 1) {
|
658 |
}
|
659 |
|
660 |
function get_column_info() {
|
661 |
+
|
662 |
$columns = get_column_headers( $this->_screen );
|
663 |
$hidden = get_hidden_columns( $this->_screen );
|
664 |
$_sortable = $this->get_sortable_columns();
|
admin/manage.php
CHANGED
@@ -12,7 +12,7 @@ class nggManageGallery {
|
|
12 |
|
13 |
// initiate the manage page
|
14 |
function nggManageGallery() {
|
15 |
-
|
16 |
// GET variables
|
17 |
if( isset($_GET['gid']) )
|
18 |
$this->gid = (int) $_GET['gid'];
|
@@ -21,13 +21,13 @@ class nggManageGallery {
|
|
21 |
if( isset($_GET['mode']) )
|
22 |
$this->mode = trim ($_GET['mode']);
|
23 |
// Check for pagination request, avoid post process of other submit button
|
24 |
-
if ( isset($_POST['
|
25 |
-
if ( $_GET['paged'] != $_POST['
|
26 |
-
$_GET['paged'] = $_POST['
|
27 |
-
return;
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
if ( isset($_POST['page']) && $_POST['page'] == 'manage-galleries' )
|
32 |
$this->post_processor_galleries();
|
33 |
// Should be only called via a edit single gallery page
|
@@ -290,9 +290,9 @@ class nggManageGallery {
|
|
290 |
check_admin_referer('ngg_thickbox_form');
|
291 |
|
292 |
//save the new values for the next operation
|
293 |
-
$ngg->options['thumbwidth'] = (int)
|
294 |
-
$ngg->options['thumbheight'] = (int)
|
295 |
-
$ngg->options['thumbfix'] = (
|
296 |
update_option('ngg_options', $ngg->options);
|
297 |
|
298 |
$pic_ids = explode(',', $_POST['TB_imagelist']);
|
@@ -362,12 +362,12 @@ class nggManageGallery {
|
|
362 |
}
|
363 |
}
|
364 |
|
365 |
-
if (isset ($_POST['updatepictures'])) {
|
366 |
// Update pictures
|
367 |
|
368 |
check_admin_referer('ngg_updategallery');
|
369 |
|
370 |
-
if ( nggGallery::current_user_can( 'NextGEN Edit gallery options' )) {
|
371 |
|
372 |
if ( nggGallery::current_user_can( 'NextGEN Edit gallery title' )) {
|
373 |
// don't forget to update the slug
|
@@ -552,8 +552,18 @@ class nggManageGallery {
|
|
552 |
//on what ever reason I need to set again the query var
|
553 |
set_query_var('s', $_GET['s']);
|
554 |
$request = get_search_query();
|
555 |
-
|
556 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
557 |
// show pictures page
|
558 |
$this->mode = 'edit';
|
559 |
}
|
@@ -562,12 +572,12 @@ class nggManageGallery {
|
|
562 |
* Display the pagination.
|
563 |
*
|
564 |
* @since 1.8.0
|
565 |
-
* @author taken from WP core
|
566 |
* @return string echo the html pagination bar
|
567 |
*/
|
568 |
function pagination( $which, $current, $total_items, $per_page ) {
|
569 |
-
|
570 |
-
|
571 |
|
572 |
$output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
|
573 |
|
@@ -602,7 +612,7 @@ class nggManageGallery {
|
|
602 |
else
|
603 |
$html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='%s' value='%s' size='%d' />",
|
604 |
esc_attr__( 'Current page' ),
|
605 |
-
esc_attr( '
|
606 |
$current,
|
607 |
strlen( $total_pages )
|
608 |
);
|
@@ -624,9 +634,12 @@ class nggManageGallery {
|
|
624 |
'»'
|
625 |
);
|
626 |
|
627 |
-
$output .= "\n" . join( "\n", $page_links );
|
628 |
|
629 |
-
|
|
|
|
|
|
|
630 |
|
631 |
$pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
|
632 |
|
12 |
|
13 |
// initiate the manage page
|
14 |
function nggManageGallery() {
|
15 |
+
|
16 |
// GET variables
|
17 |
if( isset($_GET['gid']) )
|
18 |
$this->gid = (int) $_GET['gid'];
|
21 |
if( isset($_GET['mode']) )
|
22 |
$this->mode = trim ($_GET['mode']);
|
23 |
// Check for pagination request, avoid post process of other submit button
|
24 |
+
if ( isset($_POST['post_paged']) ) {
|
25 |
+
if ( $_GET['paged'] != $_POST['post_paged'] ) {
|
26 |
+
$_GET['paged'] = $_POST['post_paged'];
|
27 |
+
return;
|
28 |
+
}
|
29 |
+
}
|
30 |
+
// Should be only called via manage galleries overview
|
31 |
if ( isset($_POST['page']) && $_POST['page'] == 'manage-galleries' )
|
32 |
$this->post_processor_galleries();
|
33 |
// Should be only called via a edit single gallery page
|
290 |
check_admin_referer('ngg_thickbox_form');
|
291 |
|
292 |
//save the new values for the next operation
|
293 |
+
$ngg->options['thumbwidth'] = (int) $_POST['thumbwidth'];
|
294 |
+
$ngg->options['thumbheight'] = (int) $_POST['thumbheight'];
|
295 |
+
$ngg->options['thumbfix'] = isset ( $_POST['thumbfix'] ) ? true : false;
|
296 |
update_option('ngg_options', $ngg->options);
|
297 |
|
298 |
$pic_ids = explode(',', $_POST['TB_imagelist']);
|
362 |
}
|
363 |
}
|
364 |
|
365 |
+
if (isset ($_POST['updatepictures']) ) {
|
366 |
// Update pictures
|
367 |
|
368 |
check_admin_referer('ngg_updategallery');
|
369 |
|
370 |
+
if ( nggGallery::current_user_can( 'NextGEN Edit gallery options' ) && !isset ($_GET['s']) ) {
|
371 |
|
372 |
if ( nggGallery::current_user_can( 'NextGEN Edit gallery title' )) {
|
373 |
// don't forget to update the slug
|
552 |
//on what ever reason I need to set again the query var
|
553 |
set_query_var('s', $_GET['s']);
|
554 |
$request = get_search_query();
|
555 |
+
|
556 |
+
// look now for the images
|
557 |
+
$search_for_images = (array) $nggdb->search_for_images( $request );
|
558 |
+
$search_for_tags = (array) nggTags::find_images_for_tags( $request , 'ASC' );
|
559 |
+
|
560 |
+
// finally merge the two results together
|
561 |
+
$this->search_result = array_merge( $search_for_images , $search_for_tags );
|
562 |
+
|
563 |
+
// TODO: Currently we didn't support a proper pagination
|
564 |
+
$nggdb->paged['total_objects'] = $nggdb->paged['objects_per_page'] = count ($this->search_result) ;
|
565 |
+
$nggdb->paged['max_objects_per_page'] = 1;
|
566 |
+
|
567 |
// show pictures page
|
568 |
$this->mode = 'edit';
|
569 |
}
|
572 |
* Display the pagination.
|
573 |
*
|
574 |
* @since 1.8.0
|
575 |
+
* @author taken from WP core (see includes/class-wp-list-table.php)
|
576 |
* @return string echo the html pagination bar
|
577 |
*/
|
578 |
function pagination( $which, $current, $total_items, $per_page ) {
|
579 |
+
|
580 |
+
$total_pages = ($per_page > 0) ? ceil( $total_items / $per_page ) : 1;
|
581 |
|
582 |
$output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
|
583 |
|
612 |
else
|
613 |
$html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='%s' value='%s' size='%d' />",
|
614 |
esc_attr__( 'Current page' ),
|
615 |
+
esc_attr( 'post_paged' ),
|
616 |
$current,
|
617 |
strlen( $total_pages )
|
618 |
);
|
634 |
'»'
|
635 |
);
|
636 |
|
637 |
+
$output .= "\n<span class='pagination-links'>" . join( "\n", $page_links ) . '</span>';
|
638 |
|
639 |
+
if ( $total_pages )
|
640 |
+
$page_class = $total_pages < 2 ? ' one-page' : '';
|
641 |
+
else
|
642 |
+
$page_class = ' no-pages';
|
643 |
|
644 |
$pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
|
645 |
|
changelog.txt
CHANGED
@@ -6,6 +6,10 @@ by Alex Rabe & NextGEN DEV Team
|
|
6 |
* TODO : Switch to Plupload (http://www.plupload.com/)
|
7 |
* TODO : Rework album page for large amount of galleries
|
8 |
|
|
|
|
|
|
|
|
|
9 |
= V1.8.1 - 18.06.2011 =
|
10 |
* Bugfix : Special case for pagination, instead of showing page-1, we show the clean url
|
11 |
* Bugfix : Various PHP notice fixes
|
6 |
* TODO : Switch to Plupload (http://www.plupload.com/)
|
7 |
* TODO : Rework album page for large amount of galleries
|
8 |
|
9 |
+
= V1.8.2 - 12.07.2011 =
|
10 |
+
* Bugfix : Set pagination variables for search result, otherwise update failed
|
11 |
+
* Bugfix : Update failed for paged galleries since WordPress 3.2
|
12 |
+
|
13 |
= V1.8.1 - 18.06.2011 =
|
14 |
* Bugfix : Special case for pagination, instead of showing page-1, we show the clean url
|
15 |
* Bugfix : Various PHP notice fixes
|
lib/ngg-db.php
CHANGED
@@ -866,14 +866,18 @@ class nggdb {
|
|
866 |
if ( !empty($search) )
|
867 |
$search = " AND ({$search}) ";
|
868 |
|
869 |
-
$
|
870 |
} else
|
871 |
return false;
|
872 |
|
873 |
// build the final query
|
874 |
-
$query = "SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE 1=1 $search ORDER BY tt.pid ASC $
|
875 |
$result = $wpdb->get_results($query);
|
876 |
|
|
|
|
|
|
|
|
|
877 |
// Return the object from the query result
|
878 |
if ($result) {
|
879 |
foreach ($result as $image) {
|
866 |
if ( !empty($search) )
|
867 |
$search = " AND ({$search}) ";
|
868 |
|
869 |
+
$limit_by = ( $limit > 0 ) ? 'LIMIT ' . intval($limit) : '';
|
870 |
} else
|
871 |
return false;
|
872 |
|
873 |
// build the final query
|
874 |
+
$query = "SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE 1=1 $search ORDER BY tt.pid ASC $limit_by";
|
875 |
$result = $wpdb->get_results($query);
|
876 |
|
877 |
+
// TODO: Currently we didn't support a proper pagination
|
878 |
+
$this->paged['total_objects'] = $this->paged['objects_per_page'] = intval ( $wpdb->get_var( "SELECT FOUND_ROWS()" ) );
|
879 |
+
$this->paged['max_objects_per_page'] = 1;
|
880 |
+
|
881 |
// Return the object from the query result
|
882 |
if ($result) {
|
883 |
foreach ($result as $image) {
|
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 WordPress
|
6 |
Author: Alex Rabe
|
7 |
-
Version: 1.8.
|
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.8.
|
38 |
var $dbversion = '1.8.0';
|
39 |
var $minium_WP = '3.1';
|
40 |
var $donators = 'http://nextgen.boelinger.com/donators.php';
|
4 |
Plugin URI: http://alexrabe.de/?page_id=80
|
5 |
Description: A NextGENeration Photo Gallery for WordPress
|
6 |
Author: Alex Rabe
|
7 |
+
Version: 1.8.2
|
8 |
|
9 |
Author URI: http://alexrabe.de/
|
10 |
|
34 |
if (!class_exists('nggLoader')) {
|
35 |
class nggLoader {
|
36 |
|
37 |
+
var $version = '1.8.2';
|
38 |
var $dbversion = '1.8.0';
|
39 |
var $minium_WP = '3.1';
|
40 |
var $donators = 'http://nextgen.boelinger.com/donators.php';
|
readme.txt
CHANGED
@@ -130,6 +130,10 @@ To show the most recent added mages : **[recent max=x ]**
|
|
130 |
|
131 |
== Changelog ==
|
132 |
|
|
|
|
|
|
|
|
|
133 |
= V1.8.1 - 18.06.2011 =
|
134 |
* Bugfix : Special case for pagination, instead of showing page-1, we show the clean url
|
135 |
* Bugfix : Various PHP notice fixes
|
130 |
|
131 |
== Changelog ==
|
132 |
|
133 |
+
= V1.8.2 - 12.07.2011 =
|
134 |
+
* Bugfix : Set pagination variables for search result, otherwise update failed
|
135 |
+
* Bugfix : Update failed for paged galleries since WordPress 3.2
|
136 |
+
|
137 |
= V1.8.1 - 18.06.2011 =
|
138 |
* Bugfix : Special case for pagination, instead of showing page-1, we show the clean url
|
139 |
* Bugfix : Various PHP notice fixes
|