Revision [4624]
This is an old revision of KeepHistory made by ChristianBarthelemy on 2005-01-14 15:00:45.
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).
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:
- The system would add a line on top of the UserLogonHistory page with the name of the WikiPage and the timestamp
- The system would then remove all lines further to line X, X being the maximum number of links we want to keep in the history
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.
- Were you suggesting a separate table? What about keeping it as a single concatanated string in the wikkausers table? Then only have to add one cell, and the user could "set" the "length" on the {{UserSettings}} page (up to a maximum) and logging in (loading the usersetting page) could reduce the list to the last set number....and if it was re-set (using update settings) then could further parse the list to that length if the set number was shorter. That would require just keeping a single string with a divider (like "+") (could then just do a count on the divider to find out how many were there and "cut" the rest in the userpage part). The "add" code could just be made part of the header/footer code....if you want a linear sequence then that would just be concatenating the new page onto the old list with the concatenation happening when the user logged in....that would reduce processing when the header/footer was loaded. You could set it so that a navigation menu of the last ?? items was at the top as a ->homepage->pageindex->userpage->keephistory menu. I think this method would have the least server load.
- Thank you for your comments - I realize this proposal is likely to be a better way to get it. I will think about this.
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.
CategoryDevelopment