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

Question [Merged topic] How can I make ONLY moderators to be able open new threads?

More
13 years 8 months ago #11 by Cerberus
try that in view.php and line 272 notice first line has been edited.

Code:
if ($is_Moderator) { //this user is allowed to post a new topic $thread_new = CKunenaLink::GetPostNewTopicLink($catid, isset($fbIcons['new_topic']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['new_topic'] . '" alt="' . _GEN_POST_NEW_TOPIC . '" title="' . _GEN_POST_NEW_TOPIC . '" border="0" />' : _GEN_POST_NEW_TOPIC); }

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

More
13 years 8 months ago #12 by micheltl
Thank you Cerberus, but doesn't work. In fact, the button appears for every kind of user.
I want that button doesn't appears for ordinary users in a specific fórum.

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

More
13 years 8 months ago - 13 years 8 months ago #13 by Cerberus
Thats not possible you can disbale it for ALL categories or NONE there is no way to do only some categories and not others.

btw that was only the view.php file you would need to edit teh other file the same way too to make it so that only moderators can post on any category
Last edit: 13 years 8 months ago by Cerberus.

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

More
13 years 8 months ago - 13 years 8 months ago #14 by sozzled
Cerberus wrote:

Thats not possible you can disbale it for ALL categories or NONE there is no way to do only some categories and not others.

Actually, it should be possible to selectively disallow "ordinary users" having access for some categories, but you need to write PHP to do it.

The current code in view.php is
Code:
if ($is_Moderator || ($forumLocked == 0 && ($kunena_my->id > 0 || $fbConfig->pubwrite))) { //this user is allowed to post a new topic $thread_new = CKunenaLink::GetPostNewTopicLink($catid, isset($fbIcons['new_topic']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['new_topic'] . '" alt="' . _GEN_POST_NEW_TOPIC . '" title="' . _GEN_POST_NEW_TOPIC . '" border="0" />' : _GEN_POST_NEW_TOPIC); }
You need to extend this with something like
Code:
if ($is_Moderator || ($forumLocked == 0 && ($kunena_my->id > 0 || $fbConfig->pubwrite))) { //this user is allowed to post a new topic $thread_new = CKunenaLink::GetPostNewTopicLink($catid, isset($fbIcons['new_topic']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['new_topic'] . '" alt="' . _GEN_POST_NEW_TOPIC . '" title="' . _GEN_POST_NEW_TOPIC . '" border="0" />' : _GEN_POST_NEW_TOPIC); if (!($is_Moderator) && ($catid == xx)) { //this "ordinary" user is not allowed to post a new topic unset ($thread_new); } }
Where xx is one of the category ids that you not want to allow. If you want to disallow more then you'll have to extend the if-condition. Remember, whatever you do in view.php, you also have to do in showcat.php

I haven't tested the idea and I have no way of knowing if it works. That's for you to discover. Good luck.
Last edit: 13 years 8 months ago by sozzled.

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

More
13 years 8 months ago #15 by @quila
Hi guys,

we dont need to make it so hard, this one is very simple to do ;)

Function $is_Moderator already check if user have permission in that category and we need to stop check on the User id.

As I said before changes should be done in two files view.php (line 274) and showcat.php (line 251).

You'll find that code

if ($is_Moderator || ($forumLocked == 0 && ($kunena_my->id > 0 || $fbConfig->pubwrite)))

You need to delete red code like that

if ($is_Moderator || ($forumLocked == 0 && ($fbConfig->pubwrite)))

that's all. :laugh:

After that your GLOBAL MODERATORS (without assigned categories) are available to make new topic in whole forum, your MODERATORS (with assigned categories) can make a new topics ONLY in categories where they are moderators.

Regards

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

More
13 years 8 months ago #16 by sozzled
That's true, @aquila, but you also should note the user's additional qualification:

micheltl wrote:

I want that button doesn't appears for ordinary users in a specific fórum.

(Emphasis added by me) See the difference?

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

More
13 years 8 months ago #17 by Cerberus
@quila wrote:

Hi guys,

we dont need to make it so hard, this one is very simple to do ;)

Function $is_Moderator already check if user have permission in that category and we need to stop check on the User id.

As I said before changes should be done in two files view.php (line 274) and showcat.php (line 251).

You'll find that code

if ($is_Moderator || ($forumLocked == 0 && ($kunena_my->id > 0 || $fbConfig->pubwrite)))

You need to delete red code like that

if ($is_Moderator || ($forumLocked == 0 && ($fbConfig->pubwrite)))

that's all. :laugh:

After that your GLOBAL MODERATORS (without assigned categories) are available to make new topic in whole forum, your MODERATORS (with assigned categories) can make a new topics ONLY in categories where they are moderators.

Regards


thats exactly what i did in my post LOLOL

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

More
13 years 8 months ago #18 by micheltl
Thanks again, sozzled, @aquila and Cerberus.

The solution is close to being found from the suggestion of sozzled.

Your tip, @aquila, would be the most charming, but my forum have two categories. One, free, where any user can start threads. And the other one, where only moderators can start threads. Your solution would be perfect if I have only the second.

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

Time to create page: 0.356 seconds