Overview: I have a single Joomla website that have various copies of the database tables all in the same database, but with different table prefixes.
Depending on which user is accessing the site, i need to alter which joomla table prefix is used in order to display the relevant tables.
This has to be site wide.
Problem: with a core code hack i can alter the prefix as needed, but would prefer this as a plugin.
With the plugin i can get the prefix, using $db->getPrefix(), and i can set an immediate instance of the connection using $db = JDatabaseDriver::getInstance( $option ). But this is not site wide and is overwritten by the standard $db = JFactory::getDbo().
So i need a system plugin that will replace every instance of a table prefix as it is run.