Keyword

Can't get the comments to work

  • Fat-Betty
  • Fat-Betty's Avatar Topic Author
  • Offline
  • New Member
  • Get Thin or Get Eaten!
More
10 years 8 months ago #123101 by Fat-Betty
Can't get the comments to work was created by Fat-Betty
Hello
I am experienced using Joomla but rather new to K2.
Have to admit that I like much better what I see in K2 using Joomla 3.2.x than in older versions of Joomla.

(Use latest version of Joomla 3 and K2)

I have set up a small blog page with only one blog (and one blogging Super user) and a few posts to test.
Created one registered Joomla user to use for testing front end access to the comments and rating.
Use reCaptcha
Set to allow everyone to comment, but with admin approval.
Everything looks good.

Then I go to test the comments as my registered user.
Get the error that the username or email is already in use (have been reading all morning using google about this issue)
Try to login as this user and also as me, Super user and blog owner, but then I get this message (and captcha has disappeared)

The words you typed did not match the ones displayed. Please try again.

It is like the captcha is asking for the code to be put in, but K2 removes it for logged in users so nothing I can do to match any words! :ohmy:
I have tried to use Joomla default loginform and K2 but no difference.

The idea was to offer non registered visitors to the site to comment, but with admin approval before comments are visible,
Also for admin (blog owner) to be able to reply to the comments.
None of this seems to work and I have found old posts online about the same issue from a few years back.

Hope there is some help out there regarding this matter :whistle:

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

  • Fat-Betty
  • Fat-Betty's Avatar Topic Author
  • Offline
  • New Member
  • Get Thin or Get Eaten!
More
10 years 8 months ago #123102 by Fat-Betty
Replied by Fat-Betty on topic Re: Can't get the comments to work
:blush: :blush:
Well, first I apologize for my ignorance..found out how to get this to work.

I had to set the reCaptcha to be disabled for registered users :)


Attachment not found



I played around with this a bit, tried different settings and the only thing I can not get to work now is when I set the comments to be approved from administrator..I do not get any email (checked spam) and I can not publish the comment from Admin area, nor from front end when logged in..so it looks like I might need help to set that part up, thought it used default email for the Super User?
Attachments:

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 8 months ago #123103 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Can't get the comments to work
Hello Bertha,

For Joomla! 3.2.x I suggest you use the 2.6.8 DEV build - getk2.org/assets/get/ .

For notification emails there are several extensions that offer that functionality.
You can try browsing the JED or getk2.org/extend.

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

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

More
9 years 11 months ago #123104 by mtspinto
Replied by mtspinto on topic Re: Can't get the comments to work
Thanks for the fix. :)

I even managed to figure out the user group to allow only members to post.

Joomla 3.3 and latest K2

I found another issue with my setup and searching brings the opposite results.

I want ONLY registered users to post and view comments.

Public should not be able to do either

Under K2 parameters -
the Global settings is enable for registered users... but when logged out public can still see the comments the registered have post.

Where is the setting to disable public viewing of comments please?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 11 months ago #123105 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Can't get the comments to work
This is a template issue.
By default only the comment form is hidden from non-registered users.

You need to override item.php and find this line of code
<?php if($this->item->params->get('itemComments') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2')) && empty($this->item->event->K2CommentsBlock)): ?>

You need to add another check to see if the user is registered.
&& !$user->guest

You can also add an else statement and present a nice message.

These posts will help you.
docs.joomla.org/Accessing_the_current_user_object
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

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

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

More
9 years 11 months ago #123106 by mtspinto
Replied by mtspinto on topic Re: Can't get the comments to work
Thanks for the reply Krikor.

I did try the override.. that didn't seem to work for me.

( ! ) Parse error: syntax error, unexpected '&&' (T_BOOLEAN_AND) in C:\wamp\www\umsiko\templates\crossfitgermiston\html\com_k2\item.php on line 519

lines 512 - 520
Log in  or Create an account to join the conversation.

More
9 years 11 months ago #123107 by Lefteris
Replied by Lefteris on topic Re: Can't get the comments to work
@mtspinto

Hi. Probably you have done something wrong with the code there. Try to revert your changes. The modification required in the default item.php file is to replace line 579:
 <?php if($this->item->params->get('itemComments') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2')) && empty($this->item->event->K2CommentsBlock)): ?>
with :
 <?php if($this->item->params->get('itemComments') &&  !$this->user->guest && empty($this->item->event->K2CommentsBlock)): ?>

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

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

More
9 years 11 months ago #123108 by mtspinto
Replied by mtspinto on topic Re: Can't get the comments to work
Oddly enough that's my lines 514-519

And they're not together like yours but separated.

But that worked PERFECTLY!!!

:woohoo:

Thank you

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 11 months ago #123109 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Can't get the comments to work
You 're welcome.

Since templates can be overridden, actual lines might change from site to site.

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

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