DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:wikistats

WikiStats Plugin

Compatible with DokuWiki

Ponder Stibbons, Hrun, Detritus, Elenor of Tsort, Frusterick Manners

plugin wikistats Plugin for DokuWiki

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

This extension is marked as obsoleted. Therefore it is hidden in the Extension Manager and the extension listing. Furthermore, it is candidate for removal.

The missing download url means that this extension cannot be installed via the Extension Manager. Please see Publishing a Plugin on dokuwiki.org. Recommended are public repository hosts like GitHub, GitLab or Bitbucket.

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to numberof, stats

Tagged with !missing, !obsolete, report, statistics

Installation

Search and install the plugin using the Extension Manager.

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

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 FIXME

Bugs and features request

Please report issues in the bug tracker FIXME

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

FIXME

The ten most recent changes:

{{rss>https://github.com/4x4-chris/wikistats/commits/master.atom date author}}

A full list can be found on Github FIXME

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: 2023-05-05 23:45 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki