SwissCenter is an open source project powered by Assembla

Assembla offers free public and private SVN/Git repositories and project hosting with bug/issue tracking and collaboration tools.

Commit 1656

User picture
  • Author: Pernod
  • 2011-11-25 01:16 (over 2 years ago)

Re-added the Weather option. Instead of using the weather.com API we now use a RSS feed from Yahoo Weather. This actually returns almost the same data that we used previously and is still provided by weather.com.

Refs #273

Files Affected

 
16551656
22
         .'<p></center>';
22
         .'<p></center>';
23
 
23
 
24
    $menu = new menu();
24
    $menu = new menu();
25
    $menu->add_item(str('WEATHER_BACK_TO_SEARCH'),'weather_city_list.php',true);
25
    $menu->add_item(str('WEATHER_BACK_TO_SEARCH'),'weather_city_list.php?hist='.PAGE_HISTORY_DELETE,true);
26
    $menu->display();
26
    $menu->display();
27
    page_footer("weather_cc.php");
27
    page_footer("weather_cc.php");
28
  }
28
  }
...
 
...
 
30
  {
30
  {
31
    // Single match, so redirect back to the main weather page, but passing the selected city as a parameter.
31
    // Single match, so redirect back to the main weather page, but passing the selected city as a parameter.
32
    $codes = array_keys($matches);
32
    $codes = array_keys($matches);
33
    header("Location: /weather_cc.php?loc=".$codes[0]);
33
    page_hist_pop();
 
 
34
    header("Location: /weather_cc.php?loc=".$codes[0]."&hist=".PAGE_HISTORY_DELETE);
34
  }
35
  }
35
  else
36
  else
36
  {
37
  {
37
    // More than one match was found, and the database was updated, so redirect the use back to the A-Z
38
    // More than one match was found, and the database was updated, so redirect the user back to the A-Z
38
    // city listings.
39
    // city listings.
39
    header("Location: /weather_city_list.php?search=".rawurlencode($city));
40
    header("Location: /weather_city_list.php?search=".rawurlencode($city)."&hist=".PAGE_HISTORY_DELETE);
40
  }
41
  }
41
 
42
 
42
/**************************************************************************************************
43
/**************************************************************************************************
16551656
84
        $menu->add_item( str('TFL') ,'tfl.php',true);
84
        $menu->add_item( str('TFL') ,'tfl.php',true);
85
 
85
 
86
    // Only display the weather options if an internet connection is active and the user has enabled weather support
86
    // Only display the weather options if an internet connection is active and the user has enabled weather support
87
//    if (internet_available() && get_sys_pref('weather_enabled','YES') == 'YES')
87
    if (internet_available() && get_sys_pref('weather_enabled','YES') == 'YES')
88
//      if ($image_menu)
88
      if ($image_menu)
89
//        $menu->add_image_item( str('VIEW_WEATHER') ,style_img('MENU_INTERNET_WEATHER',true),style_img('MENU_INTERNET_WEATHER_ON',true,false),'weather_cc.php');
89
        $menu->add_image_item( str('VIEW_WEATHER')
,style_img('MENU_INTERNET_WEATHER',true),style_img('MENU_INTERNET_WEATHER_ON',true,false),'weather_cc.php');
90
//      else
90
      else
91
//        $menu->add_item( str('VIEW_WEATHER') ,'weather_cc.php',true);
91
        $menu->add_item( str('VIEW_WEATHER') ,'weather_cc.php',true);
92
 
92
 
93
    /**
93
    /**
94
    * Display the page content
94
    * Display the page content
16551656
6274
        <version>1.19</version>
6274
        <version>1.19</version>
6275
      </string>
6275
      </string>
6276
      <string>
6276
      <string>
 
 
6277
        <id>WEATHER_SUNRISE</id>
 
 
6278
        <text>Sunrise</text>
 
 
6279
        <version>1.23.1</version>
 
 
6280
      </string>
 
 
6281
      <string>
 
 
6282
        <id>WEATHER_SUNSET</id>
 
 
6283
        <text>Sunset</text>
 
 
6284
        <version>1.23.1</version>
 
 
6285
      </string>
 
 
6286
      <string>
6277
        <id>WEATHER_UV</id>
6287
        <id>WEATHER_UV</id>
6278
        <text>UV index</text>
6288
        <text>UV index</text>
6279
        <version>1.19</version>
6289
        <version>1.19</version>
16551656
30
  {
30
  {
31
    if ($xml_elem['type'] == 'open')
31
    if ($xml_elem['type'] == 'open')
32
    {
32
    {
33
     if (array_key_exists('attributes',$xml_elem))
33
      if (array_key_exists('attributes',$xml_elem))
34
     {
34
      {
35
       @list($level[$xml_elem['level']],$extra) = array_values($xml_elem['attributes']);
35
        @list($level[$xml_elem['level']],$extra) = array_values($xml_elem['attributes']);
36
     }
36
      }
37
     else
37
      else
38
     {
38
      {
39
       $level[$xml_elem['level']] = $xml_elem['tag'];
39
        $level[$xml_elem['level']] = $xml_elem['tag'];
40
     }
40
      }
41
    }
41
    }
42
 
42
 
43
    if ($xml_elem['type'] == 'complete')
43
    if ($xml_elem['type'] == 'complete')
44
    {
44
    {
45
     $start_level = 1;
45
      $start_level = 1;
46
     $php_stmt = '$tree';
46
      $php_stmt = '$tree';
47
     while($start_level < $xml_elem['level'])
47
      while($start_level < $xml_elem['level'])
48
     {
48
      {
49
       $php_stmt .= '[$level['.$start_level.']]';
49
        $php_stmt .= '[$level['.$start_level.']]';
50
       $start_level++;
50
        $start_level++;
51
     }
51
      }
52
     $php_stmt .= '[$xml_elem[\'tag\']] = $xml_elem[\'value\'];';
52
      if (array_key_exists('attributes',$xml_elem))
53
     eval($php_stmt);
53
      {
 
 
54
        $php_stmt .= '[$xml_elem[\'tag\']][] = $xml_elem[\'attributes\'];';
 
 
55
      }
 
 
56
      else
 
 
57
      {
 
 
58
        $php_stmt .= '[$xml_elem[\'tag\']] = $xml_elem[\'value\'];';
 
 
59
      }
 
 
60
      eval($php_stmt);
54
    }
61
    }
55
  }
62
  }
56
  return array_shift($tree);
63
  return array_shift($tree);
...
 
...
 
107
}
114
}
108
 
115
 
109
//
116
//
 
 
117
// Returns a array of RSS data for the given location (from either the database or weather.com, according
 
 
118
// the the caching requirements).
 
 
119
//
 
 
120
 
 
 
121
function get_yahoo_xml( $loc, $type, $val )
 
 
122
{
 
 
123
  $units  = (get_user_pref("weather_units") == 'm') ? 'c' : 'f';
 
 
124
  $url    = 'http://xml.weather.yahoo.com/forecastrss/'.$loc.'_'.$units.'.xml';
 
 
125
  $xml    = db_value("select xml from weather where url='$url' and type='$type'");
 
 
126
 
 
 
127
  if (empty($xml))
 
 
128
  {
 
 
129
    send_to_log(4,"Fetching weather information from", $url);
 
 
130
    $xml       = file_get_contents($url);
 
 
131
    $data      = array("url"       => $url
 
 
132
                      ,"xml"       => $xml
 
 
133
                      ,"requested" => time()
 
 
134
                      ,"type"      => $type );
 
 
135
 
 
 
136
    if (!db_insert_row( "weather", $data))
 
 
137
      page_error(str('DATABASE_ERROR'));
 
 
138
  }
 
 
139
  $xml_array = xml2tree($xml);
 
 
140
  if (strpos($xml_array["title"], 'Error'))
 
 
141
    send_to_log(2,$xml_array["description"].': '.$url, $xml_array["item"]["title"]);
 
 
142
  else
 
 
143
  {
 
 
144
    $xml_array["head"]["ut"] = $xml_array["channel"]["yweather:units"][0]["temperature"];
 
 
145
    $xml_array["head"]["ud"] = $xml_array["channel"]["yweather:units"][0]["distance"];
 
 
146
    $xml_array["head"]["up"] = $xml_array["channel"]["yweather:units"][0]["pressure"];
 
 
147
    $xml_array["head"]["us"] = $xml_array["channel"]["yweather:units"][0]["speed"];
 
 
148
 
 
 
149
    $xml_array["cc"]["flik"]      = $xml_array["channel"]["yweather:wind"][0]["chill"];
 
 
150
    $xml_array["cc"]["wind"]["d"] = $xml_array["channel"]["yweather:wind"][0]["direction"];
 
 
151
    $xml_array["cc"]["wind"]["s"] = $xml_array["channel"]["yweather:wind"][0]["speed"];
 
 
152
    $xml_array["cc"]["wind"]["t"] = '';
 
 
153
    $xml_array["cc"]["hmid"]      = $xml_array["channel"]["yweather:atmosphere"][0]["humidity"];
 
 
154
    $xml_array["cc"]["vis"]       = $xml_array["channel"]["yweather:atmosphere"][0]["visibility"];
 
 
155
    $xml_array["cc"]["bar"]["r"]  = $xml_array["channel"]["yweather:atmosphere"][0]["pressure"];
 
 
156
    $xml_array["cc"]["sun"]["r"]  = $xml_array["channel"]["yweather:astronomy"][0]["sunrise"];
 
 
157
    $xml_array["cc"]["sun"]["s"]  = $xml_array["channel"]["yweather:astronomy"][0]["sunset"];
 
 
158
    $xml_array["cc"]["t"]         = $xml_array["channel"]["item"]["yweather:condition"][0]["text"];
 
 
159
    $xml_array["cc"]["icon"]      = $xml_array["channel"]["item"]["yweather:condition"][0]["code"];
 
 
160
    $xml_array["cc"]["tmp"]       = $xml_array["channel"]["item"]["yweather:condition"][0]["temp"];
 
 
161
    $xml_array["cc"]["lsup"]      = $xml_array["channel"]["item"]["yweather:condition"][0]["date"];
 
 
162
 
 
 
163
    for ($i=0; $i<5; $i++)
 
 
164
    {
 
 
165
      $xml_array["dayf"][$i]["day"]       =
$xml_array["channel"]["item"]["yweather:forecast"][$i]["day"];
 
 
166
      $xml_array["dayf"][$i]["date"]      =
$xml_array["channel"]["item"]["yweather:forecast"][$i]["date"];
 
 
167
      $xml_array["dayf"][$i]["low"]       =
$xml_array["channel"]["item"]["yweather:forecast"][$i]["low"];
 
 
168
      $xml_array["dayf"][$i]["hi"]        =
$xml_array["channel"]["item"]["yweather:forecast"][$i]["high"];
 
 
169
      $xml_array["dayf"][$i]["text"]      =
$xml_array["channel"]["item"]["yweather:forecast"][$i]["text"];
 
 
170
      $xml_array["dayf"][$i]["d"]["icon"] =
$xml_array["channel"]["item"]["yweather:forecast"][$i]["code"];
 
 
171
    }
 
 
172
  }
 
 
173
 
 
 
174
  return $xml_array;
 
 
175
}
 
 
176
 
 
 
177
//
110
// Returns the location ID for the user's home city. If none was defiend within the ini file
178
// Returns the location ID for the user's home city. If none was defiend within the ini file
111
// then Bracknell is returned.
179
// then Bracknell is returned.
112
//
180
//
16551656
5
 
5
 
6
  require_once( realpath(dirname(__FILE__).'/base/page.php'));
6
  require_once( realpath(dirname(__FILE__).'/base/page.php'));
7
  require_once( realpath(dirname(__FILE__).'/base/prefs.php'));
7
  require_once( realpath(dirname(__FILE__).'/base/prefs.php'));
8
  require_once( realpath(dirname(__FILE__).'/base/utils.php'));
 
 
9
  require_once( realpath(dirname(__FILE__).'/base/infotab.php'));
8
  require_once( realpath(dirname(__FILE__).'/base/infotab.php'));
10
  require_once( realpath(dirname(__FILE__).'/resources/info/weather.php'));
9
  require_once( realpath(dirname(__FILE__).'/resources/info/weather.php'));
11
 
10
 
...
 
...
 
38
 
37
 
39
  // Get XML data (from DB or from weather.com)
38
  // Get XML data (from DB or from weather.com)
40
  purge_weather();
39
  purge_weather();
41
  $xml_cc    = get_weather_xml( $loc_id, 'cc', '*');
40
  $xml_cc    = get_yahoo_xml( $loc_id, 'cc', '*');
42
  $time      = split(' ',$xml_cc["cc"]["lsup"]);
41
  $time      = split(' ',$xml_cc["cc"]["lsup"]);
 
 
42
  $title     = isset($xml_cc[$loc_id]["dnam"]) ? $xml_cc[$loc_id]["dnam"] :
$xml_cc["channel"]["yweather:location"][0]["city"].',
'.$xml_cc["channel"]["yweather:location"][0]["country"];
43
 
43
 
44
  // Build Current Conditions information table
44
  // Build Current Conditions information table
45
  $cc = new infotab();
45
  $cc = new infotab();
...
 
...
 
46
  $cc->add_item(str('WEATHER_FEELS_LIKE'), $xml_cc["cc"]["flik"].chr(176).$xml_cc["head"]["ut"]);
46
  $cc->add_item(str('WEATHER_FEELS_LIKE'), $xml_cc["cc"]["flik"].chr(176).$xml_cc["head"]["ut"]);
47
  $cc->add_item(str('WEATHER_HUMIDITY'),   $xml_cc["cc"]["hmid"].'%');
47
  $cc->add_item(str('WEATHER_HUMIDITY'),   $xml_cc["cc"]["hmid"].'%');
48
  $cc->add_item(str('WEATHER_PRESSURE'),   $xml_cc["cc"]["bar"]["r"].'
'.$xml_cc["head"]["up"]);
48
  $cc->add_item(str('WEATHER_PRESSURE'),   $xml_cc["cc"]["bar"]["r"].'
'.$xml_cc["head"]["up"]);
49
  $cc->add_item(str('WEATHER_WIND'),       $xml_cc["cc"]["wind"][s].' '.$xml_cc["head"]["us"].' '.$xml_cc["cc"]["wind"]["t"]);
49
  $cc->add_item(str('WEATHER_WIND'),       $xml_cc["cc"]["wind"]["s"].' '.$xml_cc["head"]["us"].' '.$xml_cc["cc"]["wind"]["t"]);
50
  $cc->add_item(str('WEATHER_VISIBILITY'), $xml_cc["cc"]["vis"].' '.$xml_cc["head"]["ud"]);
50
  $cc->add_item(str('WEATHER_VISIBILITY'), $xml_cc["cc"]["vis"].' '.$xml_cc["head"]["ud"]);
51
  $cc->add_item(str('WEATHER_UV'),         $xml_cc["cc"]["uv"][i].' ('.$xml_cc["cc"]["uv"]["t"].')');
51
  if (isset($xml_cc["cc"]["uv"]))
 
 
52
  {
 
 
53
    $cc->add_item(str('WEATHER_UV'),       $xml_cc["cc"]["uv"]["i"].' ('.$xml_cc["cc"]["uv"]["t"].')');
 
 
54
  }
 
 
55
  if (isset($xml_cc["cc"]["sun"]))
 
 
56
  {
 
 
57
    $cc->add_item(str('WEATHER_SUNRISE'),  $xml_cc["cc"]["sun"]["r"]);
 
 
58
    $cc->add_item(str('WEATHER_SUNSET'),   $xml_cc["cc"]["sun"]["s"]);
 
 
59
  }
52
 
60
 
53
  if ( $xml_cc["cc"]["icon"] == '-')
61
  if ( $xml_cc["cc"]["icon"] == '-')
54
  {
62
  {
...
 
...
 
61
  $menu->add_item(str('WEATHER_LOCATION'),'weather_city_list.php',true);
69
  $menu->add_item(str('WEATHER_LOCATION'),'weather_city_list.php',true);
62
 
70
 
63
  // Display Weather Icon and statistics
71
  // Display Weather Icon and statistics
64
  page_header($xml_cc[$loc_id]["dnam"],'');
72
  page_header($title);
65
 
73
 
66
  echo '<table cellspacing=0 border=0 cellpadding=0 width="100%">
74
  echo '<table cellspacing=0 border=0 cellpadding=0 width="100%">
67
          <tr>
75
          <tr>
...
 
...
 
81
            <td width="'.convert_x(640).'">';
89
            <td width="'.convert_x(640).'">';
82
              $menu->display(1, 560);
90
              $menu->display(1, 560);
83
  echo '    </td>
91
  echo '    </td>
84
            <td align="center" valign="top"><a href="'.weather_link().'">'.img_gen(SC_LOCATION.'/weather/logo.gif',130,130,false,false,'RESIZE').'</a></td>
92
            <td align="center" valign="top">'.img_gen(SC_LOCATION.'/weather/logo.gif',130,130,false,false,'RESIZE').'</td>
85
          </tr>
93
          </tr>
86
        </table>';
94
        </table>';
87
 
95
 
88
  if ( get_user_pref("weather_units") == 'm')
96
  if ( get_user_pref("weather_units") == 'm')
89
    $buttons[] = array('text'=>str('WEATHER_IMPERIAL'), 'url'=>'weather_cc.php?loc='.$loc_id.'&units=s' );
97
    $buttons[] = array('text'=>str('WEATHER_IMPERIAL'), 'url'=>'weather_cc.php?loc='.$loc_id.'&units=s&hist='.PAGE_HISTORY_REPLACE );
90
  else
98
  else
91
    $buttons[] = array('text'=>str('WEATHER_METRIC'), 'url'=>'weather_cc.php?loc='.$loc_id.'&units=m' );
99
    $buttons[] = array('text'=>str('WEATHER_METRIC'), 'url'=>'weather_cc.php?loc='.$loc_id.'&units=m&hist='.PAGE_HISTORY_REPLACE );
92
 
100
 
93
  page_footer('index.php?submenu=internet', $buttons);
101
  page_footer(page_hist_previous(), $buttons);
94
 
102
 
95
/**************************************************************************************************
103
/**************************************************************************************************
96
                                               End of file
104
                                               End of file
16551656
19
    show_picker( $this_url.'?any='.$prefix.'&search=', $search);
19
    show_picker( $this_url.'?any='.$prefix.'&search=', $search);
20
    echo '</td><td valign=top>';
20
    echo '</td><td valign=top>';
21
 
21
 
22
    if ( ($data = db_toarray("select name from cities where name like '".$prefix.str_replace("_","\_",$search)."%' order by 1 limit ".(($page*MAX_PER_PAGE)).",".MAX_PER_PAGE)) === false)
22
    if ( ($data = db_toarray("select name from cities where name like '".$prefix.str_replace('_','\_',$search)."%' order by 1 limit ".(($page*MAX_PER_PAGE)).",".MAX_PER_PAGE)) === false)
23
      echo $errmsg;
23
      echo $errmsg;
24
 
24
 
25
    $num_rows = db_value("select count(name) from cities where name like '".$prefix.str_replace("_","\_",$search)."%' ",$errmsg);
25
    $num_rows = db_value("select count(name) from cities where name like '".$prefix.str_replace('_','\_',$search)."%' ",$errmsg);
26
 
26
 
27
    if (empty($data))
27
    if (empty($data))
28
    {
28
    {
...
 
...
 
31
              , '<font
color="'.style_value("PAGE_TITLE_COLOUR",'#FFFFFF').'">'.str('WEATHER_CHANNEL').'</font>&#x
27;).'<p>';
31
              , '<font
color="'.style_value("PAGE_TITLE_COLOUR",'#FFFFFF').'">'.str('WEATHER_CHANNEL').'</font>&#x
27;).'<p>';
32
 
32
 
33
      $menu->add_item( str('SEARCH_YES'),'city_selected.php?name='.rawurlencode($search),true);
33
      $menu->add_item( str('SEARCH_YES'),'city_selected.php?name='.rawurlencode($search),true);
34
      $menu->add_item( str('SEARCH_NO'),$this_url.'?sort='.$sort.'&any='.$prefix,true);
34
      $menu->add_item( str('SEARCH_NO'),$this_url.'?any='.$prefix.'&hist='.PAGE_HISTORY_REPLACE,true);
35
      $menu->display( 1,480 );
35
      $menu->display( 1,480 );
36
 
36
 
37
    }
37
    }
...
 
...
 
54
    echo '</td></tr></table>';
54
    echo '</td></tr></table>';
55
 
55
 
56
    // Output ABC buttons if appropriate
56
    // Output ABC buttons if appropriate
57
 
57
    $buttons = array();
58
    if (empty($prefix))
58
    if (empty($prefix))
59
      $buttons[] = array('id'=>'A', 'text'=>str('SEARCH_ANYWHERE'), 'url'=>$this_url.'?sort='.$sort.'&search='.rawurlencode($search).'&any=%' );
59
      $buttons[] = array('id'=>'A', 'text'=>str('SEARCH_ANYWHERE'), 'url'=>$this_url.'?search='.rawurlencode($search).'&any=%&hist='.PAGE_HISTORY_REPLACE );
60
    else
60
    else
61
      $buttons[] = array('id'=>'A', 'text'=>str('SEARCH_START'), 'url'=>$this_url.'?sort='.$sort.'&search='.rawurlencode($search).'&any=' );
61
      $buttons[] = array('id'=>'A', 'text'=>str('SEARCH_START'), 'url'=>$this_url.'?search='.rawurlencode($search).'&any=&hist='.PAGE_HISTORY_REPLACE );
62
 
62
 
63
    $buttons[] = array('id'=>'B', 'text'=>str('SEARCH_CLEAR'), 'url'=>$this_url.'?sort='.$sort.'&any='.$prefix);
63
    $buttons[] = array('id'=>'B', 'text'=>str('SEARCH_CLEAR'), 'url'=>$this_url.'?any='.$prefix.'&hist='.PAGE_HISTORY_REPLACE );
64
 
64
 
65
    page_footer('weather_cc.php', $buttons);
65
    page_footer(page_hist_previous(), $buttons);
66
  }
66
  }
67
 
67
 
68
//*************************************************************************************************
68
//*************************************************************************************************
16551656
4
 *************************************************************************************************/
4
 *************************************************************************************************/
5
 
5
 
6
  require_once( realpath(dirname(__FILE__).'/base/page.php'));
6
  require_once( realpath(dirname(__FILE__).'/base/page.php'));
7
  require_once( realpath(dirname(__FILE__).'/base/utils.php'));
 
 
8
  require_once( realpath(dirname(__FILE__).'/base/prefs.php'));
7
  require_once( realpath(dirname(__FILE__).'/base/prefs.php'));
9
  require_once( realpath(dirname(__FILE__).'/base/infotab.php'));
8
  require_once( realpath(dirname(__FILE__).'/base/infotab.php'));
10
  require_once( realpath(dirname(__FILE__).'/resources/info/weather.php'));
9
  require_once( realpath(dirname(__FILE__).'/resources/info/weather.php'));
...
 
...
 
18
 
17
 
19
  // Get XML data (from DB or from weather.com)
18
  // Get XML data (from DB or from weather.com)
20
  purge_weather();
19
  purge_weather();
21
  $xml_fc    = get_weather_xml( $loc_id, 'dayf', '5');
20
  $xml_fc    = get_yahoo_xml( $loc_id, 'dayf', '5');
22
 
 
 
23
  $time      = split(' ',$xml_fc["dayf"]["lsup"]);
21
  $time      = split(' ',$xml_fc["dayf"]["lsup"]);
 
 
22
  $title     = isset($xml_fc[$loc_id]["dnam"]) ? $xml_fc[$loc_id]["dnam"] :
$xml_fc["channel"]["yweather:location"][0]["city"].',
'.$xml_fc["channel"]["yweather:location"][0]["country"];
24
 
23
 
25
  // Display Weather Icon and statistics
24
  // Display Weather Icon and statistics
26
  page_header($xml_fc[$loc_id]["dnam"],'');
25
  page_header($title);
27
 
26
 
28
  $menu = new menu();
27
  $menu = new menu();
29
  $menu->add_item( str('WEATHER_CURRENT') ,'weather_cc.php?loc='.$loc_id);
28
  $menu->add_item( str('WEATHER_CURRENT') ,page_hist_previous());
30
 
29
 
31
  echo '<table border=0 cellspacing=0 cellpadding=0 width="100%">
30
  echo '<table border=0 cellspacing=0 cellpadding=0 width="100%">
32
          <tr>';
31
          <tr>';
...
 
...
 
56
    echo '<td><center><font color="'.style_value("PAGE_TITLE_COLOUR").'"
size="4">'.$day.'</font><p>'
55
    echo '<td><center><font color="'.style_value("PAGE_TITLE_COLOUR").'"
size="4">'.$day.'</font><p>'
57
        
.img_gen(SC_LOCATION.'/weather/large/'.$xml_fc["dayf"][$i]["d"]["icon"].'.gif',100,130,false,false,'RESIZ
E').'<br>';
56
        
.img_gen(SC_LOCATION.'/weather/large/'.$xml_fc["dayf"][$i]["d"]["icon"].'.gif',100,130,false,false,'RESIZ
E').'<br>';
58
          $fc->display( 1,100);
57
          $fc->display( 1,100);
59
    echo  img_gen(SC_LOCATION.'/weather/large/'.$xml_fc["dayf"][$i]["n"]["icon"].'.gif',100,130,false,false,'RESIZE').'<br>
58
    if (isset($xml_fc["dayf"][$i]["n"]["icon"]))
60
          </center><p></td>';
59
      echo  img_gen(SC_LOCATION.'/weather/large/'.$xml_fc["dayf"][$i]["n"]["icon"].'.gif',100,130,false,false,'RESIZE').'<br>
 
 
60
            </center><p></td>';
61
  }
61
  }
62
 
62
 
63
  echo '  </tr>
63
  echo '  </tr>
...
 
...
 
67
            <td width="'.convert_x(640).'">';
67
            <td width="'.convert_x(640).'">';
68
              $menu->display( 1,560);
68
              $menu->display( 1,560);
69
  echo '    </td>
69
  echo '    </td>
70
            <td align="center" valign="bottom"><a href="'.weather_link().'">'.img_gen(SC_LOCATION.'/weather/logo.gif',130,130,false,false,'RESIZE').'</a></td>
70
            <td align="center" valign="bottom">'.img_gen(SC_LOCATION.'/weather/logo.gif',130,130,false,false,'RESIZE').'</td>
71
          </tr>
71
          </tr>
72
        </table>';
72
        </table>';
73
 
73
 
...
 
...
 
75
  // Display ABC buttons as necessary
75
  // Display ABC buttons as necessary
76
  //
76
  //
77
  if (get_user_pref("weather_units") == 'm')
77
  if (get_user_pref("weather_units") == 'm')
78
    $buttons[] = array('id'=>'A', 'text'=>str('WEATHER_IMPERIAL'),
'url'=>'weather_fc.php?units=s&loc='.$loc_id );
78
    $buttons[] = array('id'=>'A', 'text'=>str('WEATHER_IMPERIAL'), 'url'=>'weather_fc.php?units=s&loc='.$loc_id.'&hist='.PAGE_HISTORY_REPLACE );
79
  else
79
  else
80
    $buttons[] = array('id'=>'A', 'text'=>str('WEATHER_METRIC'),
'url'=>'weather_fc.php?units=m&loc='.$loc_id );
80
    $buttons[] = array('id'=>'A', 'text'=>str('WEATHER_METRIC'), 'url'=>'weather_fc.php?units=m&loc='.$loc_id.'&hist='.PAGE_HISTORY_REPLACE );
81
 
81
 
82
  page_footer('weather_cc.php?loc='.$loc_id, $buttons);
82
  page_footer(page_hist_previous(), $buttons);
83
 
83
 
84
/**************************************************************************************************
84
/**************************************************************************************************
85
                                               End of file
85
                                               End of file