Public user lists or directories, pagination and permalinks

If you are using the amr-users plugin to provide a public user list or directory and you want to have the pagination working, there is a small bug when permalinks are used.  IE does not happen in admin.

Note:

  • if you have a short list you can simply set the rows per page to avoid pagination kicking in.
  • please consider user privacy when deciding what fields to include in the public list.

To correct this, edit file ameta-includes.php, from about Line 393, it should look like this:
(Note you can delete the commented out bits, just in for clarity of change).

//if (isset($_GET['listpage'])) $oldpage = $_GET['listpage'];
//else $oldpage = '';
$base = remove_query_arg ('listpage', $_SERVER['QUERY_STRING']);
//$base = str_replace('&listpage='.$oldpage,'',$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']);
//$base = str_replace('?listpage='.$oldpage,'',$base); /* just in case */
if (!empty($_SERVER['QUERY_STRING']) ) $format = '&listpage=%#%'; // ?page=%#% : %#% is replaced by the page number
else $format = '?listpage=%#%';
$paging_text = paginate_links( array(  /* uses wordpress function */
'total'     => $totalpages,
'current'     => $thispage,
//                'base' => $base.'%_%', // http://example.com/all_posts.php%_% : %_% is replaced by format (below)
'base'         => @add_query_arg('listpage','%#%'),
'format'     => '',
'end_size'     => 2,
'mid_size'     => 1,
'add_args'     => false
) );

A revised version will be up soon, but I’d like to see if I can roll a few minor features into before doing an update.

Thanks to NinaJ for reporting this