Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
function getMagazinFld($getFld, $thisFld, $ifFld, $ifValue) {
//first get the hikashop user id
Global $_CB_framework;
//$myId = $_CB_framework->myId();
//$cbUser =& CBuser::getInstance( $myId );
$displayedUser = $_CB_framework->displayedUser();
$cbUser =& CBuser::getInstance( $_CB_framework->displayedUser() );
if ( ! $cbUser ) {
$cbUser =& CBuser::getInstance( null );
}
$user =& $cbUser->getUserData();
$displayedUserCmsID = $user->user_id;
$db = JFactory::getDbo();
$cmsuser =& JFactory::getUser();
$userid = $cmsuser->get('id');
$query = $db->getQuery(true);
$query->select('user_id');
$query->from($db->quoteName('upr_hikashop_user'));
$query->where($db->quoteName('user_cms_id')." = ".$db->quote($displayedUserCmsID));
$db->setQuery($query);
$hikashopuserid = $db->loadResult();
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select($getFld);
$query->from($db->quoteName('upr_hikashop_user'));
$query->where($db->quoteName('user_id')." = ".$db->quote($hikashopuserid).' AND '.$db->quoteName($ifFld)." = ".$db->quote($ifValue));
$db->setQuery($query);
$fieldValue = print_r($db->loadResult(), true);
$returnFld = '<span class="'.$thisFld.' '.$getFld.'-'.$fieldValue.' '.$fieldValue.'">'.$fieldValue.'</span>';
return $returnFld.'';
}
Please Log in or Create an account to join the conversation.
Possibly with a Code action in CB Auto Actions acting on onBeforeUserProfileEditDisplay.Editing -- just had a thought -- would there be a way to "inject" a function or two into back end using a code field so it could be used by other code fields?
They would need to implement support for CB getFields API to output CB fields instead of their fields. We already support their fields via Code or Query field as it fits both API based and database based usages.End of the day, we'd LOVE if you and hika could get together sometime, at least to put an end to the double-user-profile situation ... I have to do UPDATES on every user profile save both in CB and Hika to get the things coordinated. Bit of a pain!
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.