×
Blue Eagle 5 v1.5.4 has been Released (13 Sep 2020)

The Kunena team has announce the arrival of Kunena template Blue Eagle 5 v1.5.4 which is now available for download. This version addresses most of the issues that were discovered in development.

× This category is for the plugin developed, endorsed, maintained and supported by the Kunena project team. The topics in this category only relate to the plugin developed for K 3.0 and later versions.

If you are having problems then, for your own benefit, it would save us all a lot of time if you would kindly post your configuration report when you ask for help from this forum. If you do not post your configuration report we will not ask you for it but you will probably not get your problem solved, either.

Question Category mapping - map only by the parent category

More
7 years 4 months ago - 7 years 4 months ago #1 by gray
When configuring the plugin I found that need to add over 20 "category ID, form ID" pairs into "Category Mapping" field to get it working. But it's only 2 main (parent) categories which have about 10 sub-categories each. So, to make my job easier, I decided to add checks of the parent category into the plugin's code.

Thus, in kunenadiscuss.php instead
		if (!empty ( $categoryMap ) && isset ( $categoryMap [$catid] )) {
			$forumcatid = intval($categoryMap [$catid]);
			if (!$forumcatid) {
				$this->debug ( "onPrepareContent.Deny: Category {$catid} was disabled in the category map." );
				return false;
			}
			$this->debug ( "onPrepareContent.Allow: Category {$catid} is in the category map using Kunena category {$forumcatid}" );
			return $forumcatid;
		}

I put the code from the attached TXT file - I could not publish it here because of server errors.

www.justPHP.net - Custom coding for Joomla!
Attachments:
Last edit: 7 years 4 months ago by gray. Reason: reuploaded attachment
The following user(s) said Thank You: leyeti77

Please Log in or Create an account to join the conversation.

More
6 years 10 months ago #2 by gray
Created pull request for this feature:
github.com/Kunena/Kunena-Addons/pull/159

www.justPHP.net - Custom coding for Joomla!

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Time to create page: 0.109 seconds