![]() |
|
replace spaces with underscores in albums url - 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: replace spaces with underscores in albums url (/thread-12916.html) |
replace spaces with underscores in albums url - stuartmiles - 2017-05-30 Hi Is there a way to replace the spaces in the urls with underscores. Where I have albums with more than one word there is a space (%20) in the url which is causing a problem with a place I am connecting to. For example http://freepixelz.com/Celebrations/Baby_Shower/bat1-05975.JPG instead of http://freepixelz.com/Celebrations/Baby%20Shower/bat1-05975.JPG Thanks Stuart replace spaces with underscores in albums url - acrylian - 2017-05-30 The seo_zenphoto plugin if enabled will clean album folder names and filenames if created respectively uploaded via the backend for standard ASCII chars which includes replacing spaces with dashes. Underscores are not replaced though as they are fine already. The seo_cleanup plugin allows doing this cleaning afterwards but since it uses above plugin underscores are not changed. You would have to create your own plugin version to change that. replace spaces with underscores in albums url - stuartmiles - 2017-05-30 Dashes is fine. I'll try that. If no more message it means it worked.... Many thanks! replace spaces with underscores in albums url - stuartmiles - 2017-06-02 Hi acrylian That worked fine on my test site but on my main site it failed, maybe due to timeout as I have 35,000 images. My image names are fine as they don't have spaces so it is only the albums that I need to fix so looks like I have to do it on the database. I see there is a field called 'folder' in the the 'albums' table which will need changing but is there anything else? how about the htaccess file or zenphoto-rewrite.txt file? Thanks for your help. Stuart replace spaces with underscores in albums url - stuartmiles - 2017-06-02 I tried changing one of the album records in the database from 'outer space' to 'outer-space' and after looking at the pages in the browser the database changed back to 'outer space' so I take it there must be something else to do. replace spaces with underscores in albums url - fretzl - 2017-06-02 Since Zenphoto is file system based you can't use the database to change (physical) file/folder names on the server. If you want to do this only once you could try to temporarily edit the file [i]zp-core/zp-extensions/seo_cleanup.php[/i] Comment(or remove) lines 109-133. You may still get a warning on the backend that the file has been changed. If so, run setup again. replace spaces with underscores in albums url - acrylian - 2017-06-02 @stuartmiles: Might have been a time out but you should look into your server PHP error log to be sure about that. It also could be a file/folder permissions issue or something else. We'll take a look to add a plugin option so you can at least choose to clean images and/or albums. replace spaces with underscores in albums url - stuartmiles - 2017-06-02 Hi fretzl and acrylian I started making copies of the folders then adding hyphens and just changing the album titles but the hosting went down so I quit for the day... I have decided to change to cloud hosting and will have to upload everything again so I think I will add hyphens to the folders before uploading which should be easier to sort out. I will still keep the hosting as a backup so will try running the cleanup file with those lines commented out. Thanks again for all of your help :-) replace spaces with underscores in albums url - acrylian - 2017-06-02 Note if you change the folder names without using those backend tools you might loose album data. If you for example entered titles, descriptions, added tags etc. after uploading those albums all will be gone as a new folder name means new album (same for images). Zenphoto matches the database to the file system not the other way round. If that is not a problem for you then fine of course. replace spaces with underscores in albums url - stuartmiles - 2017-06-03 I was duplicating the folder and adding dashes so it was treating it as a new album then I deleted the old so it worked out ok. Thanks Stuart replace spaces with underscores in albums url - acrylian - 2017-06-03 Okay, just that step wouldn't have been necessary as changing the folder name on the file sytems means new album for Zenphoto already. The only possible issue is data entered via the backend afterwards as that would get lost this way in any case. |