Summary: A recipe that keeps a wiki page with information about the most/Least popular pages in a wiki
Version: 201803019
Prerequisites: none
Status: Mantained
Maintainer: CarlosAB
License: GPL
Categories: Administration PHP72
Users: (view? / edit)

Questions answered by this recipe

How can I keep a Page with Information about the most/Least popular pages in my wiki?


A recipe that keeps a wiki page with information about the most/Least popular pages in a wiki


Donwload the recipe file and place it inside the cookbook folder, include a line in config.php that looks like this:


Where xxxx are month and day, on that order.


There is no need for configuration, but you can change the name of the pages where information is kept, like this:

before or after loading the recipe you can reewrite a variable to change page names.

$RecentViewsFmt = array(
  '$SiteGroup.SomeOtherName' => 
    '* [[{$Group}.{$Name}]]  . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]',
  '$Group.SomeOtherName' =>
    '* [[{$Group}/{$Name}]]  . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'


The following strings can be translated in an XLPage:

The translatable strings used are already covered by standard PmWiki functionality.


Once the script is loaded it will work by itself.


The name of this page is MostLeastPopular but the name of this recipe is RecentViews and the pages generated by it are also called RecentViews, and besides being almost a exact copy of standard PmWiki functionality (PostRecentChanges function), it covers a need to be filled on for PmWiki, that the PostRecentChanges function already does BUT only for pages that are edited. This recipe will register any activity or action regarded to a page, be it browse, edit, print, diff and all others, as long as PmWwiki is called and a action is provided, RecentViews will keep a record on that, which I believe is a better way to "calculate" page popularity.

To do / some day / maybe

Perhaps not just simply copy PmWiki functionality for this recipe but have something more elaborated to also keep the count of visits

Change log / Release notes

20180319 - First release - recentviews-20180319.phpΔ

See also



See discussion at MostLeastPopular-Talk?

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.