Show online time in the chat

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • In GTChat 0.93 the following code must be inserted into data.html before the line </body>, in the previous chat versions into messages.html before the line </head>. Then the user can see the time he was online in the status bar of his browser.

    <script type="text/javascript">
    function setOnlineTime()
    {
    window.setTimeout("setOnlineTime()",1000);
    now = new Date();
    diff = Math.floor((now.getTime()-starttime)/1000);
    hours = Math.floor(diff/3600);
    mins = Math.floor(diff/60) % 60;
    secs = diff % 60;
    if (hours < 10)
    hours = "0"+hours;
    if (mins < 10)
    mins = "0"+mins;
    if (secs < 10)
    secs = "0"+secs;

    window.status = "Online time: " + hours + ":" + mins + ":" + secs;
    }

    now = new Date();
    starttime = now.getTime();
    window.setTimeout("setOnlineTime()",1000);
    </script>

    750 mal gelesen