Kunena 6.2.6 released

The Kunena team has announce the arrival of Kunena 6.2.6 [K 6.2.6] which is now available for download as a native Joomla extension for J! 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 Kunena Discuss improvement (changed code included)

More
8 years 8 months ago #1 by ruud
Hi,

one of my users feature requests was to have a 'warning' when they are not logged in and wanted to post a reply.
In the forum this is implemented.
I have just implemented the same warning into Kunena Discuss so the functionality is the same and the user does not get 'confused' anymore.

If one of the devs could have a look I would be very thankful if this gets part of the plugins code :)

the changes are in file: ./plugins/content/kunenadiscuss/tmpl/form.php (version 3.1.0)
the added code is between <-- AANPASSING RUUD --> and <!-- EINDE AANPASSING -->
Code:
<div id="kdiscuss-quick-post<?php echo $row->id ?>" class="kdiscuss-form"> <div class="kdiscuss-title"><?php echo JText::_('PLG_KUNENADISCUSS_DISCUSS') ?></div> <?php if (isset($this->msg)) : ?> <?php echo $this->msg; ?> <?php else: ?> <form method="post" name="postform"> <table> <tr> <td valign="top"> <table> <!-- AANPASSING RUUD --> <?php if(!$this->user->exists()) : ?> <td></td><td><div class="alert alert-info"><?php echo JText::_('COM_KUNENA_GEN_GUEST'); ?></div></td> </tr> <?php endif; ?> <!-- EINDE AANPASSING --> <tr> <td><span class="kdiscuss-quick-post-label"><?php echo JText::_('PLG_KUNENADISCUSS_NAME') ?></span></td> <td><input type="text" name="name" value="<?php echo $this->name ?>" <?php if ($this->user->exists()) echo 'disabled="disabled" '; ?>/></td>

sharing = caring

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

More
8 years 8 months ago #2 by sozzled
In my opinion, this is not a good idea.

The code change basically says, if the user does not exist in the Joomla user table (in other words the user has not logged in) then send a warning. This would not be a good change to apply to Kunena Discuss because this change would generate the warning message in every installation of the plugin where the site manager allows guests to post replies to Joomla articles.

Although there are "dangers" in allowing guests to post to a Kunena forum, there are many members of this community who actually want that. A lot of people, who write articles on their Joomla websites, use Kunena Discuss and they want non-members to comment. Therefore, while ruud's change may be appropriate (or suitable) for him, it will not be suitable for others.

If a change like this were to be made, it should only be made if there was a parameter controlling its behaviour. In other words, a further test like

if (!$this->user->exists() && $this->params->get('<parameter>', ...)) ...

The PHP code is incomplete. This change to Kunena Discuss should not be implemented in its current form.

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

More
8 years 8 months ago - 8 years 8 months ago #3 by ruud
Hi Sozzled, thanks for challenging me in thinking further then my own use case :)

sozzled wrote: In my opinion, this is not a good idea.

The code change basically says, if the user does not exist in the Joomla user table (in other words the user has not logged in) then send a warning. This would not be a good change to apply to Kunena Discuss because this change would generate the warning message in every installation of the plugin where the site manager allows guests to post replies to Joomla articles.


Correct and this is the same behavior for reply to a post / topic. If you don't like that in the discuss plugin, then you probably also have an 'issue' with the reply to a post / topic behavior in Kunena itself :woohoo:

Although there are "dangers" in allowing guests to post to a Kunena forum, there are many members of this community who actually want that. A lot of people, who write articles on their Joomla websites, use Kunena Discuss and they want non-members to comment. Therefore, while ruud's change may be appropriate (or suitable) for him, it will not be suitable for others.

If a change like this were to be made, it should only be made if there was a parameter controlling its behaviour. In other words, a further test like

if (!$this->user->exists() && $this->params->get('<parameter>', ...)) ...


When an administrator disallows guest posting on a category, the discuss plugin will NOT show at all, so the message will only be shown in the case that guest posting IS allowed and the user is not logged in: exactly the same behavior as in the forum itself!

The PHP code is incomplete. This change to Kunena Discuss should not be implemented in its current form.


I have adjusted the toggle to reflect the same functionality as in the forum itself:
Code:
<?php if(!$this->user->exists() && !$this->category->allow_anonymous) : ?>

[strike]although the the functionality stays the same and adding the && !$this->category->allow_anonymous to the if statement doesn't have any effect (because if this condition is met, the whole discuss plugin is not displayed. :)[/strike] If guest posting is disallowed AND in the plugin you have enabled 'Show login button for public users' the message is NOT displayed (only the login button)

So in case you are wondering: why not use the login button? This doesn't work on my sites because when I use it I get redirected away from the article after a successful login, my sites login button does not :)

sharing = caring
Last edit: 8 years 8 months ago by ruud.

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

Time to create page: 0.367 seconds