SELECT `id` FROM `#__affiliate_tracker_accounts` WHERE `user_id` = '[user_id]' AND `id` != '0' LIMIT 1
$cbUser = CBuser::getInstance($user_id, false);
$atid = $cbUser->replaceUserVars('[cb:userdata field="cb_refid" user="' . $user_id . '" /]');
Please Log in to join the conversation.
You should be using the getFields API to do this not forcing a single substitution parse. See the below for getFields API.$cbUser = CBuser::getInstance($user_id, false);
$atid = $cbUser->replaceUserVars('[cb:userdata field="cb_refid" user="' . $user_id . '" /]');
Please Log in to join the conversation.
$cbMyUser = CBuser::getMyInstance();
$MyId = $cbMyUser->getField( 'user_id', null, 'csv', 'none', 'profile' );
//print '<pre>' . htmlspecialchars(print_r($cbMyUser, true)) . '</pre>';
echo 'test:'.$MyId;
Please Log in to join the conversation.
$cbMyUser = CBuser::getMyInstance();
$MyId = $cbMyUser->getUserData()->getInt( 'id', 0 );
$cbMyUser = CBuser::getMyInstance();
$MyId = $cbMyUser->getUserData()->getInt( 'id', 0 );
$refid = $cbMyUser->getField( 'cb_refid' );
Please Log in to join the conversation.
$user_id = $action->string($user, '[var1_user_id]');
$cbUser = CBuser::getInstance($user_id, false);
$cbId = $cbUser->getUserData()->getInt( 'id', 0 );
$reffirstname = $cbUser->getUserData()->getString( 'firstname', '' );
$atid = $cbUser->getField( 'cb_refid' );
SELECT `id` FROM `#__affiliate_tracker_accounts` WHERE `user_id` = '[user_id]' AND `id` != '0' LIMIT 1
Please Log in to join the conversation.
Failing how? Sounds like you're just acting on a viewing users object so it's not going to return anything since their user id is always 0.Can you tell me what I miss here to have the display of the query field even if the viewer is not logged in ??
That's normal if you're trying to manage your database outside Joomla/CB as your database is setting an SQL mode. Run the below SQL then try again.Also trying to drop the column cb_refid gives the sql error : ERROR: Invalid default value for 'message_last_sent'
SET GLOBAL sql_mode = '';
Please Log in to join the conversation.