X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/cd5a24d8b405902801ca710cb77d6cc3f802f90f..b471a06f45f8bf9c2da21b42e666b081d16724a8:/IkiWiki/Plugin/pagestats.pm diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm index b0ecf7eca..304ddd1c8 100644 --- a/IkiWiki/Plugin/pagestats.pm +++ b/IkiWiki/Plugin/pagestats.pm @@ -34,14 +34,14 @@ sub getsetup () { sub linktext ($%) { # Return the text of the link to a tag, depending on option linktext. my ($page, %params) = @_; - if (exists $params{disp} && - exists $pagestate{$page} && - exists $pagestate{$page}{meta}{$params{disp}}) { - return $pagestate{$page}{meta}{$params{disp}}; - } - else { - return undef; - } + if (exists $params{show} && + exists $pagestate{$page} && + exists $pagestate{$page}{meta}{$params{show}}) { + return $pagestate{$page}{meta}{$params{show}}; + } + else { + return undef; + } } sub preprocess (@) { @@ -86,7 +86,7 @@ sub preprocess (@) { if (exists $params{limit}) { my $i=0; my %show; - foreach my $key (sort { $counts{$b} <=> $counts{$a} } keys %counts) { + foreach my $key (sort { $counts{$b} <=> $counts{$a} || $a cmp $b } keys %counts) { last if ++$i > $params{limit}; $show{$key}=$counts{$key}; } @@ -100,7 +100,7 @@ sub preprocess (@) { htmllink($params{page}, $params{destpage}, $_, noimageinline => 1, linktext => linktext($_, %params)). "