[dev] weatherdotcom.php improvements

Rick Emery rick at emery.homelinux.net
Tue Jan 27 09:41:17 PST 2004


Attached is a patch making some improvements to
horde/lib/Block/weatherdotcom.php.

Thanks,
Rick

--
Rick Emery

"When once you have tasted flight, you will forever walk the Earth
 with your eyes turned skyward, for there you have been, and there
 you will always long to return"
                                              -- Leonardo Da Vinci
-------------- next part --------------
Index: weatherdotcom.php
===================================================================
RCS file: /repository/horde/lib/Block/weatherdotcom.php,v
retrieving revision 1.5
diff -u -r1.5 weatherdotcom.php
--- weatherdotcom.php	24 Jan 2004 23:32:05 -0000	1.5
+++ weatherdotcom.php	27 Jan 2004 17:35:48 -0000
@@ -93,8 +93,9 @@
             $weatherDotCom->setCache("file",
                 array("cache_dir" => ($cacheDir . '/')));
         }
-        $weatherDotCom->setUnitsFormat($this->_params['units']);
         $weatherDotCom->setDateTimeFormat("m.d.Y", "H:i");
+        $weatherDotCom->setUnitsFormat($this->_params['units']);
+        $units = $weatherDotCom->getUnitsFormat();
 
         // If the user entered a zip code for the location, no need to
         // search (weather.com accepts zip codes as location IDs).
@@ -115,7 +116,6 @@
         if (is_a($forecast, 'PEAR_Error')) {
             return $forecast->getmessage();
         }
-        $units = $weatherDotCom->getUnits(0, $this->_params['units']);
 
         // Location and local time.
         $html .= "<table width=100%><tr><td class=control>";
@@ -252,7 +252,8 @@
         $html .= '<table width=100%><tr>';
         $html .= '<td align=right class=control>';
         $html .= 'Weather data provided by ';
-        $html .= Horde::link('http://www.weather.com/?prod=xoap&par=PartnerID',
+        $html .= Horde::link('http://www.weather.com/?prod=xoap&par=' .
+            $weatherDotCom->_partnerID,
             'weather.com', '', '_blank', '', 'weather.com');
         $html .= '<i>weather.com</i>&reg; ';
         $html .= Horde::img('block/weatherdotcom/32x32/TWClogo_32px.png',


More information about the dev mailing list