- Posts: 7
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- [SOLVED] Disable leave comments and super use on every page
[SOLVED] Disable leave comments and super use on every page
- Robert
-
Topic Author
- Offline
- New Member
Less
More
11 years 7 months ago - 11 years 7 months ago #118669
by Robert
[SOLVED] Disable leave comments and super use on every page was created by Robert
I already disabled comments in K2 parameters> global settings for comments> disabled, but still have "leave a comment" and "super user" on every article. I also made all items and categories inherit the disable comments.
What are my options?
What are my options?
Attachment not found
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
11 years 7 months ago #118670
by Yiota
Replied by Yiota on topic Re: Disable leave comments and super use on every page
Does this appear when the super user is logged in and browsing the items?
Please Log in or Create an account to join the conversation.
- Eric Korb
-
- Offline
- New Member
Less
More
- Posts: 11
11 years 6 months ago #118671
by Eric Korb
Replied by Eric Korb on topic Re: Disable leave comments and super use on every page
I'm having the same problem. I disabled it in properties globally, in all categories and items. I even tried disabling the module all together and it still shows up.
See attached screen shot.
See attached screen shot.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 6 months ago #118672
by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Disable leave comments and super use on every page
Make sure it is not hardcoded in your template.
Also make sure you have selected the anchor link to be hidden from your category settings (Item view options in category listings ) and K2 params for user views etc..
Also make sure you have selected the anchor link to be hidden from your category settings (Item view options in category listings ) and K2 params for user views etc..
Please Log in or Create an account to join the conversation.
- Eric Korb
-
- Offline
- New Member
Less
More
- Posts: 11
11 years 6 months ago #118673
by Eric Korb
Replied by Eric Korb on topic Re: Disable leave comments and super use on every page
Yes. I've confirmed that both these items are set to HIDE.
However, I believe I found the issue, but don't know how to fix it. This item.php file found in my templates/my_template/html/com_k2/templates/my_template/ folder doesn't seem to be listening to the switch:
Here is code:
<div class="itemToolbar clearfix">
<div class="ItemCommentsLink">
<?php if(!empty($this->item->event->K2CommentsCounter)): ?>
<!-- K2 Plugins: K2CommentsCounter -->
<?php echo $this->item->event->K2CommentsCounter; ?>
<?php else: ?>
<?php if($this->item->numOfComments > 0): ?>
<a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<span><?php echo $this->item->numOfComments; ?></span> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
</a>
<?php else: ?>
<a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<?php echo JText::_('K2_BE_THE_FIRST_TO_COMMENT'); ?>
</a>
<?php endif; ?>
<?php endif; ?>
</div>
However, I believe I found the issue, but don't know how to fix it. This item.php file found in my templates/my_template/html/com_k2/templates/my_template/ folder doesn't seem to be listening to the switch:
Here is code:
<div class="itemToolbar clearfix">
<div class="ItemCommentsLink">
<?php if(!empty($this->item->event->K2CommentsCounter)): ?>
<!-- K2 Plugins: K2CommentsCounter -->
<?php echo $this->item->event->K2CommentsCounter; ?>
<?php else: ?>
<?php if($this->item->numOfComments > 0): ?>
<a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<span><?php echo $this->item->numOfComments; ?></span> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
</a>
<?php else: ?>
<a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
<?php echo JText::_('K2_BE_THE_FIRST_TO_COMMENT'); ?>
</a>
<?php endif; ?>
<?php endif; ?>
</div>
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 6 months ago #118674
by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Disable leave comments and super use on every page
I think the screenshot you posted was one of the category view. You need to edit your category_item.php file as well.
is the correct switch for category_item.php and
is for the item toolbar. Without this check it is possible that the links will render.
<?php if($this->item->params->get('catItemCommentsAnchor') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?>
//your code here
<?php endif; ?>
is the correct switch for category_item.php and
<?php if($this->item->params->get('itemCommentsAnchor') && $this->item->params->get('itemComments') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?>
//code here
<?php endif; ?>
is for the item toolbar. Without this check it is possible that the links will render.
Please Log in or Create an account to join the conversation.
- Eric Korb
-
- Offline
- New Member
Less
More
- Posts: 11
11 years 6 months ago #118675
by Eric Korb
Replied by Eric Korb on topic Re: Disable leave comments and super use on every page
:cheer: Thanks. You let me to the solution. The code you showed is what I found in the default.php for the module. So, I moved the template folder out the way to prove that the default code would work and it did. Then, I put the folder back in place and now it all seems to be working. Not sure why, perhaps the database was off since I downloaded this template as a JumpStart (including Joomla 3.X).
I sent your code to the developer of the template.
Thanks again for leading me to the solution!
Erok
I sent your code to the developer of the template.
Thanks again for leading me to the solution!
Erok
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 6 months ago #118676
by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Disable leave comments and super use on every page
You 're welcome Eric.
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- [SOLVED] Disable leave comments and super use on every page