You are here

function _weather_get_first_valid_config in Weather 5.6

Same name and namespace in other branches
  1. 5 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

1 call to _weather_get_first_valid_config()
weather_custom_block in ./weather.module
Show a configuration page for a custom weather block

File

./weather.module, line 931
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);
}