[pmwiki-users] pagelist order

Hans design5 at softflow.co.uk
Thu Mar 20 19:15:38 CDT 2008


or more easy to read and still short like

$PageListSortCmp['shortyear'] = 'ShortYear($x, $y)';
function ShortYear($x, $y) {
   $dx = PageVar($x, '$Name');
   $dy = PageVar($y, '$Name');
   $x = (substr($dx,0,2)>=50 ? '0'.$dx : '1'.$dx);
   $y = (substr($dy,0,2)>=50 ? '0'.$dy : '1'.$dy);
   return strcmp($x, $y);
}


  ~Hans




More information about the pmwiki-users mailing list