- def next_banner()
- active_banners = {
- :sotmus2016 => {
- :id => 'sotmus2016',
- :alt => 'State of the Map US 2016',
- :link => 'http://stateofthemap.us/',
- :img => 'banners/sotmus-2016.jpg'
- },
- :sotm2016 => {
- :id => 'sotm2016',
- :alt => 'State of the Map 2016',
- :link => 'http://2016.stateofthemap.org/',
- :img => 'banners/sotm-2016.jpg'
- }
- }
-
- bannerKey = nil
- cookieKey = nil
- queuePos = 9999
-
- active_banners.each do |k, v|
- ckey = cookie_id(v[:id]).to_sym
+ def next_banner
+ banners = active_banners
+ banner_key = nil
+ cookie_key = nil
+ min_index = 9999
+ min_date = Date.new(9999, 1, 1)
+
+ banners.each do |k, v|
+ ckey = banner_cookie(v[:id]).to_sym