Supose that you, I, have multiple text-files.
Would it be possible (with php?) in a HTML-block to write a programm that every day a other text file put in a page.
The name of the textfiles are for example A date-name.
In the HTML-Block should be a script that the date of "today" matched with the filename?
I hop that sombody can read or understand what I try to explain...
Greetz
Ps, happy xmas and a rich newyear
Ivan
I wonder if it is possible
Re: I wonder if it is possible
I guess this can be done with some php code in a UDT, using file-get-contents
Re: I wonder if it is possible
I was thinking in the same direction. (However the php file-get-contents is usable, but I have to think it over...
Meaning that it look (for me) complicated.
Thank You
Meaning that it look (for me) complicated.
Thank You
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: I wonder if it is possible
Technically it is not difficult.
There are however a number of steps.
Once you find the file, and verify it exists, it must be converted from 'whatever format' to HTML.
Is it Plain old text, HTML already encoded, markdown, XML....
i.e: From Text to HTML. can involve numerous minor sub-steps depending on the contents of the text file, and how you want it output. i.e: Newlines converted to <br/>.... or blank lines marking paragraphs, etc. Also entities must be converted and there may be more.
And you really don't want to do all of that processing for every request, so you probably want some kind of caching mechanism so that the processed output will be used for up to 24 hours till the date changes, forcing you to read the next file.
Though it's technically just an exercise in data conversion and formatting, and not overly complex it can take a while.
There are however a number of steps.
Once you find the file, and verify it exists, it must be converted from 'whatever format' to HTML.
Is it Plain old text, HTML already encoded, markdown, XML....
i.e: From Text to HTML. can involve numerous minor sub-steps depending on the contents of the text file, and how you want it output. i.e: Newlines converted to <br/>.... or blank lines marking paragraphs, etc. Also entities must be converted and there may be more.
And you really don't want to do all of that processing for every request, so you probably want some kind of caching mechanism so that the processed output will be used for up to 24 hours till the date changes, forcing you to read the next file.
Though it's technically just an exercise in data conversion and formatting, and not overly complex it can take a while.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: I wonder if it is possible
For the simplicity i would use simple tekst. blabla.txt
There is a book 365 pages, fot each pages, a file.
One page exitsts in 2 partes,
1. foreword, preface; => forword001.txt
2. The actual text; => text001.txt
Why? we have 365 days in a year. So from
forword.txt to ...forword200.txt .....and as last forword365.txt
text001.txt to....text200.txt .... and as last and text.txt365
Whey Is use this format of TextName? Not every yoer we heve the same number os days....
Ik hope I clarifies my Goal. If with this information leads to another (simplified) a script I would very much obliged.
Gteets,
Ivan
There is a book 365 pages, fot each pages, a file.
One page exitsts in 2 partes,
1. foreword, preface; => forword001.txt
2. The actual text; => text001.txt
Why? we have 365 days in a year. So from
forword.txt to ...forword200.txt .....and as last forword365.txt
text001.txt to....text200.txt .... and as last and text.txt365
Whey Is use this format of TextName? Not every yoer we heve the same number os days....
Ik hope I clarifies my Goal. If with this information leads to another (simplified) a script I would very much obliged.
Gteets,
Ivan
Re: I wonder if it is possible
There exists a module for something like that
http://dev.cmsmadesimple.org/projects/quotesms
Has an option {Quotes pickedby='day'} which should do what you want.
By the way - you should use better (more describing) titles for your topics so you will get the answer faster .
http://dev.cmsmadesimple.org/projects/quotesms
Has an option {Quotes pickedby='day'} which should do what you want.
By the way - you should use better (more describing) titles for your topics so you will get the answer faster .
Re: I wonder if it is possible
Thank you for both hints.
I'm sorry for the fuzzy discription.
I gonna try the suggestion.
And, I will give feedback.
Sincerely
Ivan FLO
I'm sorry for the fuzzy discription.
I gonna try the suggestion.
And, I will give feedback.
Sincerely
Ivan FLO