We train over 650 volunteers each summer, and instructors need a very quick way to update records. I made a form that only has the fields they need in a very sleek interface.
I also use JFactory::getDbo();
These functions I found on Joomlapolis:
Code:
function registerUser( $newuser ) {
global $_CB_framework, $_PLUGINS, $ueConfig;
$user = new \CB\Database\Table\UserTable();
foreach($newuser as $key=>$value) {
$user->set( $key, $value);
}
$user->store();
}
function editUser( $user, $update ) {
global $_CB_framework, $_PLUGINS, $ueConfig;
$oldUserComplete = new \CB\Database\Table\UserTable();
foreach($update as $key=>$value) {
$user->set( $key, $value);
}
$user->store();
}
I load JFactory:
Code:
define( '_JEXEC', 1 );
define( 'DS', DIRECTORY_SEPARATOR );
define( 'JPATH_BASE', '/home/metro/public_html' );
require_once( JPATH_BASE . DS . 'configuration.php');
global $_CB_framework, $mainframe;
require_once( JPATH_BASE . DS . 'includes' . DS . 'defines.php' );
require_once( JPATH_BASE . DS . 'includes' . DS . 'framework.php' );
require_once( JPATH_BASE . DS . 'libraries' . DS . 'joomla' . DS . 'factory.php' );
/*****************************************************************
Create the Application */
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
jimport('joomla.plugin.helper');
$user = JFactory::getUser();
/*****************************************************************
Load Community Builder */
include_once( JPATH_BASE . DS . 'administrator/components/com_comprofiler/plugin.foundation.php' );
cbimport( 'cb.database' );
$myId = $_CB_framework->myId();
$user =& CBuser::getUserDataInstance( $myId );
This also lets me use the native Joomla login function for ACL to this utility. It's the $user->store() that I thought would trigger the Update Logger, but now I see how that would not happen—it's the native JFactory user object, not a CBuser.
Does that help explain my situation better?