[jonah] Re: Sun Rise / Set Problem
Ruben van der Steenhoven
ruben_donotspamme at webmeesters.net
Tue Apr 15 17:06:10 PDT 2003
I didn't do that in the config files. I just selected the nearest
airport in the Block options of the sunset block. (This was of some
help, because of your question i had to retrace my steps to find out
that i COULD change the location without bothering other Horde
components after all). Now i also tried some other locations like Mexico
and Amsterdam, but with all the same results.
I've added following code to the _content function of
jonah/lib/Block/sunrise.php to find the values i mentioned: (BTW: That
date format you mentioned is the tandard UNIX-internal date format.)
----------------BEGIN CODE FRAGMENT-------------------
function _content()
{
if (empty($this->_params['location'])) {
return _("No location is set.");
}
// Set the timezone variable, if available.
NLS::setTimeZone();
list($lat, $long) = explode(':', $this->_params['location']);
$rise = $this->calcSunset(time(), $lat, $long, false,
floor(date('Z') / 3600));
$set = $this->calcSunset(time(), $lat, $long, true,
floor(date('Z') / 3600));
+> $date = time();
+> $yday = date('z', $date);
+> $mon = date('n', $date);
+> $mday = date('j', $date);
+> $year = date('Y', $date);
+> $DST = date('I', $date);
+> $TZ = floor(date('Z') /3600);
$html = '<table width="100%" height="100%"><tr>';
+> $html .= 'Date: ' . $date;
+> $html .= '<br/>YDay: ' . $yday;
+> $html .= ' Mon: ' . $mon;
+> $html .= ' MDay: ' . $mday;
+> $html .= ' Year: ' . $year;
+> $html .= ' DST: ' . $DST;
+> $html .= ' TZ: ' . $TZ;
+> $html .= '<br/>Lat: ' . $lat;
+> $html .= ' Long: ' . $long;
+> $html .= '</tr><tr>';
$html .= '<td width="25%" align="center">';
$html .= Horde::img('sunrise/sunrise.gif', _("Sun Rise"));
$html .= '<br/>' . $rise;
$html .= '</td>';
$html .= '<td width="25%" align="center">';
$html .= Horde::img('sunrise/sunset.gif', _("Sun Set"));
$html .= '<br/>' . $set;
$html .= '</td>';
$html .= '</tr></table>';
return $html;
}
//http://www.zend.com/codex.php?id=135&single=1
function calcSunset($date, $latitude, $longitude, $sunset = true,
$timezone)
{
----------------END CODE FRAGMENT-------------------
Jeff Graves wrote:
> No I mean where in the config files do you enter those coordinates
> (date, lat, long, timezone)? I looked through mine and can't find
> anything that matches your syntax. How did you come up with that date
> (it doesn't look like any recognizable format)?
>
> Jeff Graves
> Customer Support Engineer
> Image Source, Inc.
> 10 Mill Street
> Bellingham, MA 02019
>
> jeff at image-src.com - Email
> 508.966.5200 X31 - Phone
> 508.966.5170 - Fax
>
> -----Original Message-----
> From: jonah-bounces at lists.horde.org
> [mailto:jonah-bounces at lists.horde.org]On Behalf Of Ruben van der
> Steenhoven
> Sent: Tuesday, April 15, 2003 5:06 AM
> To: jonah at lists.horde.org
> Subject: [jonah] Re: Sun Rise / Set Problem
>
>
> Hi Jeff,
>
> havent tried different coordinates yet, as i dont realy see how to set
> 'em without messing up my weather reports etcetera.
> This location is Volkel Airport in The Netherlands, Europe.
>
> Thanks
>
> Ruben.
>
> Jeff Graves wrote:
>
>>Have you tried different coordinates? Where is this set btw? Only
>>sunrise/sunset block I see is for the Horde portal.
>>
>>Jeff Graves
>>Customer Support Engineer
>>Image Source, Inc.
>>10 Mill Street
>>Bellingham, MA 02019
>>
>>jeff at image-src.com - Email
>>508.966.5200 X31 - Phone
>>508.966.5170 - Fax
>>
>>-----Original Message-----
>>From: jonah-bounces at lists.horde.org
>>[mailto:jonah-bounces at lists.horde.org]On Behalf Of Ruben van der
>>Steenhoven
>>Sent: Friday, April 11, 2003 4:21 AM
>>To: jonah at lists.horde.org
>>Subject: [jonah] Sun Rise / Set Problem
>>
>>
>>Hi,
>>
>>I use the CVS version of horde, but in the Sun Rise /Set panel, i
>>always
>>get 12:00:00 for SunRise and 00:00:00 for SunSet.
>>The input values for the function are:
>>
>>date = 1050048511
>>lat = 51.650
>>long = 5.700
>>Timezone = 2
>>
>>Anyone with a clue?
>>
>>
>>
>>--
>>Jonah mailing list
>>Frequently Asked Questions: http://horde.org/faq/
>>To unsubscribe, mail: jonah-unsubscribe at lists.horde.org
>>
>>
>
>
>
>
> --
> Jonah mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: jonah-unsubscribe at lists.horde.org
>
>
More information about the jonah
mailing list