Include category table when needed

Intended to fix joomla/joomla-cms#5000 where banners with matched by tags don't display.