Kunena 6.2.5 & module Kunena Latest 6.0.7 released

The Kunena team has announce the arrival of Kunena 6.2.5 [K 6.2.5] which is now available for download as a native Joomla extension for J! 4.3.x/4.4.x/5.0.x. This version addresses most of the issues that were discovered in K 6.1 / K 6.2 and issues discovered during the last development stages of K 6.2

This category contains miscellaneous, uncategorised user contributions, (templates, modules, plugins and hacks) relating to older versions of Kunena that are no longer supported.

The topics in this category are for historical interest only. Owing to the structural changes that occurred in K 2.0, many of the ideas in these topics will not work with later versions and, for that reason, the topics are locked.

Loved How to exclude categories from post-count?

More
11 years 6 months ago #1 by senes
Here's a simple hack to exclude some categories from the user postcount.

Open: /administrator/components/com_kunena/libraries/forum/topic/topic.php

Find:
Code:
$user->posts += $postdelta; if (!$user->save()) { $this->setError ( $user->getError () ); }

Replace with:
Code:
$cats = array([category-ids]); if(!in_array($this->category_id,$cats)){ $user->posts += $postdelta; } if (!$user->save()) { $this->setError ( $user->getError () ); }


Open: /administrator/components/com_kunena/libraries/user/helper.php

Find:
Code:
$query = "INSERT INTO #__kunena_users (userid, posts) SELECT user_id AS userid, SUM(posts) AS posts FROM #__kunena_user_topics GROUP BY user_id ON DUPLICATE KEY UPDATE posts=VALUES(posts)";

Replace with:
Code:
$query = "INSERT INTO #__kunena_users (userid, posts) SELECT user_id AS userid, SUM(posts) AS posts FROM #__kunena_user_topics WHERE category_id NOT IN ([category-ids]) GROUP BY user_id ON DUPLICATE KEY UPDATE posts=VALUES(posts)";

Hope its helpful :)

Yours sincerely

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

Time to create page: 0.360 seconds