2016-08-09 6 views
0

私は機能onUserAfterSave$isnewを使用していますが、Joomla 3.Xに登録されているユーザーの電話番号とアドレスは取得できません。私は名前、ユーザー名、電子メールのみを取得できますが、プロファイルからのデータは取得できません。Joomla 3 get profile

パブリック関数onUserAfterSave($ユーザー、$ isnew、:あなたは

jimport('joomla.user.helper'); 
$user = JFactory::getUser(); 
$userProfile = JUserHelper::getProfile($user->id); //Get userprofile data 
//You can get all the user input of profile data. If you want to get country of user use 
echo "Country :" . $userProfile->profile['country']; 

答えて

0

$ success、$ msg) { // die(print_r($ user)); IF($ isnew){ .............

 $pluginParams = new JRegistry($plugin->params); 

     $name   = $user['name']; 
     $name_usuario = $user['username']; 
     $email_user  = $user['email']; 
     $id_usuario  = $user['id']; 

jimport( 'joomla.user.helper')。

$ user = JFactory :: getUser();

$ userProfile = JUserHelper :: getProfile($ id_usuario);

//プロファイルデータのすべてのユーザー入力を取得できます。ユーザーの国を取得したい場合

$ user_phone = $ userProfile-> profile ['phone'];

$ user_address = $ userProfile-> profile ['address1'];

しかし、$ user_phoneと$ user_addressにはデータがありません... whats is error?ありがとうございました

0

アミット・レイ、

私は私のプラグインで使用

JUserHelperクラスを使用する必要があるユーザー・プロファイル・データにアクセスするには

関連する問題