![]() |
|
Translating spaces in directories to URLs - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Translating spaces in directories to URLs (/thread-5884.html) |
Translating spaces in directories to URLs - skidmo - 2009-09-23 Hi. New ZP user but big fan. Very impressed with the product and tireless developers. Already have my list of tweaks to do, so I hope to be a more active member. So easiest question for the first post: Album name spaces translating to "%20" quickly make for a long ugly URL. I searched how to at least shrink this to ONE char. I was intrigued how spaces in filenames turned to "+", but spaces in album names turned to "%20". I tracked it down to the use of "rawurlencode" (in pathurlencode()) vs "urlencode". So I tried changing pathurlencode() to use "urlencode". This seem to cause most of my thumbnail images to show broken links. So my question is: Is this worthwhile to track down and fix? Do you know why this might break some things? Or does using "+" in URLs instead of "%20" just a bad idea. Using: Translating spaces in directories to URLs - acrylian - 2009-09-23 If you upload or create albums via the admin backend spaces are turned into "-" (using the SEO filter plugin). If you upload via ftp and name folders manually they are not touched as they are not created by Zenphoto. So if you upload via ftp you should name your files and folders using underscores or "-" instead of spaces first place. Also remember the album folder name/image file name is independed from the title you can set on the backend! This is actually no issue. Translating spaces in directories to URLs - sbillard - 2009-09-23 But if you wish to change this you should know that Zenphoto uses URL encoding provided by PHP which also needs to be supported by browsers. So, when an URL contains %20 in place of a space, the actual string that Zenphoto sees is the space, not the $20. Anything not following this pattern would require new handling functions throughout Zenphoto to do the to/from translations. This change is likely to be problematic as for sure you will miss some place that needs to be changed an thus will introduce a latent problem into the scripts. We developers have not considered the benifits of such a change worth the risks. Translating spaces in directories to URLs - skidmo - 2009-09-29 Malte: Yes, this is not an issue. This should have been entered as a feature/enhancement/tweak/other. I should have described my use case better: Stephen: I tried to track down the use of '+' as an alias for 'space' in URLs, and it looks a little too iffy for me. Seems like '+' in place of a 'space' should only be allowed in a query (after the first '?'). But browsers seem to support (by accident?) translating '+' as a 'space' when typed into the address bar or used in a link. Anyway, I think I found an acceptable solution for my needs:
Therefore:
|