From: Garrett B. <bau...@ho...> - 2005-07-03 04:04:59
|
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. Garrett Baumgartner |
From: Dan F. <dfr...@cs...> - 2005-07-20 15:30:50
|
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. Dan 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. > > > Garrett Baumgartner > > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > Phpwiki-talk mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwiki-talk |
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/ |