![]() |
|
How to print the bare contents of a textObject? - 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: How to print the bare contents of a textObject? (/thread-11830.html) |
How to print the bare contents of a textObject? - LondonLight.org - 2014-06-12 Hey I have some text in a .txt file which using class-textobject (or class-anyfile?) I treat as an image. How do I print the bare contents of this text file? I would like pure text returned, nothing else. Is this possible? How to print the bare contents of a textObject? - acrylian - 2014-06-12 You will have to use standard PHP function like How to print the bare contents of a textObject? - LondonLight.org - 2014-06-12 And one more question, is it possible to print just the image filename without anything else? Like getUnprotectedImageURL minus the paths and minus the extension. How to print the bare contents of a textObject? - LondonLight.org - 2014-06-12 Ooh thank you, I got it working! Though I don't know if what I did is either correct or efficient Is this the best way to do it? How to print the bare contents of a textObject? - LondonLight.org - 2014-06-12 I managed to get the full path without the extension using `` which returns How to print the bare contents of a textObject? - acrylian - 2014-06-12
How to print the bare contents of a textObject? - LondonLight.org - 2014-06-12 That one just removes "/zp". How to print the bare contents of a textObject? - acrylian - 2014-06-12 Try `WEBPATH.'/'.ALBUMFOLDER.'/'.$_zp_current_album->name'; How to print the bare contents of a textObject? - LondonLight.org - 2014-06-12 Success! How to print the bare contents of a textObject? - acrylian - 2014-06-12 Btw, of course How to print the bare contents of a textObject? - LondonLight.org - 2014-06-28 For anyone interested, the pathinfo and stripsuffix functions works great for getting parts of a path or filename! pathinfo returns an array consisting of dirname, basename and extension. To get the txt filename: You could shorten and merge the two: How to print the bare contents of a textObject? - acrylian - 2014-06-28 Isn't what I told above much easier to get the filename? For other parts of paths there are several path related constants like WEBPATH, ALBUMFOLDER etc. How to print the bare contents of a textObject? - LondonLight.org - 2014-06-28 I used the code you gave me above for some time, but once things started getting hairy I found this to be quicker to experiment with. Both have uses, hope this helps someone too |