GetDotted Domains

Viewing Thread:
"Urusei Machie"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Sat 18/11/06 at 21:41
Regular
Posts: 19,415
This is where I post problems and questions while I work on my Language/Travel website.

Link coming soon =)
Fri 24/11/06 at 15:28
Moderator
"Are you sure?"
Posts: 5,000
FWIW

I realise you're enjoying yourself... but sometimes it's not worth re-inventing the wheel.

I'm not totally sure what you are trying to achieve but a quick Google shows lots of 'time zone' clock scripts.

i.e. [URL]http://www.jsmadeeasy.com/javascripts/Clocks%20And%20Date/World%20Clock/index.htm[/URL]
Fri 24/11/06 at 15:31
Regular
"Devil in disguise"
Posts: 3,151
Machie wrote:
> %Time_Zones= (
> 'GMT' ='0',
> 'Zone 1' ='-12',
> 'Zone 2' ='-11',
> 'Zone 3' ='-10',
> etc
> );

>

Make sure you use Zone1 instead of Zone 1. Makes your calling urls a bit easier to handle then.

> I'll give it a try as soon as I finish this sandwich :D thanks
> Garin. Will it list the day correct? I mean if it's 11pm in the
> UK and someone wants the time in Russia will it change Friday to
> Saturday?

Yes it will. The text to print out is calculated after I've applied the time zone offset.
I should have mentioned, I changed the script to function off GMT as opposed to the server local time as well.
Fri 24/11/06 at 15:34
Regular
Posts: 19,415
Hmmm... wrote:
[URL]http://www.jsmadeeasy.com/javascripts/Clocks%20And%20Date/World%20Clock/index.htm[/URL]

This one relies on the users desktop clock being correct so it's not very accurate.

Hopefully if I can get the code to work, it'll be of great use to me. And hopefully the users of my website ^^ so it's worth it.
Fri 24/11/06 at 15:36
Regular
Posts: 19,415
Garin wrote:
> Make sure you use Zone1 instead of Zone 1. Makes your calling
> urls a bit easier to handle then.

Will do :D

> Yes it will. The text to print out is calculated after I've
> applied the time zone offset.
> I should have mentioned, I changed the script to function off
> GMT as opposed to the server local time as well.

Perfect! Just how I wanted it :-D 10 points Garin. Now to test it.
Fri 24/11/06 at 16:19
Regular
Posts: 19,415
okay so far it's not working :( I changed the path back to /usr/bin/perl.

here's the error log

[Fri Nov 24 16:11:12 2006] [error] [client 86.128.211.76] invalid CGI ref "/cgi-bin/textclock.cgi?zone=Singapore" in /home/bbvkwkhe/public_html/index.shtml

[Fri Nov 24 16:11:12 2006] [error] [client 86.128.211.76] invalid CGI ref "/cgi-bin/textclock.cgi?zone=NewYork" in /home/bbvkwkhe/public_html/index.shtml

[Fri Nov 24 16:11:08 2006] [error] [client 86.128.211.76] invalid CGI ref "/cgi-bin/textclock.cgi?zone=Singapore" in /home/bbvkwkhe/public_html/index.shtml

[Fri Nov 24 16:11:08 2006] [error] [client 86.128.211.76] invalid CGI ref "/cgi-bin/textclock.cgi?zone=NewYork" in /home/bbvkwkhe/public_html/index.shtml


Test Page

As you can see I tested calling the two of them at once on the page. I deleted the NY one and still got the same result. Hmm do you know what might be the invalid CGI reference?
Fri 24/11/06 at 16:24
Regular
Posts: 19,415
codes for index.shtml...

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content=" " />
<meta name="description" content=" " />
<title>Learn The Language</title>
</head>
<body text=#000000>

This is the time in Singapore;<br />

<!--#exec cgi="/cgi-bin/textclock.cgi?zone=Singapore"--><br />
</body>
</html>


and for textclock.cgi...

#!/usr/bin/perl

use CGI qw(:standard);

# Define Variables #

%Time_Zones= (
'GMT' => '0',
'NewYork' => '-5',
'Singapore' => '8',
);

$Display_Week_Day = '1';

$Display_Month = '0';

$Display_Month_Day = '0';

$Display_Year = '0';

$Display_Time = '1';

$Display_Time_Zone = '0';

$Standard_Time_Zone = 'EST';
$Daylight_Time_Zone = 'EDT';

$Display_Link = '0';

# Done
#

@Week_Days = ('Sunday','Monday',
'Tuesday','Wednesday',
'Thursday','Friday','Saturday');

@Months = ('January','February',
'March','April'
,'May','June','July',
'August','September','October'
,'November','December');

$query = new CGI;

if (($query->param('zone')) && ($Time_Zones{$query->param('zone')})) {
$current_zone=$query->param('zone');
} else {
$current_zone='GMT';
}
print "$current_zone\r\n";

print "Content-type: text/html\n\n";

if ($Display_Link != 0) {
print "<a href=\"http://www.scriptarchive.com/\">";
}

($Second,$Minute,$Hour,$Month_Day,
$Month,$Year,$Week_Day,$IsDST) = gmtime(time+($Time_Zones{$current_zone}*3600));

if ($IsDST == 1) {
$Time_Zone = $Daylight_Time_Zone;
}
else {
$Time_Zone = $Standard_Time_Zone;
}

if ($Second < 10) {
$Second = "0$Second";
}
if ($Minute < 10) {
$Minute = "0$Minute";
}
if ($Hour < 10) {
$Hour = "0$Hour";
}
if ($Month_Day < 10) {
$Month_Day = "0$Month_Day";
}
$Year += 1900;


if ($Display_Month != 0) {
print "$Months[$Month] ";
}

if ($Display_Month_Day != 0) {
print "$Month_Day";
if ($Display_Year != 0) {
print ", ";
}
}

if ($Display_Year != 0) {
print "$Year";
if ($Display_Time != 0) {
print " - ";
}
elsif ($Display_Time_Zone != 0) {
print " ";
}
}

if ($Display_Time != 0) {
print "$Hour\:$Minute\:$Second";
if ($Display_Time_Zone != 0) {
print " ";
}
}

if ($Display_Week_Day != 0) {
print " on $Week_Days[$Week_Day]";
}
if ($Display_Time_Zone != 0) {
print "$Time_Zone";
}

if ($Display_Link != 0) {
print "</a>";
}

exit;
Fri 24/11/06 at 16:26
Regular
Posts: 19,415
Would it be okay to get rid of this part?


$Standard_Time_Zone = 'EST';
$Daylight_Time_Zone = 'EDT';


Not sure if it's interupting the rest of the code. Does the index.shtml need to be 755 aswell?
Fri 24/11/06 at 16:40
Regular
"Devil in disguise"
Posts: 3,151
Hm..theres several reasons for that error

Instead of
<!--#exec cgi="/cgi-bin/textclock.cgi?zone=Singapore"-->

try...

<!--#include virtual="/cgi-bin/textclock.cgi?zone=Singapore"-->
Fri 24/11/06 at 16:45
Regular
Posts: 19,415
no luck I'm afraid :( I also changed it to NewYork instead of Singapore, same result.

Any other things it might be?
Fri 24/11/06 at 17:04
Regular
"Devil in disguise"
Posts: 3,151
Machie wrote:
> print "$current_zone\r\n";

Remove this line from the CGI script, left it in there by mistake.
Otherwise I've just tried this on my dataflame hosting and it works fine.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Everybody thinks I am an IT genius...
Nothing but admiration. I have been complimented on the church site that I manage through you and everybody thinks I am an IT genius. Your support is unquestionably outstanding.
Brian
Second to none...
So far the services you provide are second to none. Keep up the good work.
Andy

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre
Feedback Close Feedback

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.