By Ignacio on Monday, 20 July 2015
Posted in General Issues
Likes 0
Views 382
Votes 0
Hello coding masters,

Is there a way to make all events published to a specific category automatically featured?


Thank you!
Yep, that should work but do take note that when you update, your codes might be overwritten
·
Monday, 20 July 2015 18:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Ignacio,

I am really sorry but unfortunately right now this isn't possible. However, if you create an event app for EasySocial, you can hook to the event "onEventAfterSave". Upon saving, you can check for the event category and set the event to featured if necessary.
·
Monday, 20 July 2015 12:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Got it,

will try.

excellent work,
Thank you!
·
Monday, 20 July 2015 12:36
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome and Thank you for the kind compliments!
·
Monday, 20 July 2015 13:06
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Mark,

I've added the following lines to: components/com_easysocial/controllers/events.php at line 581

if ($category->id == 17 ) { 
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->update($db->quoteName('#__social_clusters'))->set($db->quoteName('featured') . ' = 1')->where($db->quoteName('alias') . ' = ' . $db->quote($event->alias));
$db->setQuery($query);
$result = $db->execute();
}


17 being the category I want featured.

It seems to work fine.

What's your opinion?

Thanks again
·
Monday, 20 July 2015 13:45
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you!

Truly awesome products and service.
·
Tuesday, 21 July 2015 03:09
·
0 Likes
·
0 Votes
·
0 Comments
·
You're welcome Ignacio
·
Tuesday, 21 July 2015 12:07
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post