[x] Navigation

[x] Languages

[x] Design
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.

[x] Downloads (Top)

A block that shows dynamic SERVER time
Fragen und Diskussionen zur aktuellen Version
Neues Thema eröffnen    Neue Antwort erstellen    Druckversion     Foren-Übersicht ›  HowTo & Allgemeine Fragen

Vorheriges Thema anzeigen :: Nächstes Thema anzeigen  
Autor Nachricht
raffe
Investigator
Investigator

Offline Offline
Dabei seit: Nov 22, 2006
Beiträge: 1

BeitragVerfasst am: 22.11.2006 15:54
Titel: A block that shows dynamic SERVER time

Sorry can no German schüchtern , so I write in English. I would like a block that shows a ticking clock that shows the time on

the SERVER. Like this:
www.javascriptkit.com/...time.shtml
or
www.dynamicdrive.com/d...altime.htm
or
www.developertutorials...0&vt=0

The only block I have found is "Clock and Calendar" (Calendar v3.0 for

Dragonfly CMS: block-Calendar.php) from

dragonflycms.org/Downl...d=386.html but I can only

get it to show the time on the client.

My last try I did like this.
1. I make a new block and in the "Content:" I write:
Array:
[align=center]<iframe src="iframes/time.htm" width="500" 
height="55" border="0" frameborder="0"></iframe>[/align]

2. In iframes/time.htm:
Array:
<html><HEAD>
<script language="JavaScript" src="/iframes/servertime.php"></script>
<script type="text/javascript">
<!-- Begin
var servertimeOBJ;
var myscriptTime;
// End -->
</script>
</HEAD>
<BODY><p align=center>
<script type="text/javascript">
<!-- Begin
document.write(servertimeOBJ)
// End -->
</script></p></body></html>

3. in /iframes/servertime.php:
Array:
<?php
error_reporting(0);
$mydate = date("U");
print "var servertimeOBJ=new Date(($mydate)*1000);";
?>

It works OK, I get something like this:
Wed Nov 22 21:42:48 UTC+0800 2006

But the time don't tick. I have tried to play with this in time.htm in

the head:
Array:
function newtime()
{
setTimeout(window.location.reload(), 1000) 
}

In in the body:
Array:
<script type="text/javascript">
<!-- Begin
document.write(servertimeOBJ)
newtime()
// End -->
</script>
But it don't work. Just reloads all the time and no time shows at all.

Any ideas?


raffe's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
xp/2/5.0.22/5.1.4/9.1.0.9 CVS
Nach oben
Benutzer-Profile anzeigen
Beiträge der letzten Zeit anzeigen:   
Neues Thema eröffnen    Neue Antwort erstellen    Druckversion    Foren-Übersicht ›  HowTo & Allgemeine Fragen
Seite 1 von 1
Alle Zeitangaben sind in GMT + 1 Stunden



Gehe zu:  


Du kannst keine Beiträge schreiben.
Du kannst auf Beiträge nicht antworten.
Du kannst Deine Beiträge nicht bearbeiten.
Du kannst Deine Beiträge nicht löschen.
Du kannst an Umfragen nicht mitmachen.
Du kannst keine Dateien anhängen.
Du kannst keine Dateien herunterladen.




Interactive software released under GNU GPL, Code Credits, Privacy Policy