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