UPDATES EasyBlog 6.0.11 Released! Update to the latest version now!

Helpdesk

Your Time
Our Time
Response Time
24 — 48 hours
We strive to provide the fastest ever response possible. However, we are not super beings.

Allow at least 24 — 48 hours
  Support is offline
It is currently off working hours and most of us aren't around

Rest assured that we will get back to you as soon as the day starts tomorrow!
  Support is offline
Hi,

I have some custom work that automatically creates event.

I want to use the same image that is used for my event cover as the avatar also. The reason I want to do this is I use the appcarvers events app and they use the avatar as the event image on the app. At the moment all the events without avatars are showing the default calendar icon which is pointless within the app.

I have found the code that I need to change but not exactly sure what to add. This is the code that creates my event cover:


// Set the cover for the event
// Only upload cover if this came from importer
if ($this->image && $fromImporter) {
$this->uploadCover($event, SOCIAL_TYPE_EVENT, $creator);
}
}


I found your documentation on retrieving the avatar and cover as follows:


require_once(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/easysocial.php');
$my = ES::user();
// Cover is a photo object
$photo = $my->getCover();


s it as simple as changing the last line of your example to this:

$avatar = $my->getCover();

Or is it more complicated?

I did try just adding the above line to the end of the original code but it did nothing.

Kind regards

Mel
The replies under this section are restricted to logged in users or users with an active subscription with us