From: Reini U. <ru...@x-...> - 2005-07-21 18:49:36
|
Dan Frankowski schrieb: > By the way, I wanted to thank you for this post. I may not have time to > apply it to my wiki for awhile, but it seems aesthetically pleasing, and > I'd like to get to it eventually. I'll add that feature to the MonoBook theme then. split_pagename will have an theme hook then or be theme specific. Thanks, Garrett! > Garrett Baumgartner wrote: >> Well, no one deigned to reply to my earlier request for help, so I >> figured it out on my own. The answer is in "stdlib.php" in the wiki's >> "lib" directory and in "themeinfo.php" in the desired theme(s) in your >> "themes" directory. >> >> >> 1. In themeinfo.php, make sure "AutosplitWikiWords" is set to "True" >> (minus quotes). >> >> >> 2. In stdlib.php, do a search for "function split_pagename" (minus >> quotes). In version 1.3.10, which is what I'm using, this function >> starts on line 764 (assuming you don't have Word Wrap enabled). >> >> >> 3. Add the following two lines after the other three regular expressions. >> >> // Obliterate underscores in your wiki titles and links. >> $RE[] = '/(.)[_](.)/'; >> >> >> Now, whenever you have a page with an underscore in its name - such as >> "Foo_Bar" - it will be displayed as a space instead - "Foo Bar" - >> which makes your URLs a lot cleaner than having that stupid "%20" >> space escape code in them. Moreover, the underscores will also be >> converted to spaces in your displayed WikiLinks. >> >> Note also that this doesn't care in the least what comes before and >> after the underscore. A link or title encoded as >> "Spell_-_Really_Magic_Missiles" will be displayed as "Spell - Really >> Magic Missiles" despite the fact that the hyphen "-" isn't a capital >> letter. This makes it more versatile. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ http://phpwiki.org/ |