×
Kunena 5.2 Beta 1 Released (24 Sep 2020)

The Kunena team is thrilled to announce the first public beta release of Kunena 5.2, a native Joomla extension for Joomla 3.9. This is a development release and should be only be used for testing; this version is not recommended for live websites at this stage.

The purpose of this release is to encourage testing by downloading, installing and identifying any problems or shortcomings that people may discover. K 5.2.0 B1 is stable and we are aware that people will discover defects. We encourage you to use the forum to report defects, as soon as they are discovered, so that the development team can work through the problems before the release of K 5.1 as a stable product. Reporting defects does not mean that the problems can or will be fixed. The Kunena team is looking forward to hearing your feedback on how well we have achieved our design goals.

Question Kunena Discuss improvement (changed code included)

More
5 years 2 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 -->
<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
5 years 2 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
5 years 2 months ago - 5 years 2 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:
<?php if(!$this->user->exists() && !$this->category->allow_anonymous) : ?>

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. :) 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: 5 years 2 months ago by ruud.

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.102 seconds