Keep the browsing history

It could be nice to have a simple way to follow all the WikiPages that we have been browsing over one or several sessions. It is not always obvious to retrieve quickly a WikiPage we opened a few minutes or hours ago.

I found a good idea to provide such a feature at http://www.wikini.net/wakka.php?wiki=HistoriqueNavigation. The author Jean-Marie Griess has an implementation at http://www.arkheia.com/wikini/wakka.php?wiki=PagePrincipale (even if it is in french, you can try browsing several pages and you will understand the principle). Searching a bit more, I found this feature from several WikiEngines under the nice name of BreadCrumbs. So apart Wikini, DokuWiki and others may provide similar functionality.

My solution

The solution here above is using cookies and I would prefer something not relying on cookies so that you can keep your history using different computers or using light clients or not cookie-enabled browsers. This could as well stored in a dedicated wikka table - yet I do not think we should overload Wikka Core with things that may not be useful for all.
So in the same way I did for UserMenus or ACLsWithUserGroups I would rather rely on WikiPage:

The principle would be:
- If you are logged as a registered user and
- If a WikiPage UserLogonHistory exists then each time you open a new WikiPage:

Dependancy

None.

The code

To be built. Should be very simple...
Maybe a handler would do. Instead of calling WikiPage, the system would call WikiPage/KeepHistory if the conditions are fulfilled.

How to use it?

- The user has first to create an history page and setup the ACLs as wished
- he could setup the number of pages he wants to keep in the history (or this could be a system parameter for all users)

To Do

Needs to be coded... The user should be allowed to delete his UserLogonHistory page if he wants.


Hi, I used $_SESSION to store my history-array in this Quick and Dirty approach:
  1. In wikka.php (around line 996 in "function Run", just after "$this->LogReferrer();") I've added
  2.                 $_SESSION["KeepHistory"][]=$this->tag;
                    $_SESSION["KeepHistory"]=array_unique($_SESSION["KeepHistory"]);
                    if( count($_SESSION["KeepHistory"]) >7 ) array_shift( $_SESSION["KeepHistory"] );

  3. In actions/footer.php (on line 3, just after "$this->FormOpen(...")
  4.     echo $this->Format( implode(" :: ",array_reverse($_SESSION["KeepHistory"]))."---\n" );

  5. To clear the history, I also added handlers/page/clearkeephistory.php
  6. <?php
            $_SESSION["KeepHistory"] = array();
            $this->Redirect($this->Href());
    ?>

    So just add "/clearkeephistory" at the end of an url to clear the list.
(Names still need to be changed to something a bit more sexy...)
my $0.02 -- OnegWR


CategoryDevelopmentHandlers
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki