Hello,
I am willing to get pagelist results sorted by popularity : i.e. count
backlinks (targets). That way, most linked pages will be shown first.
For counting, targets, in config, I have :
# NbSource
$FmtPV['$NbSource'] = 'NbSource($page["targets"])';
function NbSource($targets) {
$cnt = substr_count($targets, "Source.");
return $cnt>0? "$cnt" : '';
}
(copied from http://www.pmwiki.org/wiki/Cookbook/MoreCustomPageVariables)
And my pagelist is like that :
(:pagelist group=Bob link={*$FullName} fmt=#description2 order=$NbSource:)
Problem now, is how to make value 2 before value 11, and so on (natural
order).
I have this line in my config as well, yet I dont know how to use it :
$PageListSortCmp['natural'] = 'strnatcasecmp($x, $y)';
Thank you,
Gilles.
_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users