From: Michael D. <Michael.Davey@CodeRage.ORG> - 2005-01-29 14:03:26
|
Hi, I've made a couple of changes to my copy of the above files and wanted to share. tiki-index.php =========== * more user-friendly - now correctly returns "404 Not Found" error (in the HTTP headers) to the webclient when the page isn't found (use wget to see) - redirect if the page doesn't exist but exactly one similar page does. Example - Welcome doesn't exist, but WelcomeHere does: http://coderage.no-ip.info/tiki186/tiki-index.php?page=Welcome - provide suggestions and search box if there are multiple similar pages: http://coderage.no-ip.info/tiki186/tiki-index.php?page=Page - or no similar pages: http://coderage.no-ip.info/tiki186/tiki-index.php?page=test (yup, there is scope for further wording improvements in that last example) - change to the logic so that if a user is permitted to create pages, then they are given the opportunity. after you have visited the last URL, login as demo/demo: tiki-likepages.php ============= * more user friendly - same behavior for pages that exist: http://coderage.no-ip.info/tiki186/tiki-likepages.php?page=HomePage - suggestions for pages that don't exist: http://coderage.no-ip.info/tiki186/tiki-likepages.php?page=Page - or a friendly error: http://coderage.no-ip.info/tiki186/tiki-likepages.php?page=test Files changed: ========== tiki-likepages.php tiki-index.php templates/header.tpl templates/tiki-likepages.tpl New files: ======= templates/error404.tpl templates/tiki-include-horizsearch.tpl Possible problems ============== * I haven't escaped any of the variables I am using - need peer review to help identify and fix any possible security holes * Need help testing to ensure that the tiki-index redirect plays happily with Apache redirects (as used on tw.o and elsewhere) and aliased pages * Perhaps rather than changing the logic in error.tpl / error404.tpl to make it easier for normal users to create orphaned pages, tiki-editpage.php should be changed to make it impossible for normal users to create such pages? * I swapped the headtitle and page lines in header.tpl to allow the header title to be set independently of the contents of $page. Not sure whether that will cause problems elsewhere: < {if $page ne ''} : {$page|escape} < {elseif $headtitle} : {$headtitle} --- > {if $headtitle} : {$headtitle} > {elseif $page ne ''} : {$page|escape} Okay over to you - comments and feedback please. -- Michael |