From: Dan F <dfr...@cs...> - 2004-02-23 19:59:13
|
Folks, Congrats on PhpWiki. Very cool. Below is a patch to PageTrail for 'ignorereloads'. That is, if you reload the page, that duplicate page doesn't enter into the trail. The patch is against 1.3.7, but I think applies to the current CVS snapshot as well (I took a peek). I would think one would want 'ignorereloads' on by default, but I left it false for backward compatibility. Dan -- Dan Frankowski dfr...@cs... % cvs diff -bu PageTrail.php Index: PageTrail.php =================================================================== RCS file: /project/Grouplens/cvs-repository/phpwiki/lib/plugin/PageTrail.php,v retrieving revision 1.1.1.1 diff -b -u -r1.1.1.1 PageTrail.php --- PageTrail.php 29 Jan 2004 14:30:28 -0000 1.1.1.1 +++ PageTrail.php 23 Feb 2004 18:32:59 -0000 @@ -57,6 +57,7 @@ function getDefaultArguments() { return array('numberlinks' => $this->def_numberlinks, 'invisible' => false, + 'ignorereloads' => false ); } @@ -71,7 +72,10 @@ $thispage = $request->getArg('pagename'); $thiscookie = $request->cookies->get("Wiki_PageTrail"); $Pages = explode(':', $thiscookie); + $lastpage = $Pages[0]; + if (!$ignorereloads || ($thispage != $lastpage)) { array_unshift($Pages, $thispage); + } $request->cookies->set("Wiki_PageTrail", implode(':', $Pages)); if (! $invisible) { |