Ad Widget

Collapse

Patch: Timezone offset for Flashclock

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • freak
    Member
    • Oct 2007
    • 52

    #1

    Patch: Timezone offset for Flashclock

    On Screens, it is possible to add a clock (which is embedded as a flash movie).

    When I designed a screen to show various information concerning a specific country, I wanted to be able to add a timezone offset to the time value shown on the clock.

    This is basically possible because zbxclock.swf takes arguments like in this example:
    zbxclock.swf?analog=1&smooth=1&url=screenedit.php%3Fform%3Dupdate%26screenid%3D6%26s creenitemid%3D24%23form&timestamp=1194656674

    When you use zbxclock.swf to display the server's time, it will be given the timestamp argument containing the PHP time()-value to start counting on.
    I assume this is because the clock flash movie uses your system's clock ticks to count the seconds in the movie. So giving it the server-calculated time()-value as an offset, it will display the server's time plus every clocktick of your system.

    So timestamp could be used as an offset value. But:

    zbxclock.swf hasn't been designed to take an offset value.
    It expects a timestamp argument. If it gets one, it'll say "SERVER".
    So if one uses timestamp as only an offset to current local time, it thinks it should display "SERVER" as well.

    So zbxclock.swf should be modified to understand an offset value like this (pseudocode):
    IF offset <= 100000 // the maximum offset is at 14 hours=50400 seconds so just to make sure nothing goes wrong (daytime savings or something like that??), take 100000
    THEN say "LOCAL"
    ELSE say "SERVER"
    FI
    display time(offset) // display the time starting at offset, hence for 0, display 00h:00m:00s

    So since I don't have the zbxclock.fla (and neither do I have Flash), could someone make the change?

    Or am I making wrong presumptions? Lemme hear watcha think :

    Oh, I forgot to mention: I wasn't sure about what STYLE_HORISONTAL and STYLE_VERTICAL in trunk/frontends/php/screenedit.php:53 did so I just commented them out.
    Attached Files
    Last edited by freak; 10-11-2007, 16:02. Reason: forgot to mention..
  • freak
    Member
    • Oct 2007
    • 52

    #2
    clock.fla

    Okay, I actually just stumbled over misc/clock/clock.fla so the fla is available for modification.
    I still don't have flash so if maybe someone could modify it accordingly..

    Comment

    Working...