r6 - 16 Jul 2008 - 19:57:34 - PeterThoenyYou are here: TWiki >  Plugins Web > MostPopularPlugin
Tags:
navigation 2 Add my vote for this tag, rating 2 Add my vote for this tag, statistics 2 Add my vote for this tag, , create new tag

MostPopularPlugin

NOTE: The author stopped maintaining this plugin, it might not work with all TWiki releases. (New maintainer please remove this message)

First stab at a plugin that displays the most popular topics or webs, counting topic views site-wide.

Syntax Rules

The basic form is to include %MOSTPOPULAR{}% in your topic. The default is to output a table with the 10 most popular topics. The default behaviour can be changed by using the %MOSTPOPULAR{parameter1="value1" parameter2="value2" ...}% form. Valid parameters and their defaults are:

Parameter Explanation Default
limit Number of topics to show 10
format Format of the output (see below) | $web | $topic | $views |
header Header printed before the output | *Web* | *Topic* | *Views* |
noheader Supress header off
excluded Comma-seperated list of webs to exclude  
groupbyweb Show most popular webs instead of topics no

The format string can contain substitution patterns, these are:

String Substituted by
$views Topic views
$topic The topic name (only if groupbyweb is no)
$web The web name

Note that the plugin needs data collected from the logfiles. To generate this data, run bin/statistics-all regularly, eg. by requesting http://yourwiki.tld/bin/statistics-all from a cronjob.

Examples

  • %MOSTPOPULAR{}% displays:
%MOSTPOPULAR{}%

  • <ul>%MOSTPOPULAR{limit="5" format="<li>[[$web.$topic]]</li>" noheader="on"}%</ul> displays:
    %MOSTPOPULAR{limit="5" format="
  • $web.$topic?
  • " noheader="on"}%

Plugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %NEWPLUGIN_SHORTDESCRIPTION%

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Show most popular topics across webs

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip MostPopularPlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/MostPopularPlugin.txt Plugin topic
    data/TWiki/MostPopularPlugin.txt,v Plugin topic repository
    lib/TWiki/Plugins/MostPopularPlugin.pm Plugin Perl module
    lib/TWiki/Plugins/MostPopularPlugin/Statistics.pm Main module for the statistics collection process
    bin/statistics-all Kickstart binary for the statistics collection process
  • Configure the Plugin:
    • TWiki 4.0 and up: Run the configure script to enable the Plugin
    • Change the Plugin settings as needed
  • Test if the installation was successful:
    • Create a topic containing %MOSTPOPULAR{}%

Plugin Info

Plugin Author: TWiki:Main.KoenMartens
Copyright: © 2006, TWiki:Main.KoenMartens
License: GPL (GNU General Public License)
Plugin Version: 01 Aug 2006 (V0.2)
Change History:  
01 Aug 2006: Added grouping by web functionality
20 Jun 2006: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
Benchmarks: GoodStyle 100%, FormattedSearch 100%, MostPopularPlugin 98%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/MostPopularPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/MostPopularPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/MostPopularPluginAppraisal

Related Topics: TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences

-- TWiki:Main.KoenMartens - 20 Jun 2006

Topic attachments
I Attachment Action Size Date Who Comment
zipzip MostPopularPlugin.zip manage 10.9 K 12 Aug 2006 - 14:32 KoenMartens MostPopularPlugin
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r6 < r5 < r4 < r3 < r2 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo