Giter Club home page Giter Club logo

numberof's Introduction

numberof Plugin for DokuWiki

Simple plugin that counts the number of pages & media files in your Dokuwiki

All documentation for this plugin can be found at

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

Please refer to http://www.dokuwiki.org/plugins for additional info on how to install plugins in DokuWiki.

Copyright (C) S.C. Yoo [email protected]

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Usage

{{NUMBEROFPAGES}}

{{NUMBEROFMEDIAS}}

{{NUMBEROFPAGES>:game}}

{{NUMBEROFMEDIAS>:game}}

  • The counting is performed when you save the page. So values are not real-time.

numberof's People

Contributors

dryoo avatar dregad avatar splitbrain avatar

Stargazers

vani.wiki avatar Losang Jinpa, PhD, MCSE/MCT, Cloud Monk avatar

Watchers

 avatar James Cloos avatar Michael Sy. avatar  avatar

numberof's Issues

Displaying 0.

As is discussed in this forum post; https://forum.dokuwiki.org/post/66825;nocount

I wanted to put in a sentence which read
This section has {{NUMBEROFPAGES>:this_section}} pages

If there were six pages then it would read
This section has 6 pages - this is perfect.
If there were no pages then it would read
This section has pages

turnermm suggested replacing

case "PAGES":
               search($list,$conf['datadir'].$matches[1],array($this,'_search_count'),array('all'=>false),'');
                $data = $list['file_count'];
                break;
               
 case "MEDIAS":
                search($list,$conf['mediadir'].$matches[1],array($this,'_search_count'),array('all'=>true));
                $data    = $list['file_count'];
                break;

with

 case "PAGES":
               search($list,$conf['datadir'].$matches[1],array($this,'_search_count'),array('all'=>false),'');
                $data = $list['file_count'] ? $list['file_count'] : '0';
                break;
               
case "MEDIAS":
                search($list,$conf['mediadir'].$matches[1],array($this,'_search_count'),array('all'=>true));
                $data  = $list['file_count'] ? $list['file_count'] : '0';
                break;

This has worked well.

If you get the chance, could you please implement this into the existing code of the plugin or make it an option for those using the plugin
Thank you

not compatible with other languages

Hello in thish plugin when I wrtie a namespace that is wrote in persian language. it doesn't work.
For example this doesn't work:
{{NUMBEROFPAGES:صفحه}}
But this work correctly:
{{NUMBEROFPAGES:wiki}}

PHP Undefined array key warnings

The plugin throws several PHP warnings when viewing an uncached page, or when editing / previewing a page:

Warning: Undefined array key 1 in ./dokuwiki/lib/plugins/numberof/syntax.php on line 26
Warning: Undefined array key "dir_nest" in ./dokuwiki/lib/plugins/numberof/syntax.php on line 49
Warning: Undefined array key "dir_count" in ./dokuwiki/lib/plugins/numberof/syntax.php on line 50
Warning: Undefined array key "file_count" in ./dokuwiki/lib/plugins/numberof/syntax.php on line 54

Pull request follows.

page number update

Could you change the plugin so that a dynamic update of the pagenumber was possible?

Cheers
::: Alex

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.