Changeset 1579493
- Timestamp:
- 01/22/2017 05:41:08 AM (9 years ago)
- Location:
- wp-comments-manager
- Files:
-
- 3 edited
- 2 copied
-
tags/1.5 (copied) (copied from wp-comments-manager/trunk)
-
tags/1.5/readme.txt (copied) (copied from wp-comments-manager/trunk/readme.txt) (2 diffs)
-
tags/1.5/wp-comments-manager.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-comments-manager.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-comments-manager/tags/1.5/readme.txt
r1579105 r1579493 5 5 Requires at least: 3.6 6 6 Tested up to: 4.7.1 7 Stable tag: 1. 47 Stable tag: 1.5 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 50 50 == Changelog == 51 51 52 = 1.5 = 53 * Query Optimization. 54 * Fix some bugs. 55 52 56 = 1.4 = 53 57 * Using back Wordpress API to edit comment. -
wp-comments-manager/tags/1.5/wp-comments-manager.php
r1579099 r1579493 3 3 Plugin Name:Wordpress Comments Manager 4 4 Plugin URI: https://kn007.net/topics/new-wordpress-comment-management-system/ 5 Version: 1. 45 Version: 1.5 6 6 Description: Wordpress Comments Manager help you to quickly find comments and manage comments. It can be very convenient to review selected comments, open the comment in a new window, reply comment, edit comment and delete comments. See the screenshots for more details. 7 7 Author: kn007 … … 131 131 if ($where === "") $where = "1=1"; 132 132 // prepare offset 133 if (!isset($order['limit']) || !is_int($order['limit'])) $order['limit'] =100;134 if (!isset($order['offset']) || !is_int($order['offset'])) $order['offset'] =0;133 $order['limit'] = isset($order['limit']) ? (int) $order['limit'] : 100; 134 $order['offset'] = isset($order['offset']) ? (int) $order['offset'] : 0; 135 135 // process sql 136 136 $sql = "SELECT `comment_ID`,`comment_author`,`comment_author_email`,`comment_author_url`,`comment_content`,`comment_author_IP`,`comment_date`,`comment_agent` FROM `".$wpdb->comments."` WHERE ".$where; 137 137 $cql = "SELECT count(1) FROM ($sql) as grid_list_1"; 138 $sql .= $orderby." ORDER BY `comment_ID` DESC LIMIT ".$order['limit']." OFFSET ".$order['offset']; 138 if ($order['offset'] == 0) { 139 $sql .= " ORDER BY `comment_ID` DESC LIMIT ".$order['limit']; 140 }else{ 141 $sql .= " AND `comment_ID`<=("; 142 $sql .= "SELECT `comment_ID` FROM `wp_comments` WHERE ".$where." ORDER BY `comment_ID` DESC LIMIT ".$order['offset'].",1"; 143 $sql .= ") ORDER BY `comment_ID` DESC LIMIT ".$order['limit']; 144 } 139 145 $count = $wpdb->get_var($cql); 140 146 $records = $wpdb->get_results($sql,ARRAY_A); 141 // fix data for w2ui147 // fix some data for w2ui 142 148 $last = ($order['limit']>$count ? $count : $order['limit']); 143 149 for($i=0; $i<$last; $i++){ -
wp-comments-manager/trunk/readme.txt
r1579105 r1579493 5 5 Requires at least: 3.6 6 6 Tested up to: 4.7.1 7 Stable tag: 1. 47 Stable tag: 1.5 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 50 50 == Changelog == 51 51 52 = 1.5 = 53 * Query Optimization. 54 * Fix some bugs. 55 52 56 = 1.4 = 53 57 * Using back Wordpress API to edit comment. -
wp-comments-manager/trunk/wp-comments-manager.php
r1579099 r1579493 3 3 Plugin Name:Wordpress Comments Manager 4 4 Plugin URI: https://kn007.net/topics/new-wordpress-comment-management-system/ 5 Version: 1. 45 Version: 1.5 6 6 Description: Wordpress Comments Manager help you to quickly find comments and manage comments. It can be very convenient to review selected comments, open the comment in a new window, reply comment, edit comment and delete comments. See the screenshots for more details. 7 7 Author: kn007 … … 131 131 if ($where === "") $where = "1=1"; 132 132 // prepare offset 133 if (!isset($order['limit']) || !is_int($order['limit'])) $order['limit'] =100;134 if (!isset($order['offset']) || !is_int($order['offset'])) $order['offset'] =0;133 $order['limit'] = isset($order['limit']) ? (int) $order['limit'] : 100; 134 $order['offset'] = isset($order['offset']) ? (int) $order['offset'] : 0; 135 135 // process sql 136 136 $sql = "SELECT `comment_ID`,`comment_author`,`comment_author_email`,`comment_author_url`,`comment_content`,`comment_author_IP`,`comment_date`,`comment_agent` FROM `".$wpdb->comments."` WHERE ".$where; 137 137 $cql = "SELECT count(1) FROM ($sql) as grid_list_1"; 138 $sql .= $orderby." ORDER BY `comment_ID` DESC LIMIT ".$order['limit']." OFFSET ".$order['offset']; 138 if ($order['offset'] == 0) { 139 $sql .= " ORDER BY `comment_ID` DESC LIMIT ".$order['limit']; 140 }else{ 141 $sql .= " AND `comment_ID`<=("; 142 $sql .= "SELECT `comment_ID` FROM `wp_comments` WHERE ".$where." ORDER BY `comment_ID` DESC LIMIT ".$order['offset'].",1"; 143 $sql .= ") ORDER BY `comment_ID` DESC LIMIT ".$order['limit']; 144 } 139 145 $count = $wpdb->get_var($cql); 140 146 $records = $wpdb->get_results($sql,ARRAY_A); 141 // fix data for w2ui147 // fix some data for w2ui 142 148 $last = ($order['limit']>$count ? $count : $order['limit']); 143 149 for($i=0; $i<$last; $i++){
Note: See TracChangeset
for help on using the changeset viewer.