Results 1 to 11 of 11

Thread: Anybody want the scripts for my time display?

  1. #1

    Thread Starter
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Anybody want the scripts for my time display?

    You'll need an ASP host to run it on
    Mark
    -------------------

  2. #2

    Thread Starter
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Oh well,

    Looks like the answer is "no"
    Mark
    -------------------

  3. #3
    Junior Member ghost ryder's Avatar
    Join Date
    Jan 2001
    Location
    granite city, ach!
    Posts
    17
    not sure if i have an asp host, but ill have em anyways
    lyrical terrorism propaganda assassin

  4. #4
    Member EternalKnight's Avatar
    Join Date
    Apr 2001
    Posts
    53
    I'm sure interested in how you do it, and I have an ASP host :-D If you could send it to me, would be greatly appreciated.

  5. #5

    Thread Starter
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    okey doke!
    I'll knock up some instructions...
    Mark
    -------------------

  6. #6
    Hyperactive Member barrk's Avatar
    Join Date
    Sep 2000
    Location
    My own little world
    Posts
    274
    I already have them. Thank you very much!!!!!!!!!!!!! *smooch*

  7. #7

    Thread Starter
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    OK
    Here it is:

    localtime.asp
    usage:
    localtime.asp?offset=< number of minutes>
    in your VBWorld profile put


    Code:
    <%@ Language=VBScript %>
    <%
    Dim offset
    Dim t
    Dim strPath
    strPath = 'http:// url To your image directory
    offset=request("offset")
    t = dateadd("n",offset,time())
    response.redirect strPath & hour(t) & "_" & minute(t) & ".gif"
    %>
    servertime.asp
    this file just returns the current time at the server to make it easier to calculate the required offset
    Code:
    <%@ Language=VBScript %> 
    <% 
    response.write "The current time On this server is: " & time() 
    %>
    settime.asp
    this file calculates the offset for you
    it may or may not work
    Code:
    <%@ Language=VBScript %>
    <html>
    <script language='javascript'>
    var sh =<%=hour(time())%>;
    var sm = <%=minute(time())%>;
    var now = New Date();
    var ch = now.getHours()
    var cm = now.getMinutes()
    var min=((ch-sh) * 60) + (cm - sm)
    document.write("Use this URL:<BR>");
    document.write("<b><b>")
    </script>
    I used 1440 small gif images, one for each minute of the day.
    These have the file name of the format <hour>_<minutes>.gif
    Eg: 1_10.gif

    I created these using this VB code:
    Code:
    Private Sub Command1_Click()
    Dim i As Integer
    Dim j As Integer
    Dim f As String
    For i = 0 To 23
     For j = 0 To 59
     
      Picture1.Cls
      f = i & "_" & j & ".bmp"
      Picture1.Print Format(i, "00") & ":" & Format(j, "00")
     
      SavePicture Picture1.Image, "c:\time\" & f
     
     Next j
    Next i
     
    End Sub
     
    Private Sub Form_Load()
    Picture1.AutoRedraw = True
    Picture1.FontTransparent = False
    End Sub
    I then converted then all from bmp to gif using the batch conversion facility in Paint Shop Pro 5
    I then FTPed them all to the server
    I had to use a different server because my ASP host won't allow direct linking of images.

    For the days it's basically the same:
    localday.asp

    Code:
    <%@ Language=VBScript %>
    <%
    Dim offset
    Dim t
    Dim strPath
    strPath = "http://url of your images
    offset=request("offset")
    t = dateadd("n",offset,now())
    response.redirect strPath & "DAY_" & weekday(t)  &".GIF"
     
    %>
    the vb to create the images:
    Code:
    Private Sub Command1_Click()
    Dim i As Integer
    Dim f As String
    For i = 1 To 7
     
     
      Picture1.Cls
      f = "day_" & i & ".bmp"
      Picture1.Print Format(i, "dddd")
     
      SavePicture Picture1.Image, App.Path & "\" & f
    Next i
     
    End Sub
    Private Sub Form_Load()
    Picture1.AutoRedraw = True
    Picture1.FontTransparent = False
    End Sub
    Have fun!
    Mark
    -------------------

  8. #8
    Fanatic Member InvisibleDuncan's Avatar
    Join Date
    May 2001
    Location
    Eating jam.
    Posts
    819
    Hey, who needs an ASP host when they can steal Mark's?

    What do you think: does it suit me?
    Indecisiveness is the key to flexibility.

    www.mangojacks.com

  9. #9
    Hyperactive Member thinktank2's Avatar
    Join Date
    Nov 2001
    Location
    Arctic
    Posts
    272

    Thumbs up

    Originally posted by Mark Sreeves
    OK
    Here it is:
    ....
    I then converted then all from bmp to gif using the batch conversion facility in Paint Shop Pro 5
    I then FTPed them all to the server
    I had to use a different server because my ASP host won't allow direct linking of images.
    ...
    Have fun!
    CHEERS !!! mark..though I choose to use it in another website.

  10. #10

    Thread Starter
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Originally posted by InvisibleDuncan
    Hey, who needs an ASP host when they can steal Mark's?

    What do you think: does it suit me?
    I hope it doesn't break the server

    I think I'll have to put a hit counter in the scripts to see just how mant times they are being called.


    Originally posted by thinktank2
    CHEERS !!! mark..though I choose to use it in another website.
    PLEASE DO!
    Mark
    -------------------

  11. #11

    Thread Starter
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    I put some logging in my scripts and I'm getting about 100 hits per hour at the moment.

    This figure will probably go through the roof when Katie wakes up
    Mark
    -------------------

Posting Permissions

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



Click Here to Expand Forum to Full Width