Disable K2 comments
Hello teitbite ,
Can you help me with what exactly I need to delete?
<!-- K2 Plugins: K2CommentsBlock -->
<?php echo $this->item->event->K2CommentsBlock; ?>
<?php endif; ?>
<?php if(
$this->item->params->get('itemComments') &&
($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2')) && empty($this->item->event->K2CommentsBlock)
): ?>
<!-- Item comments -->
<a name="itemCommentsAnchor" id="itemCommentsAnchor"></a>
<div class="itemComments">
<?php if($this->item->params->get('commentsFormPosition')=='above' && $this->item->params->get('itemComments') && !JRequest::getInt('print') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2' && K2HelperPermissions::canAddComment($this->item->catid)))): ?>
<!-- Item comments form -->
<div class="itemCommentsForm">
<?php echo $this->loadTemplate('comments_form'); ?>
</div>
<?php endif; ?>
<?php if($this->item->numOfComments>0 && $this->item->params->get('itemComments') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2'))): ?>
<!-- Item user comments -->
<h3 class="itemCommentsCounter">
<span><?php echo $this->item->numOfComments; ?></span> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
</h3>
<ul class="itemCommentsList">
<?php foreach ($this->item->comments as $key=>$comment): ?>
<li class="<?php echo ($key%2) ? "odd" : "even"; echo (!$this->item->created_by_alias && $comment->userID==$this->item->created_by) ? " authorResponse" : ""; echo($comment->published) ? '':' unpublishedComment'; ?>">
<span class="commentLink">
<a href="<?php echo $this->item->link; ?>#comment<?php echo $comment->id; ?>" name="comment<?php echo $comment->id; ?>" id="comment<?php echo $comment->id; ?>">
<?php echo JText::_('K2_COMMENT_LINK'); ?>
</a>
</span>
<?php if($comment->userImage): ?>
<img src="<?php echo $comment->userImage; ?>" alt="<?php echo JFilterOutput::cleanText($comment->userName); ?>" width="<?php echo $this->item->params->get('commenterImgWidth'); ?>" />
<?php endif; ?>
<span class="commentDate"><?php echo JHTML::_('date', $comment->commentDate, JText::_('K2_DATE_FORMAT_LC2')); ?></span>
<span class="commentAuthorName">
<?php echo JText::_('K2_POSTED_BY'); ?>
<?php if(!empty($comment->userLink)): ?>
<a href="<?php echo JFilterOutput::cleanText($comment->userLink); ?>" title="<?php echo JFilterOutput::cleanText($comment->userName); ?>" target="_blank" rel="nofollow"><?php echo $comment->userName; ?></a>
<?php else: ?>
<?php echo $comment->userName; ?>
<?php endif; ?>
</span>
<p><?php echo $comment->commentText; ?></p>
<?php if(
$this->inlineCommentsModeration ||
($comment->published && ($this->params->get('commentsReporting')=='1' || ($this->params->get('commentsReporting')=='2' && !$this->user->guest)))
): ?>
<span class="commentToolbar">
<?php if($this->inlineCommentsModeration): ?>
<?php if(!$comment->published): ?>
<a class="commentApproveLink" href="<?php echo JRoute::_('index.php?option=com_k2&view=comments&task=publish&commentID='.$comment->id.'&format=raw')?>"><?php echo JText::_('K2_APPROVE')?></a>
<?php endif; ?>
<a class="commentRemoveLink" href="<?php echo JRoute::_('index.php?option=com_k2&view=comments&task=remove&commentID='.$comment->id.'&format=raw')?>"><?php echo JText::_('K2_REMOVE')?></a>
<?php endif; ?>
<?php if($comment->published && ($this->params->get('commentsReporting')=='1' || ($this->params->get('commentsReporting')=='2' && !$this->user->guest))): ?>
<a data-k2-modal="iframe" href="<?php echo JRoute::_('index.php?option=com_k2&view=comments&task=report&commentID='.$comment->id)?>"><?php echo JText::_('K2_REPORT')?></a>
<?php endif; ?>
<?php if($comment->reportUserLink): ?>
<a class="k2ReportUserButton" href="<?php echo $comment->reportUserLink; ?>"><?php echo JText::_('K2_FLAG_AS_SPAMMER'); ?></a>
<?php endif; ?>
</span>
<?php endif; ?>
<div class="clr"></div>
</li>
<?php endforeach; ?>
</ul>
<!-- Comments Pagination -->
<div class="itemCommentsPagination">
<?php echo $this->pagination->getPagesLinks(); ?>
<div class="clr"></div>
</div>
<?php endif; ?>
<?php if(
$this->item->params->get('commentsFormPosition')=='below' &&
$this->item->params->get('itemComments') &&
!JRequest::getInt('print') &&
($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2' && K2HelperPermissions::canAddComment($this->item->catid)))
): ?>
<!-- Item comments form -->
<div class="itemCommentsForm">
<?php echo $this->loadTemplate('comments_form'); ?>
</div>
<?php endif; ?>
<?php $user = JFactory::getUser(); if($this->item->params->get('comments') == '2' && $user->guest): ?>
<div class="itemCommentsLoginFirst"><?php echo JText::_('K2_LOGIN_TO_POST_COMMENTS'); ?></div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if(!JRequest::getCmd('print')): ?>
<div class="itemBackToTop">
<a class="k2Anchor" href="<?php echo $this->item->link; ?>#startOfPageId<?php echo JRequest::getInt('id'); ?>">
<?php echo JText::_('K2_BACK_TO_TOP'); ?>
</a>
</div>
<?php endif; ?>
<div class="clr"></div>
</div>
loukasgr Can you also add your ftp details in edit fields in order for us to take closer look.
For reference, You can follow thread post (5 point) procedure.
- Edited
loukasgr Sorry for problem with ftp , I change pass and seems all ok
The ftp details are working now however, The specific page entered in edit fields for which edits have been sought for, is now returning with 404 error henceforth, the modifications being done to specific file wont reflect due to specific page not rendering currently. Kindly check or you may let us know some other page where the specific menu type is being rendered from the site
- Edited
loukasgr As apparently seen, BT Social share plugin can be seen with K2 comments not rendering currently. Ref: Screenshot. Kindly confirm if it is fine now
loukasgr Hi again. My idea was to remove all the code between:
<div class="itemComments">
...
</div>
but You will still need to have K2 comments activated in settings. Facebook comments are attached to this layer so it is neccessary to show this layer, but code of k2 comments can be deleted so it will not render k2 commenrts.
Plus i notice with "comments" active i have "read more" and "leave a comment" showing on the right at the corners
- Edited
Good Day@aman204#50403 ,
I did it but nothing change :/
loukasgr Kindly check now. Ref: Screenshot as the facebook comment box can be seen now.