![]() |
|
How to show text files? - 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 show text files? (/thread-2373.html) |
How to show text files? - Andis - 2008-03-09 Hi all. Thank You How to show text files? - acrylian - 2008-03-09 Seriously, why should an image gallery show text files? Why so complicated anyway, why don't you just put your texts into the image description field in the admin? That's what it's for. How to show text files? - trisweb - 2008-03-09 I also recommend using the image Description field, if it is a photo diary. One photo with as much text as you want under the description. If you want mostly text, try a text-oriented content management system such as Wordpress or Joomla. From there you can copy Zenphoto image URLs to use in your posts. How to show text files? - Andis - 2008-03-09 Well, my Photo Diary sometimes contain email-textfiles related to some galleries. To specify my problem, i added to functions.php How to show text files? - sbillard - 2008-03-09 So, you want to show text without an image? That is really not the intent of a software like zenphoto. If the text is supposed to be associated with an image, use the description field. If the description field is too small for you (a strange issue since it is limited only to what the database can store) then you could add to your theme to fetch a text file based, say, on the custom data field of an image. How to show text files? - Andis - 2008-03-09 It might not be zenphotos intent yet, but it is defintely mine. How to show text files? - trisweb - 2008-03-09 There are many reasons:
If you still want to continue, you're on your own unless someone else on the forums wants to help. We simply can't spend time implementing every feature people want for them. You'll have to do several things - you'll need a 'Text' class, or to modify the Image class, take care of reading the file from disk, and outputting its content. You'll also need to create database entries for each file you read, take care of sorting and ordering, figure out what thumbnail you want for text files to display in the theme, create new template functions to display the text, and more. Good luck. Or, http://www.wordpress.com will already do all this for you, because it's already designed for that. How to show text files? - Andis - 2008-03-09 Thank you for your answer. I am not sure about your last point, to create a db entry for each file. There is no entry for the video files as well. How to show text files? - jsumners - 2008-03-10 Aside from trying to use text as some sort of display object in an image/video gallery, the core of your problem would be formatting. If you just output regular text it will not look very good at all. In particular, line breaks would not be honored by the HTML renderer (the user's web browser). But, if you really want to do it, the simplest way to output text from a text file in-place would be this: ` ` How to show text files? - trisweb - 2008-03-10 Yep. I'm not sure where your iframe code is outputting, but you can just replace the iframe with whatever is in that code that jsumners gave, to output the text directly. It most likely will not be able to be "persistent in view to future zenphoto updates" since any files you edit would be overwritten on upgrade. You can keep track of your changes in some document, or keep your PHP functions in a separate file so you don't have to change as much in zenphoto. How to show text files? - Andis - 2008-03-10 I surely know how to read and output text via php. The main problem her is/was to filter the txt files while zenphoto goes through the albums. I just extended zenvideo [i]is_valid_video[/i] function with the txt an added the following into template-functions.php |