目次

favoris Plugin

互換性のある DokuWiki バージョン

Rincewind, Angua

plugin Displays your favorite pages (most visited) and let you set them up (fr: Affiche les liens vers vos pages favorites (les plus visitees) et vous permet de les gerer)

最終更新日
2009-03-04
種類
Syntax, Action

この拡張は二年以上更新されていません。もはや維持管理や対応がされておらず、互換性に問題がある可能性があります。

タグ bookmark, listing, navigation, users

Description

Usage

The list

The list when the controls are displayed The list and the excluded pages and the small configuration panel

La mosaïque

Version history

Discussion

Patch to show page titles

Nice plugin! From the code it appears favoris will use the pagelist if installed to generate titles for listed pages. But if it's not installed it just displays page filenames. It can be problematic when many pages have the same filename (such as start pages in namespaces). I hacked plugins/favoris/syntax.php to generate titles from headings even without pagelist by replacing

syntax.php (old)
 function donneLien($page, $title="") {
      if (!plugin_isdisabled('pagelist')) $pagelist = plugin_load('helper', 'pagelist');
 
      if (!$pagelist) {
        $titrePage=explode(":",$page);
        $titrePage=$titrePage[sizeof($titrePage)-1];
        $titrePage=str_replace('_',' ',$titrePage);
      }
      else {
        $pagelist->page['id']=$page;
        $pagelist->page['exists'] = 1;
        $pagelist->_meta=NULL;
        $titrePage = $pagelist->_getMeta('title');
        if (!$titrePage) $titrePage = str_replace('_', ' ', noNS($page));
        $titrePage = hsc($titrePage);
     }
     if (@file_exists(fullpath(wikiFN($page)))) return "<a href='doku.php?id=".$page."' class='wikilink1' style='font-weight: lighter;' title='$page".$title."'>$titrePage</a>";
     else return "<a href='doku.php?id=".$page."' class='wikilink2' style='font-weight: lighter;' title='$page".$title."' rel='nofollow'>$titrePage</a>";
   }

with

syntax.php (new)
 function donneLien($page, $title="") {
      $titrePage=p_get_first_heading($page);
      if (!$titrePage) {
 
      if (!plugin_isdisabled('pagelist')) $pagelist = plugin_load('helper', 'pagelist');
 
      if (!$pagelist) {
        $titrePage=explode(":",$page);
        $titrePage=$titrePage[sizeof($titrePage)-1];
        $titrePage=str_replace('_',' ',$titrePage);
      }
      else {
        $pagelist->page['id']=$page;
        $pagelist->page['exists'] = 1;
        $pagelist->_meta=NULL;
        $titrePage = $pagelist->_getMeta('title');
        if (!$titrePage) $titrePage = str_replace('_', ' ', noNS($page));
        $titrePage = hsc($titrePage);
     }
     }
     if (@file_exists(fullpath(wikiFN($page)))) return "<a href='doku.php?id=".$page."' class='wikilink1' style='font-weight: lighter;' title='$page".$title."'>$titrePage</a>";
     else return "<a href='doku.php?id=".$page."' class='wikilink2' style='font-weight: lighter;' title='$page".$title."' rel='nofollow'>$titrePage</a>";
   }

German Translate

lang.php
		<?php
$lang['fav_description']      = "Zeigt Ihre Lieblings-Seiten (meist besucht)";
$lang['fav_desact']           = "Favoriten-Erkennung ist deaktiviert.";
$lang['fav_activer']          = "Zum aktivieren hier klicken";
$lang['fav_cookies']          = "(Diese Erkennung ist cookie gesteuert)";
$lang['fav_visites']          = "Besuch(e)";
$lang['fav_reset']            = "Besuchszahl dieser Seite zurücksetzen";
$lang['fav_exclure']          = "Diese Seite von den Favoriten ausschließen.";
$lang['fav_voircacher']       = "Anzeigen/verstecken ausgeschlossener Seiten u. Konfiguration";
$lang['fav_inclure']          = "Diese Seite zu den Favoriten hinzufügen";
$lang['fav_rafraichir']       = "Atkualisieren (aktuelle Seite neu laden)";
$lang['fav_confirmation']     = "Möchten Sie die Favoriten-Erkennung wirklich deaktivieren?\\n(Ihre Favoriten-Liste wird gelöscht)";
$lang['fav_desactiver']       = "Deaktiviert Favoriten-Erkennung";
$lang['fav_pasencore']        = "Im Moment haben Sie noch keine Favoriten. Kontrollieren Sie ob Ihr Browser Cookies erlaubt oder warten Sie noch etwas.";
$lang['fav_flotter']          = "Um das Konfigurationsfenster zu öffnen doppelklicken Sie, oder bewegen Sie die Maus für 2 Sekunden nicht.";
$lang['fav_confResetAll']     = "Alle Besuchszahlen zurücksetzen?";
$lang['fav_resetall']         = "Setzt alle Besuchszahlen zurück";
$lang['fav_prec']             = "Kürzlich besucht";
$lang['fav_pfav']             = "Favoriten";
$lang['fav_config']           = "Konfiguration";
$lang['fav_afficher']         = "Zeige";
$lang['fav_conf_prec']        = "Kürzlich besuchte Seite(n)";
$lang['fav_conf_pfav']        = "Favoriten";
$lang['fav_sauver']           = "Speichern";
 
$lang['fav_snapnotfound']    = "Snap helper nicht gefunden!";
$lang['fav_pbsnap']          = "<b>SNAP:</b> Problem while snapping ";
$lang['fav_mosaique']        = "My favorites mosaic";

400 Bad Request error

Thanks for this excellent plugin! I've been using it for a couple years now. Today I created several deeply nested page (about 100 character long namespace strings) and after saving one, I couldn't access my wiki! I just got a “400 Bad Request - request header or cookie too large” error, regardless of which page I tried to load. When I deleted (only) the Favoris cookies I could access the site again. I guess that Favoris is overfilling the cookies and causing problems? If so, is it possible to insert an “overflow” check to prevent the error? I'm running the latest Favoris (2009-03-04) on Weatherwax and my browser is Firefox 24. Thanks! — Rik Blok 2013/10/21 03:35

Patch for a wiki farm setup

--- action.php.ORIG	2009-03-03 17:25:05.000000000 +0100
+++ action.php	2016-03-15 11:22:42.419287081 +0100
@@ -42,6 +42,8 @@
     function _update_cookie(&$event, $param) {
         global $INFO;
 
+	$cookieDir = empty($conf['cookiedir']) ? DOKU_REL : $conf['cookiedir'];
+
         if($event->data == 'snapfavoris') {
           $event->preventDefault();
         }
@@ -55,7 +57,7 @@
           //Si on ne souhaite pas suivre les favoris
           if ($fav['off']==1) {
             //On efface les eventuels cookies existants (sauf off)
-            foreach ($_COOKIE['favoris'] as $page => $cpt) if ($page != "off") setCookie("favoris[$page]", "", time()-3600, '/');
+            foreach ($_COOKIE['favoris'] as $page => $cpt) if ($page != "off") setCookie("favoris[$page]", "", time()-3600, $cookieDir, '', ($conf['securecookie'] && is_ssl()));
             return;
           }
 
@@ -64,7 +66,7 @@
             //On efface tous les cookies (y compris off)
             foreach ($_COOKIE['favoris'] as $page => $cpt) {
               list($cpt, $date)=explode(";",$cpt);
-              if ($cpt != "-1") setCookie("favoris[$page]", "", time()-3600, '/');
+              if ($cpt != "-1") setCookie("favoris[$page]", "", time()-3600, $cookieDir, '', ($conf['securecookie'] && is_ssl()));
             }
             return;
           }
@@ -82,7 +84,7 @@
         else $cpt=1;
 
         //On positionne le cookie
-        setCookie("favoris[".$INFO['id']."]","$cpt;".time(), time()+60*60*24*7, '/');
+	setCookie("favoris[".$INFO['id']."]","$cpt;".time(), time()+60*60*24*7, $cookieDir, '', ($conf['securecookie'] && is_ssl()));
     }