On 10/02/2020 02:05, ABClf wrote:
Still working on updating my config for php72. I used to have a code implemented in config to sort numerical PV (named RevCount) in natural ordre. I use it to list most/less edited pages (and want to have 9 revisions come before 10 revisions). It does not work anymore if I'm not mistaken.Here it is the original code (from Petko) : # sorting with revcount param (natural order 12>2) function IntegerNameCompare($x, $y) { # get integer value of the page name or title $xval = intval(PageVar($x, '$RevCount')); $yval = intval(PageVar($y, '$RevCount')); # compare integer values if($xval > $yval) $c = 1; elseif($xval < $yval) $c = -1; else $c = 0; return $c; } $PageListSortCmp['revcount'] = 'IntegerNameCompare($x, $y)'; I'm begging for help ;)
Try with removing "($x, $y)" like this: $PageListSortCmp['revcount'] = 'IntegerNameCompare'; Petko _______________________________________________ pmwiki-users mailing list [email protected] http://www.pmichaud.com/mailman/listinfo/pmwiki-users
