|
Re: [pmwiki] Re: broken wiki links on home page fer an instalaltion: msg#00113web.wiki.pmwiki.user
On Thu, Jun 19, 2003 at 12:27:24AM +0200, Bernhard.Weichel@xxxxxxxxxxx wrote: > > There is UrlFmt, but at many places, the url syntax is hardwired. So what > about to provide a function that does the url formatting. [...] > This function should generate appropriate urls such that it would never be > necessary to write in a php script things like > <a href='\$ScriptUrl?action=search&text=\$Title_'>\$Title</a> >one couuld write instead > <a href='".FormatUrl($Group.$Title, "search", > "text=\$Title_")."'>\$Title</a> Eek, that's liable to scare a few people off--I much prefer the syntax of the first string than the one with the function call embedded in it (this is why I created FmtPageName in the first place). Plus, the problem with the function call approach is that the function gets called when the string is being stored into a variable, whereas we really need to have the substitutions performed when the variable is being output (i.e., when we know the actual page names and values that need to be substituted). However, I think the hardwired url syntax only presents a problem when $ScriptUrl is being followed by a pagename that goes into PATH_INFO. Thus, the query string you gave in the example above isn't really a problem, but it would be for something like <a href='$PageUrl?action=diff'>Diff</a> and <a href='$ScriptUrl/$Group/$Title_?action=diff'>Diff</a> So, I have an alternate solution. Instead of creating another special function call to replace what FmtPageName is trying to do in the first place, I've simply modified FmtPageName to allow some last-minute rewriting of any string containing '$ScriptUrl/' to put the pagename component into QUERY_STRING instead of PATH_INFO and fix any other query parameters appropriately. By default pmwiki.php does the same as it always has--putting page names into PATH_INFO. To have PmWiki use query strings instead of PATH_INFO, set $EnablePathInfo = 0; in local.php. This is now in pmwiki-0.5.4 (just released). At the moment the code for converting '$ScriptUrl/' is hardwired in FmtPageName. If someone needs the conversion itself to be customizable, I can arrange it. Finally, note that very little of the URL syntax is actually "hardwired". I think there's only two places (in pmwiki.php:HandleDiff and upload.php:FmtAttachLink) where the URL syntax is currently fixed by the code--all of the other URLs are controlled by configurable variables. However, I'll grant that reassigning all of those variables could be a pain to manage, which is why I've gone the $ScriptUrl/ replacement route. :-) Pm |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: printable-page: 00113, Giles Williams |
|---|---|
| Next by Date: | Re: [pmwiki] Re: broken wiki links on home page fer an instalaltion: 00113, Bernhard.Weichel@xxxxxxxxxxx |
| Previous by Thread: | Re: [pmwiki] Re: broken wiki links on home page fer an instalaltioni: 00113, Bernhard.Weichel@xxxxxxxxxxx |
| Next by Thread: | Re: [pmwiki] Re: broken wiki links on home page fer an instalaltion: 00113, Bernhard.Weichel@xxxxxxxxxxx |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |