Kunena 6.3.8 Released

The Kunena team has announce the arrival of Kunena 6.3.8 [K 6.3.8] in stable which is now available for download as a native Joomla extension for J! 4.4.x/5.0.x/5.1.x/5.2.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 and issues discovered during the last development stages of K 6.3
Note: Please go to the Kunena Dashboard after an upgrade so that the Kunena database tables are also updated.

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
12 years 3 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.371 seconds