rtMedia for WordPress, BuddyPress and bbPress - Version 3.4.5

Version Description

  • Fix pagging query sql issues
Download this release

Release Info

Developer faishal
Plugin Icon 128x128 rtMedia for WordPress, BuddyPress and bbPress
Version 3.4.5
Comparing to
See all releases

Code changes from version 3.4.4 to 3.4.5

app/helper/RTMediaModel.php CHANGED
@@ -98,9 +98,22 @@ class RTMediaModel extends RTDBModel {
98
$qorder_by = apply_filters ( 'rtmedia-model-order-by-query', $qorder_by, $this->table_name );
99
100
$sql = $select . $from . $join . $where . $qgroup_by . $qorder_by;
101
- if ( is_integer ( $offset ) && is_integer ( $per_page ) ) {
102
$sql .= ' LIMIT ' . $offset . ',' . $per_page;
103
}
104
if( ! $count_flag )
105
return $wpdb->get_results ( $sql );
106
else
@@ -178,8 +191,17 @@ class RTMediaModel extends RTDBModel {
178
$where = apply_filters ( 'rtmedia-get-album-where-query', $where, $this->table_name );
179
$qorder_by = " ORDER BY {$this->table_name}.$order_by ";
180
$sql .= $where . $qorder_by ;
181
-
182
- if ( is_integer ( $offset ) && is_integer ( $per_page ) ) {
183
$sql .= ' LIMIT ' . $offset . ',' . $per_page;
184
}
185
@@ -197,7 +219,15 @@ class RTMediaModel extends RTDBModel {
197
$sql.= " AND {$this->table_name}.blog_id = '".get_current_blog_id()."' ";
198
}
199
$sql .= " ORDER BY {$this->table_name}.$order_by";
200
-
201
if ( is_integer ( $offset ) && is_integer ( $per_page ) ) {
202
$sql .= ' LIMIT ' . $offset . ',' . $per_page;
203
}
98
$qorder_by = apply_filters ( 'rtmedia-model-order-by-query', $qorder_by, $this->table_name );
99
100
$sql = $select . $from . $join . $where . $qgroup_by . $qorder_by;
101
+ if($offset !== false){
102
+ if(! is_integer($offset))
103
+ $offset = 0;
104
+
105
+ if( intval ( $offset ) < 0 )
106
+ $offset = 0;
107
+
108
+ if( ! is_integer($per_page) )
109
+ $per_page = 0;
110
+
111
+ if( intval ( $per_page ) < 0 )
112
+ $per_page = 1;
113
+
114
$sql .= ' LIMIT ' . $offset . ',' . $per_page;
115
}
116
+
117
if( ! $count_flag )
118
return $wpdb->get_results ( $sql );
119
else
191
$where = apply_filters ( 'rtmedia-get-album-where-query', $where, $this->table_name );
192
$qorder_by = " ORDER BY {$this->table_name}.$order_by ";
193
$sql .= $where . $qorder_by ;
194
+ if($offset !== false){
195
+ if(! is_integer($offset))
196
+ $offset = 0;
197
+ if( intval ( $offset ) < 0 )
198
+ $offset = 0;
199
+
200
+ if(! is_integer($per_page))
201
+ $per_page = 0;
202
+ if( intval ( $per_page ) < 0 )
203
+ $per_page = 1;
204
+
205
$sql .= ' LIMIT ' . $offset . ',' . $per_page;
206
}
207
219
$sql.= " AND {$this->table_name}.blog_id = '".get_current_blog_id()."' ";
220
}
221
$sql .= " ORDER BY {$this->table_name}.$order_by";
222
+ if(! is_integer($offset))
223
+ $offset = 0;
224
+ if( intval ( $offset ) < 0 )
225
+ $offset = 0;
226
+
227
+ if(! is_integer($per_page))
228
+ $per_page = 0;
229
+ if( intval ( $per_page ) < 0 )
230
+ $per_page = 1;
231
if ( is_integer ( $offset ) && is_integer ( $per_page ) ) {
232
$sql .= ' LIMIT ' . $offset . ',' . $per_page;
233
}
app/helper/db/RTDBModel.php CHANGED
@@ -88,7 +88,16 @@ if(!class_exists('RTDBModel')) {
88
if ($return_array["total"] > 0) {
89
$other = "";
90
if ($paging) {
91
$offset = ($page - 1) * $this->per_page;
92
if ($offset <= $return_array["total"]) {
93
$other = " LIMIT " . $offset . "," . $this->per_page;
94
}else{
@@ -161,10 +170,19 @@ if(!class_exists('RTDBModel')) {
161
$sql = $select . $where ;
162
163
$sql .= " ORDER BY {$this->table_name}.$order_by";
164
-
165
- if(is_integer($offset) && is_integer($per_page)) {
166
- $sql .= ' LIMIT ' . $offset . ',' . $per_page;
167
- }
168
global $wpdb;
169
return $wpdb->get_results($sql);
170
}
88
if ($return_array["total"] > 0) {
89
$other = "";
90
if ($paging) {
91
+ if( intval ( $this->per_page ) < 0 )
92
+ $this->per_page = 1;
93
+
94
$offset = ($page - 1) * $this->per_page;
95
+
96
+ if(! is_integer($offset))
97
+ $offset = 0;
98
+ if( intval ( $offset ) < 0 )
99
+ $offset = 0;
100
+
101
if ($offset <= $return_array["total"]) {
102
$other = " LIMIT " . $offset . "," . $this->per_page;
103
}else{
170
$sql = $select . $where ;
171
172
$sql .= " ORDER BY {$this->table_name}.$order_by";
173
+ if($offset !== false){
174
+ if(! is_integer($offset))
175
+ $offset = 0;
176
+ if( intval ( $offset ) < 0 )
177
+ $offset = 0;
178
+
179
+ if(! is_integer($per_page))
180
+ $per_page = 0;
181
+ if( intval ( $per_page ) < 0 )
182
+ $per_page = 1;
183
+ $sql .= ' LIMIT ' . $offset . ',' . $per_page;
184
+
185
+ }
186
global $wpdb;
187
return $wpdb->get_results($sql);
188
}
index.php CHANGED
@@ -4,7 +4,7 @@
4
Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
5
Plugin URI: http://rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
6
Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
7
- Version: 3.4.4
8
Author: rtCamp
9
Text Domain: rtmedia
10
Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
4
Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
5
Plugin URI: http://rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
6
Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
7
+ Version: 3.4.5
8
Author: rtCamp
9
Text Domain: rtmedia
10
Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
readme.txt CHANGED
@@ -6,7 +6,7 @@ License: GPLv2 or later
6
License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
Requires at least: WordPress 3.6
8
Tested up to: WordPress 3.7 + BuddyPress 1.8.1
9
- Stable tag: 3.4.4
10
11
Add albums, photo, audio/video encoding, privacy, sharing, front-end uploads & more. All this works mobile/tablets devices.
12
@@ -133,6 +133,9 @@ http://www.youtube.com/watch?v=dJrykKQGDcs
133
134
Please visit [rtMedia's Roadmap page](http://rtcamp.com/rtmedia/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit rtMedia's Features page") to get some details about future releases.
135
136
= 3.4.4 =
137
* Update german trasalation
138
* Add support in some strings translations again thanks to [jonasnick](https://github.com/jonasnick) for pull request
@@ -660,8 +663,8 @@ Please visit [rtMedia's Roadmap page](http://rtcamp.com/rtmedia/roadmap/?utm_sou
660
661
== Upgrade Notice ==
662
663
- = 3.4.4 =
664
- Requires BuddyPress 1.7 or higher, if using BuddyPress. Add some strings in translations
665
666
== Sponsors ==
667
6
License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
Requires at least: WordPress 3.6
8
Tested up to: WordPress 3.7 + BuddyPress 1.8.1
9
+ Stable tag: 3.4.5
10
11
Add albums, photo, audio/video encoding, privacy, sharing, front-end uploads & more. All this works mobile/tablets devices.
12
133
134
Please visit [rtMedia's Roadmap page](http://rtcamp.com/rtmedia/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit rtMedia's Features page") to get some details about future releases.
135
136
+ = 3.4.5 =
137
+ * Fix pagging query sql issues
138
+
139
= 3.4.4 =
140
* Update german trasalation
141
* Add support in some strings translations again thanks to [jonasnick](https://github.com/jonasnick) for pull request
663
664
== Upgrade Notice ==
665
666
+ = 3.4.5 =
667
+ Requires BuddyPress 1.7 or higher, if using BuddyPress. Fix pagging query sql issues
668
669
== Sponsors ==
670