7 :alt => 'State of the Map US 2016',
8 :link => 'http://stateofthemap.us/',
9 :img => 'banners/sotmus-2016.jpg',
10 :enddate => '2016-jul-23'
14 :alt => 'State of the Map 2016',
15 :link => 'http://2016.stateofthemap.org/',
16 :img => 'banners/sotm-2016.jpg',
17 :enddate => '2016-sep-23'
23 all_banners().reject do |k,v|
25 parsed = (enddate and Date.parse enddate rescue nil)
26 parsed.is_a?(Date) and parsed.past?
30 # returns the least recently seen banner that is not hidden
32 banners = active_banners()
37 banners.each do |k, v|
38 ckey = cookie_id(v[:id]).to_sym
39 cval = cookies[ckey] || 0
40 next if cval == 'hide'
42 # rotate all banner queue positions
45 cookies[ckey] = index - 1
48 # pick banner with mininum queue position
57 cookies[cookieKey] = banners.length # bump to end of queue