![]() |
|
Space in Album name Causing Error - 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: Space in Album name Causing Error (/thread-11647.html) |
Space in Album name Causing Error - n20capri2 - 2014-02-20 Displaying a random image from an .alb album inside a folder with spaces in the name... Here is the code I'm using: ` <?php $randomImage = getRandomImagesAlbum("My Dog Nucci/nucci.alb"); $randomImageURL = getURL($randomImage); print "getTitle()."'><img src='".$randomImage->getSizedImage('200')."' alt='".$randomImage->getTitle()."' />"; ?> ` You can see My Dog Nucci has spaces...The error I'm getting is: Fatal error: Call to a member function getAlbumName() on a non-object in /zp-core/template-functions.php on line 3670 If I replace that folder with another one w/o the space in the name it works perfectly. I can't change the folder name so is there another way to get it to read the folder correctly via the code above? My%20dog%20Nucci doesn't work either... Just upgraded to 1.4.5.9 and I'm noticing this problem...not sure if it was there before... Thanks Space in Album name Causing Error - acrylian - 2014-02-20 I cannot answer offhand but although spaces should work I would recommend to not use them (as with special chars). `My-dog-Nucci` looks far better than `My%20dog%20Nucci` anyway :-) Space in Album name Causing Error - n20capri2 - 2014-02-20 I agree but I have images from that gallery linked around and if I change the folder name they all get broken. I thought I had this happen before and I fixed it but I can't for the life of me figure out what I did. haha Space in Album name Causing Error - acrylian - 2014-02-20 The linking issue is a valid concern of course. Maybe try the direct object model with `$randomImage->getFullImageURL()` instead of `getURL($randomImage)`. (Funny side info: I had to look up if `getURL()` is one of ours actually, I think I never used it myself…:-)). Space in Album name Causing Error - n20capri2 - 2014-02-24 Can't seem to get that to work either...Oh well...Lesson learned lol |