You are here

function _weather_get_first_valid_config in Weather 5

Same name and namespace in other branches
  1. 5.6 weather.module \_weather_get_first_valid_config()
  2. 6.5 weather.module \_weather_get_first_valid_config()

Return the first valid configuration or 1 if there is none

2 calls to _weather_get_first_valid_config()
weather_custom_block in ./weather.module
Show a configuration page for a custom weather block
weather_custom_block_form_submit in ./weather.module
Handle the submission of the custom weather block

File

./weather.module, line 597
Display <acronym title="METeorological Aerodrome Report">METAR</acronym> weather data from anywhere in the world

Code

function _weather_get_first_valid_config($uid) {
  $sql = 'SELECT cid FROM {weather_config} WHERE uid=%d ORDER BY weight ASC, real_name ASC';
  return max(db_result(db_query($sql, $uid)), 1);
}