By Dan Cote on Thursday, 24 September 2015
Posted in General Issues
Likes 0
Views 821
Votes 0
I've attempted to use the following php code in a Joomla article to display a users Easysocial points and it isn't working:

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

$my = Foundry::user();

$points = $my->getPoints();

echo '$points';

?>

By the way, I am using the Joomla plugin called Sourcerer to insert PHP into joomla articles, and it works for other php code. Maybe I'm missing something in the code?
Hi Dan,

Try to change the following echo instead and see how it goes.
echo '$points';
// replace with
echo $points;
·
Friday, 25 September 2015 11:11
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks Ezrul. That was an oversight on my part. Of course I can't echo a php variable in quotes. Thanks for finding that simple mistake. It works now.
·
Friday, 25 September 2015 23:08
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for updating Dan, glad that your issues are resolved now
·
Sunday, 27 September 2015 17:34
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post