Keyword

[SOLVED] K2 facebook comments

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 4 months ago #117123 by Yiota
Replied by Yiota on topic Re: K2 facebook comments
Make sure that in your item.php file under comments block all you see it the code provided below and nothing else.

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

More
11 years 4 months ago #117124 by Radu Nefton
Replied by Radu Nefton on topic Re: K2 facebook comments
I moved the block of code from line 673 to the bottom of the file and stil not working . Nothing changed .
I have atached the item.php to this post can you look at the file and tell me what i`m doing wrong .

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

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 4 months ago #117125 by Yiota
Replied by Yiota on topic Re: K2 facebook comments
I don't see the attachment can you try again or paste the code directly in the editor by using the code tags?

Thank you.

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

More
11 years 4 months ago #117126 by Radu Nefton
Replied by Radu Nefton on topic Re: K2 facebook comments

Attachment not found


I changed the exension of the file to .txt
Attachments:

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

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 4 months ago #117127 by Yiota
Replied by Yiota on topic Re: K2 facebook comments
You need to replace this code
<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 class="modal" rel="{handler:'iframe',size:{x:560,y:480}}" 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>

	  <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><?php echo JText::_('K2_LOGIN_TO_POST_COMMENTS'); ?></div>
	  <?php endif; ?>

  </div>

with this one:
<div id="fb-root"></div> 
        <script>(function(d, s, id) { 
                var js, fjs = d.getElementsByTagName(s)[0]; 
                if (d.getElementById(id)) return; 
                js = d.createElement(s); js.id = id; 
                js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; 
                fjs.parentNode.insertBefore(js, fjs); 
                }(document, 'script', 'facebook-jssdk'));
        </script> 
 
        <div class="fb-comments" data-href="<?php $url="".$this->item->absoluteURL; echo $url; ?>" data-width="500" data-num-posts="10"></div> 

not keep them both in your item.

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

More
11 years 4 months ago #117128 by Radu Nefton
Replied by Radu Nefton on topic Re: K2 facebook comments
:woohoo: It's working .
God bless you .
I want to ask you another thing , when i copied the com_k2 from root/componet to templates/my-template/html/com_k2/templates/default all the item style(view) has changed. How can i change this style back .

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

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 4 months ago #117129 by Yiota
Replied by Yiota on topic Re: K2 facebook comments
The path you should have in your template folder should be
templates/my-template/html/com_k2/default rather than templates/my-template/html/com_k2/templates/default
Try that and let me know.

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

More
11 years 4 months ago #117130 by Radu Nefton
Replied by Radu Nefton on topic Re: K2 facebook comments
I'm a little confused now . What folder do i need to move ? Or i need to dellete something and copy again . :unsure:

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

More
11 years 4 months ago #117131 by Radu Nefton
Replied by Radu Nefton on topic Re: K2 facebook comments
I have taken the folder default and the files.
generic.php
generic_search.php
index.html
profile.php
register.php

and moved them up one level .
But nothing chaged .

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

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 4 months ago #117132 by Yiota
Replied by Yiota on topic Re: K2 facebook comments
Your folder structure under com_k2 should be like

default (folder)
generic.php
generic_search.php
index.html
profile.php
register.php

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

More
11 years 4 months ago - 11 years 4 months ago #117133 by Radu Nefton
Replied by Radu Nefton on topic Re: K2 facebook comments

Attachment not found


folderstructure.rar

Attachment not found


I atached a screen shot with my folder structures . All the files that were in the template folder i moved them up one level along with the folder default . Still nothing change.
The template folder is now emty.
Attachments:

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

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 4 months ago #117134 by Yiota
Replied by Yiota on topic Re: K2 facebook comments
All the files your templates/your_template/html/com_k2 folder needs is the ones below

default (folder)
generic.php
generic_search.php
index.html
profile.php
register.php

Only these files are needed in this path. Nothing else.

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

More
11 years 4 months ago #117135 by Radu Nefton
Replied by Radu Nefton on topic Re: K2 facebook comments
So i will delete the rest of the folders and files .

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

More
11 years 4 months ago #117136 by Radu Nefton
Replied by Radu Nefton on topic Re: K2 facebook comments
I deleted the rest of the files still nothing changed . :dry:

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

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 4 months ago #117137 by Yiota
Replied by Yiota on topic Re: K2 facebook comments
Is there a link to your page to check it out?
What was your page suppose to show and now doesn't?

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

More
11 years 4 months ago #117138 by Radu Nefton
Replied by Radu Nefton on topic Re: K2 facebook comments
This is a link to my website www.stiridepestetot.ro .
The rating the administrator avatar email they suposed to be on the left . and the contect of the article on the right .

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

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 4 months ago #117139 by Yiota
Replied by Yiota on topic Re: K2 facebook comments
Maybe something doesn't close properly in your k2.css file. Do you use the k2.css file? Are the modifications of your template located there or in some other file?

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

More
11 years 4 months ago #117140 by Radu Nefton
Replied by Radu Nefton on topic Re: K2 facebook comments
I just installed the k2 component on my local xammp to send you a photo on how it sopposed to look but i see that i have the same problem here . The view is the same .
Yes i use the K2 default css .
The only thing that i modifed was the copy of the com_k2 in thet templates/your_template/html/com_k2 .
After i copy that folder the view changed .

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

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 4 months ago #117141 by Yiota
Replied by Yiota on topic Re: K2 facebook comments
Have you made styling for these k2 pages somewhere? Have you modified the k2.css file?

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

More
11 years 4 months ago #117142 by Radu Nefton
Replied by Radu Nefton on topic Re: K2 facebook comments
This is how it was before .

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


Powered by Kunena Forum