Keyword

K2 comments hidden for registered users

  • Leigh Bikechatter
  • Leigh Bikechatter's Avatar Topic Author
  • Offline
  • New Member
More
11 years 4 months ago #114373 by Leigh Bikechatter
K2 comments hidden for registered users was created by Leigh Bikechatter
Hi guys, I have had to re-register on here as my old username wasnt working - not to worry.

I am using J3.1.1 and K2 2.6.6 (now 2.6.7 SVN just in case it fixed it) and am having the same problem. Just to clarify that I have tested this with NO K2 overrides in place at all and it is still true.

I, like many other have been having major problems with human spam getting through the captcha system, originally I just wanted to replace the captcha with playthru as that seems to stop most of it but in the meantime I have just put in place a registration process with playthru captcha and enabled comments only for registered users.

The problem is though, whenever the comments are enabled for everybody they show up perfectly, once I enable only for registered users they vanish completely. It is very odd.

First of all, is this something that has alreadsy been experienced? And secondly - how on earth can i fix it as I need the comments function and really do NOT need the spam that comes in when it is left open.

Thirdly, for the developers really. Why does this use a captcha system that is independent from the Joomla set version? Can it not be created that whatever system captcha is setup the K2 comments captcha uses that instead as it would allow more freedom for people to remove recaptcha - quite frankly it doesnt offer much protection these days - in favour of any of the other ones out there for Joomla that do work

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 4 months ago #114374 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: K2 comments hidden for registered users
Hello Leigh,

Have a look at this post (and see the screenshot). getk2.org/community/New-to-K2-Ask-here-first/178269-Comments-for-registred-users

I think this is what you are looking for. Let me know if that solution did the trick.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Leigh Bikechatter
  • Leigh Bikechatter's Avatar Topic Author
  • Offline
  • New Member
More
11 years 4 months ago #114375 by Leigh Bikechatter
Replied by Leigh Bikechatter on topic Re: K2 comments hidden for registered users
Hi Krikor.

Initially that did not work until I went into the user profile and saw that the gender box was blank. I ticked male and saved and it allowed the comments box to show - however:

I was not intending to use the K2 profile at all and if I elect to not use it in the K2 parameters as well as disable the plugin it would seem that the comments page is still requiring a gender in order to work, this of course will not be allowed as the Joomla profile and K2 profiles are very different (again why? There is no pressing need)

The problem I have with the K2 user profile is that again I cannot use my own option of a captcha plugin and as a result the playthru captcha will not work on a K2 registration page.

It really should not be this hard for a Joomla component to work with it's host system IMO. It would seem that every decision for how to run my site is governed by what K2 will allow - rather than K2 complimenting my system choices.

So for now:

The solution I need is either:

1: how to either set the gender male/female choice in the K2 profile as disabled so that the Joomla user profile can work properly.

2: how to add the K2 gender male/female option to the Joomla profile without all of the other K2 profile options

3: how to add the playthru captcha image to the K2 user profile - and how on earth to turn off the options I do not need such as description.

regards

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 4 months ago - 11 years 4 months ago #114376 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: K2 comments hidden for registered users
Since K2 is using its own user plugin and I think developing your own plugin and porting it with K2 is out the question I think we should think a much simpler solution.

One that does not involve K2/ User plugins and backend params just to show a comment form.

Enable comments for all users and create an override for your item.php.

Now open your item.php and at this point I am assuming you are familiar with coding.

Cut all of the code inside the if($this->item->params->get('itemComments') statement.

Create an new statement to check if the Joomla! user is logged in and then restructure your code based on this snippet.

[code type=php-brief]<?php $user = JFactory::getUser(); ?>

<?php // insert the comment list here ?>

<?php if($user->guest): ?>
<div><?php echo JText::_('K2_LOGIN_TO_POST_COMMENTS'); ?></div>
<?php else: ?>
<?php echo $this->loadTemplate('comments_form'); ?>
<?php endif; ?>[/code]

Note: I have not tested it but it should work perfectly.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Leigh Bikechatter
  • Leigh Bikechatter's Avatar Topic Author
  • Offline
  • New Member
More
11 years 4 months ago #114377 by Leigh Bikechatter
Replied by Leigh Bikechatter on topic Re: K2 comments hidden for registered users
Thanks Krikor, actually the solution posted by Michael linked below has been perfect. I removed the description and image fields and added the playthrucaptcha code so no need to edit anything else.

getk2.org/community/New-to-K2-Ask-here-first/178453-HOW-TO-Captcha-other-than-recaptcha#178478

Thanks for your response though.

One final thing. Upon registration the K2 page reloads to the profile page, is there a way to change where this goes? I have no need for my users to see a profile really just to be redirected to the comments page.

regards

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 3 months ago #114378 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: K2 comments hidden for registered users
Yes Michael did provide an awesome tutorial indeed.

The registration form is working the same way as the default one but you can override register.php and add a second action to the form.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum