Tag Cloud have been very popular lately on web. "Rev Cloud" collects number of revisions instead Tags from pages.
During this sorting page that is modified multiple times will have a bigger font size to stand out against the ones that are not modified a lot.
sub DoOtherRequest {
...
&DoIndex();
+} elsif ($action eq "revcloud") {
+ &DoRevCloud();
+sub DoRevCloud {
+ my ($page, %pgrev, @pages, $min, $max, $minFont, $maxFont);
+
+ print &GetHeader('',Ts('Rev Cloud'), '');
+ foreach $page (&AllPagesList()) {
+ &OpenPage($page);
+ &OpenDefaultText();
+ $pgrev{$page} = $Page{'revision'};
+ @pages = sort {$pgrev{$b} <=> $pgrev{$a} || $a cmp $b} keys %pgrev;
+ $max = $pgrev{$pages[0]};
+ }
+ foreach $page (&AllPagesList()) {
+ &OpenPage($page);
+ &OpenDefaultText();
+ $pgrev{$page} = $Page{'revision'};
+ $min = 1;
+ $max = $pgrev{$page} if $pgrev{$page} > $max;
+ $min = $pgrev{$page} if not $min or $pgrev{$page} < $min;
+ $maxFont =75;
+ $minFont = 10;
+ print $q->a({-href => "$ScriptName?" . $page,-style => 'font-size:' .
+ # thanks to http://www.mileswjohnson.com/read/creating-a-tag-cloud-with-a-database
+ # Note: pending to reuse with permission!:
+ ($minFont + ($pgrev{$page} - $min) * ($maxFont - $minFont)
+ /(($max - $min == 0) ? 1 : $max - $min)) . "px", -title => "$pgrev{$page}"}, $page), (' ... ');
+ }
+ print &GetCommonFooter();
+ }
sub GetFooterText {
...
$result .= &GetPageLinkText($id, T('View current revision'));
}
+ $result .= ' | ';
+ $result .= &ScriptLink("action=revcloud", T("Rev Cloud"));
--JuanmaMP