By Gregor on Sunday, 17 September 2017
Posted in General Issues
Likes 0
Views 581
Votes 0
Hi,

Is it possible to display the Thumbnail covers in the listing of groups and pages?
With a list of 20 pages or groups the client needs to download more than 20Mb(!) That's is far too much even for desktop use.

Regards,
Mark
It seems like that cluster single page also call the same method, perhaps you can try replace my following code into the same method under the same file and see how it goes.


public function getSource($size = SOCIAL_AVATAR_MEDIUM, $absolute = true)
{
// Get config
$config = ES::config();

// Set the default cover
$default = SOCIAL_JOOMLA_URI . $config->get('covers.default.' . $this->type . '.' . SOCIAL_COVER_DEFAULT);


// If there is a cover override in the template, use it instead.
$app = JFactory::getApplication();
$overridePath = JPATH_ROOT . '/templates/' . $app->getTemplate() . '/html/com_easysocial/covers/' . $this->type . '/default.jpg';

if (JFile::exists($overridePath)) {
$default = rtrim(JURI::root(), '/') . '/templates/' . $app->getTemplate() . '/html/com_easysocial/covers/' . $this->type . '/default.jpg';
}

// Test if the cover is a photo
if ($this->photo_id) {

$photo = $this->getPhoto();

if (!$photo->id) {
$uri = $default;
} else {
$uri = $photo->getSource('large');

$customView = $app->input->get('view');
$customLayout = $app->input->get('layout');

$viewAllowed = array('groups', 'events', 'pages');

// Cluster listing page
if (in_array($customView, $viewAllowed) && $customLayout != 'item') {
$uri = $photo->getSource('thumbnail');
}
}

// The file might not exist, so we need to revert to the default
if($uri === false) {
$uri = $default;
}
} else {
$uri = $default;
}

return $uri;
}
·
Thursday, 21 September 2017 10:31
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Gregor,

Currently we do not have setting to change image type to this.

But you can modify on this file -> JoomlaFolder/administrator/components/com_easysocial/tables/cover.php


// line 287
$uri = $photo->getSource('large');

// Replace with
$uri = $photo->getSource('thumbnail');


So on these cluster listing page (Group/Page/Event) will show thumbnail image.
·
Monday, 18 September 2017 11:16
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

Thank you. I tried this and it works nicely for the lists. Unfortunately on the item pages the tumbnails are used as well. Meaning that the cover of a page or group are no longer the covers but the thumnail. Hope that makes sense.

Regards,
Mark
·
Thursday, 21 September 2017 00:39
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

Thank you, works perfect! You're a genius

Regards,
Mark
·
Saturday, 23 September 2017 19:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

You are most welcome. Glad to hear that your issue has been resolved now.

As a gentle reminder, kindly start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiry. I will lock and mark this thread as resolved.
·
Saturday, 23 September 2017 22:55
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post