DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:listeabo

This is an old revision of the document!


listeabo Plugin

Compatible with DokuWiki

2008-05-05

plugin Affiche la liste des abonnements / Displays the subscription list

Last updated on
2009-01-05
Provides
Admin, Action

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 usersubscriptions

Tagged with abonnement, subscription

Description

  • action: displays your subscription list
  • admin: displays all the subscriptions
  • French, German and English. It's easy to add your own language.

Template customization

  • This will add a button/link after the “Subscribe Page Changes” / “Subscribe Namespace Changes” buttons/links, at the bottom of your pages
    • Add a line into the ./inc/lang/xx/lang.php file (xx is your language code):
      $lang['btn_listeabo'] = 'Subscriptions';
    • Modify ./inc/template.php to add the new button/link:
      [...]
       case 'subscription':
            if($conf['useacl'] && $auth && $ACT == 'show' && $conf['subscribers'] == 1){
              if($_SERVER['REMOTE_USER']){
                if($INFO['subscribed']){
                  print html_btn('unsubscribe',$ID,'',array('do' => 'unsubscribe',));
                } else {
                  print html_btn('subscribe',$ID,'',array('do' => 'subscribe',));
                }
                if($INFO['subscribedns']){
                  print html_btn('unsubscribens',$ID,'',array('do' => 'unsubscribens',));
                } else {
                  print html_btn('subscribens',$ID,'',array('do' => 'subscribens',));
                }
       
                //listeabo
                print html_btn('listeabo', $ID, '', array('do' => 'listeabo',));
                ///listeabo
       
                return true;
              }
            }
            return false;
       
      [...]
       
          case 'subscribens':
            if($conf['useacl'] && $auth && $ACT == 'show' && $conf['subscribers'] == 1){
              if($_SERVER['REMOTE_USER']){
                if($INFO['subscribedns']) {
                  tpl_link(wl($ID,'do=unsubscribens'),
                           $pre.(($inner)?$inner:$lang['btn_unsubscribens']).$suf,
                           'class="action unsubscribens" rel="nofollow"');
                } else {
                  tpl_link(wl($ID,'do=subscribens'),
                           $pre.(($inner)?$inner:$lang['btn_subscribens']).$suf,
                           'class="action subscribens" rel="nofollow"');
                }
       
                //listeabo
                tpl_link(wl($ID,'do=listeabo'),
                            $pre.(($inner)?$inner:$lang['btn_listeabo']).$suf,
                            'class="action subscribens" rel="nofollow"');
                ///listeabo
       
                return true;
              }
            }
            return false;

Version history

  • 2008-09-12: first one!
  • 2008-09-29: corrects PHP warnings.
  • 2008-10-06: Better superuser detection.
  • 2008-11-26: German language added (thanks to Otto R.)
  • 2009-01-05: Bugs corrected: BOM in the german lang.php file and error message when there are no subscriptions yet (thanks to Benjamin).

Discussion

  • Tell me…

2009-09-04

Good plugin - Tank You!

Info: The plugin requires the pagelist plugin for displaying the subscriptions.

Error: The unsubscribe Button in the list view doesn't work for namespace subscriptions. It links to
doku.php/namespace1:namespace2:?do=unsubscribens

It jumps to the start page, but doesn't unsubscribe the namespace subscription. I don't know whow I can correct this behaviour.

(dokuwiki 2009-02-14b)

2009-08-17 Installation error

Hello,

There is an error when I try to install the plugin with the Plugin Manager :

Impossible de télécharger le fichier du plugin:
http://membres.lycos.fr/emauvais/dokuwiki/listeabo.tar.gz

Warning: gzinflate() [function.gzinflate]: data error in /homez.195/giquello/www/cyrille/inc/HTTPClient.php on line 381

But it works when I do it by hand …

(PHP Version 5.2.10 and dokuwiki-2009-02-14b.tgz)

2008-09-29

  • Nice one. And it almost works. But there are a few minor things to change.
  • First we need to add a button to our navi bar. Open lib/tpl/your_template/main.php and add
    <?php tpl_button('listeabo')?>

    to it (in default template you might wanna use line 61 for that).

  • Now, we can marvel at some PHP errors to fix. To do that, just open up the action.php of your plugin.
    Go to line 87 where you can read
    if (!in_array($page2, $mespages)) $mespages[]=$page2;

    and replace it with

    if (!is_array($mespages) || !in_array($page2, $mespages)) $mespages[]=$page2;

    because we don't know, if $mespages really is an array.

    • → Correction done in version 2008-09-29. Thanks!
  • After that, we're almost done.
    Finally search for
    $titrePage = $pagelist->_getMeta('title');

    on line 111 and change it to

    $titrePage = $pagelist->_getMeta($page['id'], 'title');

    What the author forgot is that helper_plugin_pagelist::_getMeta() needs the current page $id as its first parameter.

    • → It doesn't work for me. When I add the id parameter, the _getMeta function doesn't send me the good page title…
  • Hope this helps,
    best regards from Germany,
    P. Tietz <tietz_patrick [at] web [dot] de>

2008-12-17

  • Would love to use this plugin, while using the arctic template I had to do some more modifications.
  • I have one remaining bug which i can't figure out, the following message is shown:
    Warning: Cannot modify header information - headers already sent by (output started at E:\$Apache_Dokuwiki\dokuwiki\lib\plugins\listeabo\lang\de\lang.php:1) in E:\$Apache_Dokuwiki\dokuwiki\inc\actions.php on line 141
The German language file has a BOM that causes this effect. Open it for instance with SciTE and remove it, then this plugin works fine.
Hope that helps, Benjamin <b-j [at] gmx.de>
Corrected with version 2009-01-05
Thanks
  • I hope someone has an idea,
    best regards from Germany,
    Franklin <franklin_ankum [at] hotmail [dot] com>

2009-01-02

If there are no subscriptions yet, the plugin causes a warning:

Warning: Invalid argument supplied for foreach() in /path_to_wiki/lib/plugins/listeabo/action.php on line 84

As the function $this→list_mlist(…) in line 69 returns NULL in this case the foreach-loop fails. As a workaround I would suggest to modify line 84 as following:

 foreach((is_array($pages) ? $pages : array()) as $page) {

Best regards from Germany,
Benjamin <b-j [at] gmx.de>

Thanks! Corrected in the new version (2009-01-05)
Happy new year!
plugin/listeabo.1252069892.txt.gz · Last modified: 2009-09-04 15:11 by 194.120.150.21

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