Results 1 to 5 of 5

Thread: Need a script for my Joomla site to display a different HTML file each hour

  1. #1
    Join Date
    Sep 2010
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Need a script for my Joomla site to display a different HTML file each hour

    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.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I'm not sure about joomla, but here's some PHP for that:
    <?php include(date('dmH').'.html'); ?>
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. The Following User Says Thank You to djr33 For This Useful Post:

    Marcymarc (09-23-2010)

  4. #3
    Join Date
    Sep 2010
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

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

  5. #4
    Join Date
    Sep 2010
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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.
    Last edited by Marcymarc; 09-23-2010 at 08:37 AM.

  6. #5
    Join Date
    Sep 2010
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I managed to work it out...

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

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •