+ Post New Thread
Results 1 to 14 of 14
Web Development Thread, If "Monday" open "Monday.htm", if "Tuesday" open "Tuesday.html" in Coding and Web Development; Hi All, I hope the strange title grabbed your attention - I wasn't very sure how to ask the question! ...
  1. #1
    mb2k01's Avatar
    Join Date
    Jan 2007
    Posts
    1,138
    Thank Post
    189
    Thanked 230 Times in 195 Posts
    Rep Power
    92

    If "Monday" open "Monday.htm", if "Tuesday" open "Tuesday.html"

    Hi All,

    I hope the strange title grabbed your attention - I wasn't very sure how to ask the question!

    Basically, I want to be able to boot up a computer and have it autostart a html page in kiosk mode (and I've managed to get that far!), but then for the html page to have some code in it which polls the computers date and redirects to a date-specific webpage.

    E.G.
    - Computer turns on and autostarts index.htm in kiosk mode (I can already do this)
    - index.htm has code which polls the computers date
    - the poll result then allows an automatic redirection from index.htm to monday.htm or tuesday.htm etc

    Do any of you ultra clever coders know a way of achieving this?

    Many thanks,

  2. #2

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    any language preference?

  3. Thanks to powdarrmonkey from:

    mb2k01 (22nd October 2009)

  4. #3
    damien.deakes's Avatar
    Join Date
    Sep 2007
    Location
    Doncaster
    Posts
    60
    Thank Post
    12
    Thanked 3 Times in 3 Posts
    Rep Power
    15
    Code:
    <?php
    
    $day = date("w");
    
    switch($day){
        case 0:
            include("sunday.php");
            break;
        case 1:
            include("monday.php");
            break;
        case 2:
            include("tuesday.php");
            break;
        case 3:
            include("wednesday.php");
            break;
        default:
            include("nodate.php");
            break;
    }
    ?>
    Like that? PHP that is...

  5. Thanks to damien.deakes from:

    mb2k01 (22nd October 2009)

  6. #4

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    640
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    This should do - stick it in a blank HTML page.

    Code:
    <SCRIPT LANGUAGE="Javascript"><!--
    // ***********************************************
    // AUTHOR: WWW.CGISCRIPT.NET, LLC
    // URL: http://www.cgiscript.net
    // Use the script, just leave this message intact.
    // Download your FREE CGI/Perl Scripts today!
    // ( http://www.cgiscript.net/scripts.htm )
    // ***********************************************
    
    function initArray() {
    	this.length = initArray.arguments.length;
    	for (var i = 0; i < this.length; i++)
    	this[i+1] = initArray.arguments[i];
    }
    
    var weekDayArray = new;
    initArray("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
    var today = new Date();
    var day = weekDayArray[today.getDay()+1];
    
    if (day == "Monday") window.location = "Monday.htm"
    if (day == "Tuesday") window.location = "Tuesday.htm"
    if (day == "Wednesday") window.location = "Wednesday.htm"
    if (day == "Thursday") window.location = "Thursday.htm"
    if (day == "Friday") window.location = "Friday.htm"
    if (day == "Saturday") window.location = "Saturday.htm"
    if (day == "Sunday") window.location = "Sunday.htm"
    //-->
    </SCRIPT>
    Source: CGIScript.net :: Automate your website for less!

  7. Thanks to webman from:

    mb2k01 (22nd October 2009)

  8. #5
    mb2k01's Avatar
    Join Date
    Jan 2007
    Posts
    1,138
    Thank Post
    189
    Thanked 230 Times in 195 Posts
    Rep Power
    92
    Wow that was a quick response - thank you all!
    Webman I'll give yours a go but it certainly looks like it will do the job - thanks!

    (For those keeping an eye on recent posts this is for my in-house digital signage solution - one day soon I'll upload some screenshots!)

  9. #6

    maniac's Avatar
    Join Date
    Feb 2007
    Location
    Kent
    Posts
    3,067
    Thank Post
    209
    Thanked 430 Times in 310 Posts
    Rep Power
    144
    Not sure if you can achieve this with HTML, but if you got the machine to run this little VBS script at startup, and named the files 2.html, 3.html, 4.html etc. (VBS returns Sunday as day 1) then it would open up the correct file on the correct day.

    Code:
    Set WshShell = WScript.CreateObject("WScript.Shell")
    
    file = "C:\PATH\" & WeekDay(Now) & ".html"
    
    WshShell.Run file
    Mike.

  10. Thanks to maniac from:

    mb2k01 (22nd October 2009)

  11. #7

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182

  12. #8

    maniac's Avatar
    Join Date
    Feb 2007
    Location
    Kent
    Posts
    3,067
    Thank Post
    209
    Thanked 430 Times in 310 Posts
    Rep Power
    144
    Quote Originally Posted by powdarrmonkey View Post
    That's what I'm using to run 4 screens at the moment, works like a charm

    Mike.

  13. #9
    mb2k01's Avatar
    Join Date
    Jan 2007
    Posts
    1,138
    Thank Post
    189
    Thanked 230 Times in 195 Posts
    Rep Power
    92
    Quote Originally Posted by maniac View Post
    Not sure if you can achieve this with HTML, but if you got the machine to run this little VBS script at startup, and named the files 2.html, 3.html, 4.html etc. (VBS returns Sunday as day 1) then it would open up the correct file on the correct day.

    Code:
    Set WshShell = WScript.CreateObject("WScript.Shell")
    
    file = "C:\PATH\" & WeekDay(Now) & ".html"
    
    WshShell.Run file
    Mike.
    That is actually probably a better idea for the digital signage screens - I'll give that a go
    (Webmans example will still be useful as I plan to "network" our digital signage and have available on Moodle)

  14. #10
    mb2k01's Avatar
    Join Date
    Jan 2007
    Posts
    1,138
    Thank Post
    189
    Thanked 230 Times in 195 Posts
    Rep Power
    92
    Quote Originally Posted by maniac View Post
    That's what I'm using to run 4 screens at the moment, works like a charm

    Mike.
    I did - infact I have residual error messages clogging up my win7 machine where I installed it as a test lol. It looked promising but wasn't as customisable as I wanted, so as I'd half produced my own I continued with that.

    Although it's blurred for anonymity the screenshot gives the idea! Large video section, scrolling daily messages and two advert areas.

    (Once it's finished 100% i'll make up a generic template and possibly make available if I can confirm all codes are free to distribute etc)
    Attached Images Attached Images

  15. #11

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,156
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124
    Ok; let's be really flash :-) (well, a little bit ...)
    Code:
    Set WshShell = WScript.CreateObject("WScript.Shell")
    file = "C:\PATH\" & weekdayname(WeekDay(Now)) & ".html"
    WshShell.Run file
    and then you can have "monday.html", "tuesday.html" etc

  16. Thanks to srochford from:

    mb2k01 (22nd October 2009)

  17. #12

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    Hmm, I just installed Xibo in ten minutes flat (having seen it but not played with it before), very impressive (we have our first sign going on the wall.. well, when somebody decides where).

  18. #13

    maniac's Avatar
    Join Date
    Feb 2007
    Location
    Kent
    Posts
    3,067
    Thank Post
    209
    Thanked 430 Times in 310 Posts
    Rep Power
    144
    This is a screen shot of one of our screens powered by Xibo, scrolling news across the bottom (RSS feed from BBC) 2 small areas and 1 large area for whatever content you want - Power point, text, images, web pages, flash objects - xibo will display them all.

    The key to making digital signage work is keeping it simple, and producing a good template to use for all the screens for consistancy.
    Attached Images Attached Images

  19. #14

    TechMonkey's Avatar
    Join Date
    Dec 2005
    Location
    South East
    Posts
    3,292
    Thank Post
    226
    Thanked 406 Times in 303 Posts
    Rep Power
    162
    Quote Originally Posted by powdarrmonkey View Post
    Hmm, I just installed Xibo in ten minutes flat (having seen it but not played with it before), very impressive (we have our first sign going on the wall.. well, when somebody decides where).
    Ha, same problem here. WE were going to do it over the summer but now there is uncertainty about where to install it or even what information will be displayed so on hold!

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 4
    Last Post: 18th November 2011, 03:36 PM
  2. Replies: 3
    Last Post: 11th September 2009, 09:01 AM
  3. Replies: 2
    Last Post: 11th August 2009, 11:08 AM
  4. "Error 403" & "Moved to here" message
    By tech_guy in forum Windows
    Replies: 4
    Last Post: 24th January 2008, 01:07 PM
  5. Replies: 6
    Last Post: 28th September 2006, 07:06 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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