DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:wikistats

wikistats Plugin

Compatible with DokuWiki

  • 2017-02-19 "Frusterick Manners" yes
  • 2016-06-26 "Elenor Of Tsort" yes
  • 2015-08-10 "Detritus" yes
  • 2014-09-29 "Hrun" yes

plugin wikistats Plugin for DokuWiki

Last updated on
2017-06-28
Provides
Syntax, Helper, Action
Repository
Source

Similar to numberof, stats

Tagged with report, statistics

Installation

Download the wikistats archive from the Git Repo.

If you install this plugin manually, make sure it is installed in lib/plugins/wikistats/ folder is called different it will not work!

Please refer to Plugins for additional info on how to install plugins in DokuWiki.

This plugin requires the modification of the template (Often main.php). Decide where you want to insert the Stats link in your template and insert the following code:

if (!plugin_isdisabled('wikistats') && 
   ($wikistats =& plugin_load('helper', 'wikistats'))) { 
     $wikistats->add_stats_link();
}

Most likely you want to do that in the /lib/tpl/default/main.php inside the <div id="bar__bottomright"/> as follows:

<div class="bar-right" id="bar__bottomright">
  <?php if (!plugin_isdisabled('wikistats') && 
           ($wikistats =& plugin_load('helper', 'wikistats'))) 
             $wikistats->add_stats_link(); ?>
  <?php tpl_button('subscription')?>
  <?php tpl_button('admin')?>
  <?php tpl_button('profile')?>
  <?php tpl_button('login')?>
  <?php tpl_button('index')?>
  <?php tpl_button('top')?>&nbsp;
</div>

For Dokuwiki “Release 2017-02-19b Frusterick Manners”, you should process as follows:

<!-- SITE TOOLS -->
<div id="dokuwiki__sitetools">
  <h3 class="a11y"><?php echo $lang['site_tools']; ?></h3>
  <?php tpl_searchform(); ?>
  <div class="mobileTools">
    <?php tpl_actiondropdown($lang['tools']); ?>
  </div>
  <ul>
    <?php
      if (!plugin_isdisabled('wikistats') && ($wikistats = plugin_load('helper', 'wikistats')))
        $wikistats->add_stats_link();
    ?>
    <?php
      tpl_toolsevent('sitetools', array(
        tpl_action('recent', true, 'li', true),
        tpl_action('media', true, 'li', true),
        tpl_action('index', true, 'li', true)
      ));
    ?>
  </ul>
</div>

Now, you have to create the stats page following the namespace and name given in the plugin admin configuration (wiki:statistiques is the default value).

To create this page, do as usual :smile:

And add some code within, for example:

====== Statistiques ======

{{wikistats>ns = -wiki & type = stats}}

Examples/Usage

Type of stats displayed

To display only topic (pages) stats

{{wikistats>type = pages}}

To display only resources stats

{{wikistats>type = medias}}

To display all stats (including namspaces and tags (if tag plugin is installed))

{{wikistats>type = all}}
Note that the type parameter is mandatory

Whitelist/blacklist by namespace

By default plugin shows the stats of the entire wiki. To restrict the statistics to a given namespace and its sub-namespaces you can specify its name either directly or using ns parameter:

{{wikistats>foo & type = pages}}
{{wikistats>ns = foo & type = pages}}

The ns parameter supports both inclusion and exclusion of the namespaces. If a namespace name starts with a minus sign that namespace will be excluded. Also you can assign a number of namespaces as a comma separated list:

{{wikistats>ns = -foo & type = pages}}
{{wikistats>ns = foo, bar, -bar:baz & type = pages}}

The first example will show the pages stats in all namespaces except of “foo”, the second one will include “foo” and “bar” namespaces except of “bar:baz” sub-namespace.

Note that namespaces restrictions are not supported for tags and namespaces stats

Multiple parameters syntax

If you want to pass a number of parameters to the plugin they should be separated with an ampersand (&), for example:

{{wikistats>ns = -foo & type = pages}}

The above syntax would display pages stats for the entire wiki except for the “foo” namespace.

Development

Git repository

A public git repository is available here

Bugs and features request

Please report issues in the bug tracker

Languages

  • English
  • French
  • Spanish
  • German

ToDo / Wish list

  • Add bargraph display
  • Allow configuration of bar color
  • Support namespaces restrictions for tags stats
  • Handle namespaces with medias and without pages as an error (could be configured)
  • Color for namespace errors could be configured
  • Add Docker support for development environnement
  • Add total for resources and namespaces stats

Changelog

The ten most recent changes:

A full list can be found on Github.

Releases

  • 2017-06-29
    • Add TOC support
    • TOC display could be desactivated in plugin administration
  • 2017-06-28
    • 2017-06-28 release
  • 2017-06-27
    • Add option to change render style
    • Add resources types translations
    • Namespace stats now show medias counts
    • Update General Informations and Installation instructions
    • Plugin now display stats even if Tag plugin is not installed
    • Namespaces are sorted in ascending alphabetical order
    • Code refactoring
  • 2017-06-22
    • Add stats icon to wiki template
  • 2017-06-20
    • Initial release

FAQ

_None actually_

Discussion

plugin/wikistats.txt · Last modified: 2017-06-30 09:59 by 178.237.101.5