Ok, now I can’t have the pagination working!
When I change the number of users that have to be shown in the option page, I get the good number of pages but :
I have all my users shown on each page!!!
The options are not well filled ?
to give you the ability to help me I post here a part of my code witch could maybe be interesting for this issue:
<?php
require_once('paging.class.php');
$paging = new paging;
$SQL = "SELECT distinct(wp_users.ID) as ID,display_name FROM wp_users";
if (isset($_POST['search_name']) && trim($_POST['search_name']) != '') {
$SQL .= " INNER JOIN wp_usermeta ON (wp_users.ID = wp_usermeta.user_id)
INNER JOIN wp_usermeta AS mt1 ON (wp_users.ID = mt1.user_id) ";
}
$SQL .= " INNER JOIN wp_usermeta AS mt6 ON (wp_users.ID = mt6.user_id) WHERE 1=1 ";
if (isset($_POST['search_name']) && trim($_POST['search_name']) != '') {
$SQL .= "AND
(
(wp_usermeta.meta_key = 'first_name' AND CAST(wp_usermeta.meta_value AS CHAR) LIKE '%" . $_POST['search_name'] . "%')
OR
(mt1.meta_key = 'last_name' AND CAST(mt1.meta_value AS CHAR) LIKE '%" . $_POST['search_name'] . "%')
) ";
}
$TSQL = $SQL . " AND
(mt6.meta_key = 'wp_capabilities' AND CAST(mt6.meta_value AS CHAR) LIKE '%Subscriber%')
ORDER BY display_name ASC ";
$t_record = $wpdb->get_results($SQL);
$total_records = count($t_record);
$record_per_page = get_option('wp_user_plugin_record_per_page');
$paging->assign(get_permalink(), $total_records, $record_per_page);
$sql_limit = $paging->sql_limit();
/* //pour filtrer sur les suscribers seulement... pas besoin moi je veux tout le monde !
$SQL .= " AND
(mt6.meta_key = 'wp_capabilities' AND CAST(mt6.meta_value AS CHAR) LIKE '%Subscriber%')
ORDER BY display_name ASC LIMIT " . $sql_limit;
**/
$fivesdrafts = $wpdb->get_results($SQL);
if someone can help… thank’s