By Glen Murray on Saturday, 23 August 2014
Posted in General Issues
Replies 15
Likes 0
Views 360
Votes 0
I'm trying to get a cookie set for the users avatar and username to be set when the user logs in. So far I've tried quite a few different methods. IE


$user = Foundry::user();
$fullname = $user->getName();
$avatar = $user->getAvatar( SOCIAL_AVATAR_MEDIUM );


During the login in process none of these seem to work, the username always comes back as SocialUser and the avatar comes back as a default location that isnt even usable as a image address.


http%3A%2F%2Fhttp://www.WEBSITEADDRESS.com%2Fmedia%2Fcom_easysocial%2Fdefaults%2Favatars%2Fuser%2Fmedium.png


As you can see the address that is being put out makes no sense.

I did also include


require_once( JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php' );


Thank you for any help you can provide
Hello Glen,

I am really sorry for the delay of this reply as it is a weekend for us here. Sorry but I am not really sure if I understand you here but how are you storing these data on the cookies? The code you posted above is the correct codes to retrieve the user's name and avatar.
·
Saturday, 23 August 2014 23:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok, the way im doing this is im running it through the login module that runs with joomla, im calling foundry like it said to do so, but it isnt pulling the individuals Name or Avatar. It pulls the strange generic avatar and it pulls SocialUser.

Im not really sure what else to do, or if there is an easier way to do it. I'm making the modifications to the user.php file under com_users/controllers

Any help would be appreciated.

Thank You
·
Sunday, 24 August 2014 00:10
·
0 Likes
·
0 Votes
·
0 Comments
·
What is the exact codes that you placed in your module?
·
Sunday, 24 August 2014 00:17
·
0 Likes
·
0 Votes
·
0 Comments
·

$user = Foundry::user();
$fullname = $user->getName();
$avatar = $user->getAvatar( SOCIAL_AVATAR_MEDIUM );


This is what im trying to use to get it done, I've attached my user.php which belongs under /components/com_users/controllers

I'm not sure if you can make any sense of what I might be doing wrong as I am fairly new to Joomla and EasySocial

Thank You for any help you can offer.
·
Sunday, 24 August 2014 00:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Glen,

How are you outputting the values? It should be


<?php echo $fullname; ?>
<img src="<?php echo $avatar;?>" />
·
Sunday, 24 August 2014 01:00
·
0 Likes
·
0 Votes
·
0 Comments
·

$user =& JFactory::getUser();
$fullname = $user->username;

setcookie("fullname",$fullname);


This should set the cookie "fullname" but all it sets is either nothing, or SocialUser

Thank You
·
Sunday, 24 August 2014 01:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Try to output the data first for debugging purposes rather than setting anything on the cookie. I can't really assist you on this because looking at your codes they are perfectly fine and there's nothing wrong with this.
·
Sunday, 24 August 2014 11:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Thats the thing, it all looks good too but its almost like from where im calling it, im calling it too soon. Or something along those lines, as in the system hasnt fully pulled the users credentials yet. I dont know where else i would put this information to pull what i need to when the log in happens.

Any further help would be greatly appreciated.

Thank You
·
Monday, 25 August 2014 23:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Glen,

If you could provide us with:

1. The site access
2. FTP access
3. Steps to reproduce this

I will be glad to be able to help you look into this. Do take note that we are helping you out of our own goodwill and please, do not expect us to help you out all the time as we always try our best to ensure that you get what you want but when there are just too many requests for assistance beyond our support scope, most of our development time would be sacrificed
·
Monday, 25 August 2014 23:59
·
0 Likes
·
0 Votes
·
0 Comments
·
Alright, let me see what kind of access i can provide you as most of what im developing is very sensitive.
·
Tuesday, 26 August 2014 00:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Sure, of course
·
Tuesday, 26 August 2014 00:21
·
0 Likes
·
0 Votes
·
0 Comments
·
To give full access i cant do, the only thing i can think to do would be to allow you to remote into my machine so i can watch what is being done. That is about the securest way i could think of if you where willing to help me out.

Thank You
·
Tuesday, 26 August 2014 22:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Glen,

Sure, add me up on Skype My skype id is marklee_777
·
Tuesday, 26 August 2014 23:23
·
0 Likes
·
0 Votes
·
0 Comments
·
I have added you and tried to reach out to you, but you have been away at each time.

Thank you
·
Thursday, 28 August 2014 21:08
·
0 Likes
·
0 Votes
·
0 Comments
·
Yeah, I am a little occupied this week
·
Friday, 29 August 2014 02:44
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post