Module:Tour history

-- NOT CURRENTLY USED, CAN PROBABLY BE DELETED

local p = {} local cargo = mw.ext.cargo

function p._list( artist, tour, year, noposter ) select_clause = "CONCAT(, shows.date, )=Date, " .. "shows.venue=Venue, shows.location=Location, " .. "IF(live_songs.name IS NULL, , )=Setlist, " .. "IF(live_show_photos._pageName IS NULL AND shows.poster IS NULL, , )=Photos, " .. "IF(live_banter._pageName IS NULL, , )=Banter"

if noposter ~= '' and noposter ~= nil then select_clause = 'CONCAT("")=Poster, ' .. select_clause end

where_conds = {} if artist and artist ~= '' then table.insert(where_conds, 'shows.artist = "' .. artist .. '"') end if tour and tour ~= '' then table.insert(where_conds, 'shows.tour = "' .. tour .. '"') end if year and year ~= '' then table.insert(where_conds, 'YEAR(shows.date) = ' .. year) end

local results = cargo.query(		'live_songs, shows, live_show_photos, live_banter',		select_clause,		{			where = mw.text.listToText( where_conds, ' AND ' ),			join = 'shows._pageName = live_songs._pageName, shows._pageName=live_show_photos._pageName, shows._pageName=live_banter._pageName',			groupBy = 'shows._pageName',			orderBy = 'shows.date ASC'		}	)

mw.logObject(results) end

return p