mb2k01 Posted October 22, 2009 Posted October 22, 2009 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,
damien.deakes Posted October 22, 2009 Posted October 22, 2009 $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... 1
webman Posted October 22, 2009 Posted October 22, 2009 This should do - stick it in a blank HTML page. <!--<br /> // ***********************************************<br /> // AUTHOR: WWW.CGISCRIPT.NET, LLC<br /> // URL: http://www.cgiscript.net<br /> // Use the script, just leave this message intact.<br /> // Download your FREE CGI/Perl Scripts today!<br /> // ( http://www.cgiscript.net/scripts.htm )<br /> // ***********************************************<br /> <br /> function initArray() {<br /> this.length = initArray.arguments.length;<br /> for (var i = 0; i < this.length; i++)<br /> this[i+1] = initArray.arguments[i];<br /> }<br /> <br /> var weekDayArray = new;<br /> initArray("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");<br /> var today = new Date();<br /> var day = weekDayArray[today.getDay()+1];<br /> <br /> if (day == "Monday") window.location = "Monday.htm"<br /> if (day == "Tuesday") window.location = "Tuesday.htm"<br /> if (day == "Wednesday") window.location = "Wednesday.htm"<br /> if (day == "Thursday") window.location = "Thursday.htm"<br /> if (day == "Friday") window.location = "Friday.htm"<br /> if (day == "Saturday") window.location = "Saturday.htm"<br /> if (day == "Sunday") window.location = "Sunday.htm"<br /> //--><br /> Source: CGIScript.net :: Automate your website for less! 1
mb2k01 Posted October 22, 2009 Author Posted October 22, 2009 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!)
maniac Posted October 22, 2009 Posted October 22, 2009 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. Set WshShell = WScript.CreateObject("WScript.Shell") file = "C:\PATH\" & WeekDay(Now) & ".html" WshShell.Run file Mike. 1
powdarrmonkey Posted October 22, 2009 Posted October 22, 2009 mb2k01: Seen this? Xibo Open Source Digital Signage
maniac Posted October 22, 2009 Posted October 22, 2009 mb2k01: Seen this? Xibo Open Source Digital Signage That's what I'm using to run 4 screens at the moment, works like a charm Mike.
mb2k01 Posted October 22, 2009 Author Posted October 22, 2009 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. 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)
mb2k01 Posted October 22, 2009 Author Posted October 22, 2009 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)
srochford Posted October 22, 2009 Posted October 22, 2009 Ok; let's be really flash :-) (well, a little bit ...) 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 1
powdarrmonkey Posted October 22, 2009 Posted October 22, 2009 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).
maniac Posted October 22, 2009 Posted October 22, 2009 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.
TechMonkey Posted October 22, 2009 Posted October 22, 2009 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!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now