I determined also that the problem was in the use of the floor function. However, correct me if I'm wrong, but you ONLY want to add +1 to $total pages IF there is a fractional part in ($total/20) which gets lost with the floor function. Based on that assumption, I tried this and it seems to work:
Same script:
Find: $totalpages = floor($total/20);
add before this line:
$testtotal = ($total/20);
and add after the line:
if($testtotal > $totalpages)
$totalpages++;
so that it looks like this:
$testtotal = ($total/20);
$totalpages = floor($total/20);
if($testtotal > $totalpages)
$totalpages++;
This will add 1 to $totalpages only IF there is a fractional part.
Now that I have the correct number of pages showing, there is also a problem with the variable $total.
Example: If you choose to prune posts between two dates, and don't check the manual prune box, it will tell you
"You have chosen to prune "X" topics", but then if you click the "Let me review the selected topics first" you find that the actual number of posts returned that meet the critera is actually X+1. In other words, if it tells you "You have chosen to prune 41 topics" what you actually get in the list of topics is 42 topics (all of which do meet the select criteria). In other words, the number of topics it tells you have been selected, is always one less than truth.
Basil