The first thing is very important to accomplish such a features, is writing new modules by using XOOPS API without any hard-code.
e.g.: you should create a class for each table and use "XoopsObject" and "XoopsPersistableObjectHandler" classes for all access to your module tables and avoid using "global $xoopsDB"
Now i cannot find any module in xoops 255 that didnt use $xoopsDB (except userlog). you can search $xoopsDB in any module to find how many hard-code access it have.
when you create a class for each table (e.g. here: customers, crm_notes) and
define all needed functions to access database (It may be time consuming but the result is excellent) then sharing them between modules will be very easy using xoops_getmodulehandler.
from a long time ago module developers used profile and pm functionality so it is not a recent feature.
edit:
code example for class. e.g: mod_customers_customers table ( but i prefer to change it to mod_customers_info)
the standard for tables are mod_MODULENAME_TABLENAME
class CustomersCustomers extends XoopsObject
{
/**
* constructor
*/
public function __construct()
{
$this->initVar("cust_id", XOBJ_DTYPE_INT, null, false);
$this->initVar("cust_name", XOBJ_DTYPE_TXTBOX, null, false, 50);
$this->initVar("cust_address", XOBJ_DTYPE_TXTBOX, null, true, 255);
}
/**
* @param string $method
* @param array $args
*
* @return mixed
*/
public function __call($method, $args)
{
$arg = isset($args[0]) ? $args[0] : null;
return $this->getVar($method, $arg);
}
static function &getInstance()
{
static $instance = false;
if (!$instance) {
$instance = new CustomersCustomers();
}
return $instance;
}
// other functions here
}
class CustomersCustomersHandler extends XoopsPersistableObjectHandler
{
/**
* @param null|object $db
*/
public function __construct(&$db)
{
parent::__construct($db, "mod_customers_customers", 'CustomersCustomers', "cust_id", "cust_name");
}
// other functions here
}