[Pmwiki-users] Spaces in file names

Dave Noonan PmWiki
Tue Feb 24 12:17:55 CST 2004


>> Q3. Is it possible to change the link delimiter? I.E. If I do [[File Name
>> with spaces.doc Text I want do display]] I a link to "File" with the text
>> "Name with spaces.doc Text I want do display". Maybe something like
[[File
>> Name with spaces.doc|Text I want do display]]?
>
>Spaces aren't valid in URLs, they have to be replaced with '+' or '%20'.
>So the syntax would be something like

I think PHP Wiki must have been hiding the space translation from me and
since it worked I never looked too closely. Regardless I can link to the
files with %20 in the name (not +) but I'd really like Attach because that's
what I want the users to see and because it keeps track of the group so I
don't have too.

>However, it would be possible to create a local customization such that
>
>Attach:"File Name with spaces.doc" and
>[[Attach:"File Name with spaces.doc" Text I want do display]]

Either of those would be lovely but they're not working for me. :)  See
below...

This bit is from your response to my earlier message:
> One could also possibly create a double brackets entry to use double
> quotes and convert the spaces within:
>
>    InterMap:"My Documents/path"
>
> The entry would look something like (untested):
>
>> $DoubleBrackets["/^\\bInterMap:\"$UrlPathPattern\"/e"] =
>>   "str_replace(' ','%20',"$0")";
>
>where you replace "InterMap" with the name of the InterMap link
>that you're wanting to do this conversion for.

I've changed the above to:

$DoubleBrackets["/^\\bAttach:\"$UrlPathPattern\"/e"] = "str_replace('
','%20',"$0")";

Which gets me a parse error on line 12 (the one shown above) followed by a
messages about the headers already having been sent.  I don't see anything
obviously wrong with it.  I tried a few small changes that should do the
same thing but I always get the parse error on that line.  When str_replace
was on the next line it gave me that line number as an error.
--
Dave
-----------------------
Nothing happens by itself... it all will come your way, once you understand
that you have to make it come your way, by your own exertions.
~ Ben Stein

________________________________________________
This mail was sent by UebiMiau 2.5




More information about the pmwiki-users mailing list