Forums
This topic is locked
Images controlled by time of day
Posted 10 Oct 2002 02:13:53
1
has voted
10 Oct 2002 02:13:53 Randy Huitema posted:
Hi,I am looking for some code to show an image according to the time of day on a web server. Any help would be greatly appreciated.
Replies
Replied 10 Oct 2002 08:04:20
10 Oct 2002 08:04:20 Dave Clarke replied:
pure guesswork but try this
<% if TIME = 12:00:00 then %>
<img name="image.gif" border="0" src="folder/image.gif">
<% end if %>
ASP/VBScript/IIS5.1/WinXPPro & WinXPHome
<% if TIME = 12:00:00 then %>
<img name="image.gif" border="0" src="folder/image.gif">
<% end if %>
ASP/VBScript/IIS5.1/WinXPPro & WinXPHome
Replied 12 Oct 2002 20:59:25
12 Oct 2002 20:59:25 Randy Huitema replied:
Just wanted to post the code that I had some help to get running.
<%
Dim d : d = Time()
Dim Hours : Hours = DatePart("h",d)
Dim WDay : WDay = WeekDay(Date)
Dim ImageSource : ImageSource = "onairdefault.gif"
If Hours >= 5 AND Hours < 9 Then ImageSource = "daveandjacquie.gif"
If Hours >= 9 AND Hours < 14 Then ImageSource = "marklapointe.gif"
If Hours >= 14 AND Hours < 18 Then ImageSource = "chrisharding.gif"
If Hours >= 18 AND Hours < 23 Then ImageSource = "wendystevens.gif"
IF WDay = 7 AND Hours >= 0 AND Hours < 9 Then ImageSource = "onairdefault.gif"
IF WDay = 7 AND Hours >= 9 AND Hours < 12 Then ImageSource = "gordjohnson.gif"
IF WDay = 7 AND Hours >= 12 AND Hours < 24 Then ImageSource = "onairdefault.gif"
IF WDay = 1 AND Hours >= 0 AND Hours < 24 Then ImageSource = "onairdefault.gif"
%>
<%
Dim d : d = Time()
Dim Hours : Hours = DatePart("h",d)
Dim WDay : WDay = WeekDay(Date)
Dim ImageSource : ImageSource = "onairdefault.gif"
If Hours >= 5 AND Hours < 9 Then ImageSource = "daveandjacquie.gif"
If Hours >= 9 AND Hours < 14 Then ImageSource = "marklapointe.gif"
If Hours >= 14 AND Hours < 18 Then ImageSource = "chrisharding.gif"
If Hours >= 18 AND Hours < 23 Then ImageSource = "wendystevens.gif"
IF WDay = 7 AND Hours >= 0 AND Hours < 9 Then ImageSource = "onairdefault.gif"
IF WDay = 7 AND Hours >= 9 AND Hours < 12 Then ImageSource = "gordjohnson.gif"
IF WDay = 7 AND Hours >= 12 AND Hours < 24 Then ImageSource = "onairdefault.gif"
IF WDay = 1 AND Hours >= 0 AND Hours < 24 Then ImageSource = "onairdefault.gif"
%>
Replied 12 Oct 2002 21:03:57
12 Oct 2002 21:03:57 Dave Clarke replied:
thanks for posting that, will copy and save that if you dont mind<img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
Dave
ASP/VBScript/IIS5.1/WinXPPro & WinXPHome
Dave
ASP/VBScript/IIS5.1/WinXPPro & WinXPHome