By Marcus Palmer on Monday, 28 July 2014
Replies 6
Likes 0
Views 1.2K
Votes 0
I built a simple module to just call joomla user info and show a user within a control panel style page, i'm trying to do the same with EasySocial and get rid of the current module as i've now setup EasySocial for registration and would like to call basic user info and show on frontend.

Something like:

<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
$user = JFactory::getUser();

if (!$user->control-panel) {
echo 'You are logged in as:<br>';
echo '<b>User name</b>: ' . $user->username . '</br>';
echo '<b>Real name</b>: ' . $user->name . '<p></p>';
echo '<b>Email</b>: ' . $user->email . '<br>';
echo '<b>User ID</b> : ' . $user->id . '<br>';




}


?>
Hello Marcus,

EasySocial takes a very similar approach to this. You can access the user's info via,


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

$user = Foundry::user();

echo $user->getName();
?>


The list of methods available can be viewed in /administrator/components/com_easysocial/includes/user/user.php
·
Monday, 28 July 2014 21:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Am i doing somthing wrong here as i'm getting a blank img when calling AVATAR image

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

// Get the current logged in user
$my = Foundry::user();

?>
<img src="$my->getAvatar();" />
·
Wednesday, 30 July 2014 03:50
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Marcus,

You are missing the php declaration and echo on the img tag.


<img src=<?php echo $my->getAvatar();?> />
·
Wednesday, 30 July 2014 10:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Yessssss!!!!!!

Now this is what i'm talking about.

Support here is ACE!
·
Wednesday, 30 July 2014 15:57
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok so i have one last question regarding this!

If i have created a custom field on registration i.e "Student ID" with the Unique Key being "TEXTBOX-3" how would i retrieve this information?
·
Wednesday, 30 July 2014 16:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Marcus Palmer,

I'm really sorry for that missed up on this post thread,

If you need further assistance, you can response on this post thread as well -> http://stackideas.com/forums/calling-easy-social-user-info-like-joomla-jfactory-1

because we are not encourage that create multiple post thread, so it will slow down your support request because there are multiple moderators who are currently working on our support system.
·
Wednesday, 30 July 2014 18:32
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post