EasyDiscuss 4.0.19
Hi there !

I want to share a little trick to map discussions categories with articles categories and I hope to find this in a future version.

My idea is simple, just put the same alias in content categories AND easydiscuss categories to map them.

File : plugins/content/easydiscuss/easydiscuss.php

Change line 618


$data['category_id'] = $params->get('category_storage', 1);


To,


// Map discussion category with article category if alias are the same
$db = JFactory::getDbo();
$db->setQuery("SELECT b.id FROM #__categories AS a LEFT JOIN #__discuss_category AS b ON a.alias = b.alias WHERE b.alias = '" . $article->category_alias . "'");
$row = $db->loadRow();
if( !empty($row) ) {
$data['category_id'] = $row[0];
} else {
$data['category_id'] = $params->get('category_storage', 1);
}


Enjoy ;)
Attachments (1)
Attachments can only be downloaded by logged in users

This section can only be seen by users with a valid subscription.
If you have a valid subscription, please login now

Support is
Online

The support team is online and will be able to answer your inquiries. Please stay calm, follow the rules and do not cross post.

We will attend to you as soon as we can.

Your time
Stack Ideas time