Plugin Directory

Changeset 1579493


Ignore:
Timestamp:
01/22/2017 05:41:08 AM (9 years ago)
Author:
kn007
Message:

1.5 release

Location:
wp-comments-manager
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • wp-comments-manager/tags/1.5/readme.txt

    r1579105 r1579493  
    55Requires at least: 3.6
    66Tested up to: 4.7.1
    7 Stable tag: 1.4
     7Stable tag: 1.5
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    5050== Changelog ==
    5151
     52= 1.5 =
     53* Query Optimization.
     54* Fix some bugs.
     55
    5256= 1.4 =
    5357* Using back Wordpress API to edit comment.
  • wp-comments-manager/tags/1.5/wp-comments-manager.php

    r1579099 r1579493  
    33Plugin Name:Wordpress Comments Manager
    44Plugin URI: https://kn007.net/topics/new-wordpress-comment-management-system/
    5 Version: 1.4
     5Version: 1.5
    66Description: 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.
    77Author: kn007
     
    131131    if ($where === "") $where = "1=1";
    132132    // 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;
    135135    // process sql
    136136    $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;
    137137    $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    }
    139145    $count = $wpdb->get_var($cql);
    140146    $records = $wpdb->get_results($sql,ARRAY_A);
    141     // fix data for w2ui
     147    // fix some data for w2ui
    142148    $last = ($order['limit']>$count ? $count : $order['limit']);
    143149    for($i=0; $i<$last; $i++){
  • wp-comments-manager/trunk/readme.txt

    r1579105 r1579493  
    55Requires at least: 3.6
    66Tested up to: 4.7.1
    7 Stable tag: 1.4
     7Stable tag: 1.5
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    5050== Changelog ==
    5151
     52= 1.5 =
     53* Query Optimization.
     54* Fix some bugs.
     55
    5256= 1.4 =
    5357* Using back Wordpress API to edit comment.
  • wp-comments-manager/trunk/wp-comments-manager.php

    r1579099 r1579493  
    33Plugin Name:Wordpress Comments Manager
    44Plugin URI: https://kn007.net/topics/new-wordpress-comment-management-system/
    5 Version: 1.4
     5Version: 1.5
    66Description: 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.
    77Author: kn007
     
    131131    if ($where === "") $where = "1=1";
    132132    // 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;
    135135    // process sql
    136136    $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;
    137137    $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    }
    139145    $count = $wpdb->get_var($cql);
    140146    $records = $wpdb->get_results($sql,ARRAY_A);
    141     // fix data for w2ui
     147    // fix some data for w2ui
    142148    $last = ($order['limit']>$count ? $count : $order['limit']);
    143149    for($i=0; $i<$last; $i++){
Note: See TracChangeset for help on using the changeset viewer.