Affiche la liste des abonnements / Displays the subscription list
Similar to usersubscriptions
$lang['btn_listeabo'] = 'Subscriptions';
[...] 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;
<?php tpl_button('listeabo')?>
to it (in default template you might wanna use line 61 for that).
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.
$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.
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
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!
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)
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 how I can correct this behaviour.
(DokuWiki 2009-02-14b)
I fixed it. It links now on a namespace subscriptions to the first page which is found in the namespace.
on line 126 I replaced:
else { if($page=='') $page = "root"; print $this->getLang('abo_cat')." \"".preg_replace("/:$/","",$page)."\""; $nbCat++; }
with this
else { if($page=='') $page = "root"; else $page = $this->next_file($page); print $this->getLang('abo_cat')." \"".preg_replace("/:.[^:]*$/","",$page)."\""; $nbCat++; }
and added this function:
function next_file($wiki_dir){ global $conf; $dir = $conf['savedir'].'/pages/'.$wiki_dir; $dir = str_replace(":","/",$dir); if($dh = opendir($dir)) { while(($file = readdir($dh)) !== false) { if($file != "." && $file != "..") { if (is_file($dir.$file)) { closedir($dh); $file = str_replace(".txt","",$file); return $wiki_dir.$file; } } } } }
(DokuWiki 2009-12-25c “Lemming”)
apuschmann 2010/04/12 16:22
(DokuWiki 2009-12-25c)
The file <dokuwiki>/inc/template.php has changed in this DokuWiki version. The Template custimization to add the button as described above isn't up to date. I'm not sure if it is right but following worked for me. I added only following three lines to template.php (between //listeabo):
... case 'subscribens': if($conf['useacl'] && $auth && $ACT == 'show' && $conf['subscribers'] == 1){ if($_SERVER['REMOTE_USER']){ if($INFO['subscribedns']) { if(actionOK('unsubscribens')) $out .= tpl_link(wl($ID,'do=unsubscribens'), $pre.(($inner)?$inner:$lang['btn_unsubscribens']).$suf, 'class="action unsubscribens" rel="nofollow"',1); } else { if(actionOK('subscribens')) $out .= tpl_link(wl($ID,'do=subscribens'), $pre.(($inner)?$inner:$lang['btn_subscribens']).$suf, 'class="action subscribens" rel="nofollow"',1); } //listeabo $out .= tpl_link(wl($ID,'do=listeabo'), $pre.(($inner)?$inner:$lang['btn_listeabo']).$suf, 'class="action subscribens" rel="nofollow"',1); //listeabo } } ...
Since Anteater DokuWiki stores additional data about digest mail subscriptions in the *.mlist files. This prevents the plugin from displaying the usernames in a proper way.
To re-enable the “good look” you could add the following three lines to your action.php: action.php - Line 94-96 — M. S.M. S.
lupo49
Warstein 2011/04/29 20:52