Log in

View Full Version : Need a script for my Joomla site to display a different HTML file each hour.



Marcymarc
09-23-2010, 08:05 AM
Need a script for my Joomla site to display a different HTML file each hour.

I have many different HTML files sitting in my public_HTML webserver directory in the format of 092306.html, this file is 6am hour (24h time) 23rd of September. There's 24 different html files each day in this same format. I need some way of when the page is displayed in Joomla, it will display the correct HTML file for the actual time of the day.

I have been given this so far:
<?php include(date('dmH').'.html'); ?>

How would I insert this into one of the pages in Joomla so it will display the correct HTML file.

Marcymarc
09-23-2010, 08:39 AM
That's okay, I worked it out, save the line of PHP as a PHP file, install Jumi into Joomla, upload the PHP file, then add the following line only into one of the Articles.

{jumi [WirelessPlaylist.php]}

Only problem is that the server where my website is hosted is not in my country, so it picks up wrong time for me and displays the wrong HTML file.

How can I modify this script <?php include(date('mdH').'.html'); ?> so that the H (hour) part can be modified to add 10 hours to it.

Marcymarc
09-24-2010, 12:30 AM
I managed to work it out...

<?php date_default_timezone_set('Australia/Sydney');

include(date('mdH').'.html'); ?>