By Gene Teigland on Saturday, 18 July 2015
Posted in Technical Issues
Replies 5
Likes 0
Views 726
Votes 0
Per the instructions on this doc:
http://stackideas.com/docs/easysocial/developers/users/users

I have tried embedding the cover image... while the same code works for name, followers etc it is not working for cover image.

For example I use this code to embed the user page name:
<?php $userId = JFactory::getApplication()->input->getInt('user_id');
$my = Foundry::user();
echo $my->getName(); ?>


The key part of that code as you mention in the api doc is :
$my     = Foundry::user();
echo $my->getName(); ?>


Which works successfully HOWEVER when I use the same code as instructed from your API for cover image.
$my     = Foundry::user();
echo $my->getCover()->getSource( 'large' );?>


It messes up my site... see my screenshot;
http://www.awesomescreenshot.com/image/416405/53601dacfcabd9721c261a6e10c75abf

So something is not quite right... please advise.. thanks!
Hey Gene,

I am really sorry for the delay of this reply as it is a weekend for us here. How about just this,


echo $my->getCover();
·
Saturday, 18 July 2015 14:26
·
0 Likes
·
0 Votes
·
0 Comments
·
Yeah I tried that already.. All that doe is render the URL of the image... which is close but doesn't display the image.

http://www.awesomescreenshot.com/image/417221/5134b5f6ef5d0fd5b449088d491dc50d
·
Saturday, 18 July 2015 22:56
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Gene,

All the API does, is returns the url to the image. You should use your own html codes to generate whatever you need.

By the way, do take note that our support does not provide support for customizations. We have already out of good faith assisted you with very basic php codes.
·
Saturday, 18 July 2015 23:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Below is the code I used for anybody else who might need it.

<img src="<?php echo Foundry::user($current_user->id)->getCover();?>" style="margin: 10px 0 10px 0">


You will need to add this as well to top of the php file:
require_once( JPATH_ROOT . '/administrator/components/com_easysocial/includes/foundry.php' );
require_once( JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php' );
·
Tuesday, 28 July 2015 03:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Gene,

Thanks for sharing.
·
Tuesday, 28 July 2015 10:50
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post