I wonder if it is possible

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
Ivanflo
Forum Members
Forum Members
Posts: 61
Joined: Mon Sep 26, 2016 5:42 am

I wonder if it is possible

Post by Ivanflo »

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
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: I wonder if it is possible

Post by Jos »

I guess this can be done with some php code in a UDT, using file-get-contents
Ivanflo
Forum Members
Forum Members
Posts: 61
Joined: Mon Sep 26, 2016 5:42 am

Re: I wonder if it is possible

Post by Ivanflo »

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
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: I wonder if it is possible

Post by calguy1000 »

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.
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.
Ivanflo
Forum Members
Forum Members
Posts: 61
Joined: Mon Sep 26, 2016 5:42 am

Re: I wonder if it is possible

Post by Ivanflo »

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
chandra

Re: I wonder if it is possible

Post by chandra »

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 ;).
Ivanflo
Forum Members
Forum Members
Posts: 61
Joined: Mon Sep 26, 2016 5:42 am

Re: I wonder if it is possible

Post by Ivanflo »

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
Locked

Return to “[locked] Installation, Setup and Upgrade”