\r\n" ; $loc_id="SFXX0044"; // Pretoria, South Africa $partner_ID = ""; // weahter channel partner ID $license_key = ""; // weahter channel license key $units = "m"; // m for metric (C) // s for standard (F) $image_size = "64x64"; // the size of the forecast images (32x32 or 64x64 or 128x128) $length = 10; if (!($length >= 1 And $length <= 10)) $length = 10; $forecast_url = "http://xoap.weather.com/weather/local/$loc_id?cc=*&dayf=$length&prod=xoap&par=$partner_ID&key=$license_key&unit=$units"; $checkurl = $forecast_url; $xml_url = md5($checkurl); $ttl = 60*60; $cachefilename = "weather_cache/$xml_url"; if (0 == strcmp ( $_SERVER["HTTP_HOST"] , "www.pta.co.za" ) ) { // echo "finding weather_cache
[" . $cachefilename . "]
\r\n" ; if (file_exists($cachefilename)) { $url = $cachefilename; $fp = fopen($url,"r"); while (!feof ($fp)) { $xml .= fgets($fp, 4096); } fclose ($fp); } } else { // echo "testing weather_cache
\r\n" ; if (!file_exists ( "weather_cache" )) { // echo "creating weather_cache
\r\n" ; mkdir ( "weather_cache" , 0755 ) ; } // echo "finding weather_cache
[" . $cachefilename . "]
\r\n" ; if (file_exists($cachefilename) && (time() - $ttl < filemtime($cachefilename)) ) { // Read the cache file // ********************* $url = $cachefilename; $fp = fopen($url,"r"); while (!feof ($fp)) { $xml .= fgets($fp, 4096); } fclose ($fp); }else{ // refreash the cache file // ************************ $url = $forecast_url; $fp = fopen($url,"r"); while (!feof ($fp)) { $xml .= fgets($fp, 4096); } fclose ($fp); $fw = fopen($cachefilename, 'w'); fwrite($fw, $xml); fclose($fw); if (!unlink ( "ftp://pta.co.za:pretoria@www.pta.co.za/" . $cachefilename ) ) { // echo "Cannot Delete ftp file
\r\n" ; } $fw = fopen( "ftp://pta.co.za:pretoria@www.pta.co.za/" . $cachefilename, 'w'); if ($fw) { fwrite($fw, $xml); fclose($fw); } // else // { // // echo "Cannot ftp
\r\n" ; // } } } // echo "Create parser\r\n" ; $parser = xml_parser_create( ); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); xml_parse_into_struct($parser,$xml,$values,$index); xml_parser_free($parser); // echo "Fill vars\r\n" ; $city = htmlspecialchars($values[$index[dnam][0]][value]); $unit_temp = $values[$index[ut][0]][value]; $unit_speed = $values[$index[us][0]][value]; $unit_precip = $values[$index[up][0]][value]; $unit_pressure = $values[$index[ur][0]][value]; $sunrise = $values[$index[sunr][0]][value]; $sunset = $values[$index[suns][0]][value]; $timezone = $values[$index[tzone][0]][value]; $last_update = $values[$index[lsup][0]][value]; $curr_temp = $values[$index[tmp][0]][value]; $curr_flik = $values[$index[flik][0]][value]; $curr_text = $values[$index[t][0]][value]; $curr_icon = $values[$index[icon][0]][value]; $counter = 0; $row_counter = 2; $xml=""; ?> Pta Web...
 
|
|
|
|
|
 
Sign in Register Fax2Email Community Chatroom Forum
Q - Who uses Pta?
A - Businesses, home uses, school kids, elderly people - In many households children caught up to the internet much faster than their parents and computers and internet access is no longer expensive...
 
Q - How does the website navagation work for my adverts?
A - Each of our categories are designed and programmed to effect quick and dynamic navigation and will guide the internet user through to exactly where he/ she wants to go in seconds...
 
Q - How many advertisments per page will there be?
A - There will only be 3 adverts per page minimizing clutter and maximizing your exposure...
 
Q - Whats the cost?
A - With a selection of 26 sections to advertise under, our sections are divided into different price levels with different advantages to ensure you secure a spot on Pta.co.za - Contact us for more info
 
Q - What free services do you offer?
  • Free Dial up internet access
  • Free Email (1 box)
  • Free Fax2mail
  • Free Website (site builder)
  • Free web hosting (unlimited traffic (5mb)
 
   
 ADVERTISEMENT
 ADVERTISEMENT
 ADVERTISEMENT