Keyword

Display issue with "View Comments" / "0 Comments"

More
14 years 8 months ago #24142 by johnjmart
Count me as a third person with this problem. 

I'd settle for any solution to this at this point.

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

More
14 years 6 months ago - 14 years 6 months ago #24143 by genrock
Ya, it seems like a pretty common problem as I have a friends site that is doing this as well. Trying to figure out how to fix it on my own right now. If I come up with anything I will send you a message.

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

More
14 years 6 months ago #24144 by Rebo69
Hi,

I too had the problem that the number of comments did not reflect the actual number of comments made for an article.

I found out that there was an issue with the article url used to create a post and to retrieve the number of comments. Adding just one line of code in jw_disqus.php solved it.  ;D ;D

Note that you this will only work for comments made to articles without comments as the identifier to an article in Disqus is now build up differently.

Modify jw_disqus.php as follows.

Original piece of code:

// Fetch elements specific to the "article" view only
if( in_array($currectCategory,$categories) && in_array($itemid,$menus) && $option=='com_content' && $view=='article'){

// Comments (article page)
$output->comments = '
<div id="disqus_thread"></div>
<script type="text/javascript">
//<![CDATA[
';
if($disqusSubDomain=='disqusforjoomla' || $disqusDevMode){
$output->comments .= '
var disqus_developer = "1";
';
}
$output->comments .= '
var disqus_url= "'.$output->itemURL.'";
var disqus_identifier = "'.substr(md5($disqusSubDomain),0,10).'_id'.$row->id.'";
//]]>
</script>
<script type="text/javascript" src="disqus.com/forums/'.$disqusSubDomain.'/embed.js">
<noscript>
<a href="http://'.$disqusSubDomain.'.disqus.com/?url=ref">'.JText::_("View the discussion thread.").'
</noscript>
<a href="disqus.com" class="dsq-brlink">blog comments powered by Disqus
';

} // End fetch elements specific to the "article" view only


Added code in red:

// Fetch elements specific to the "article" view only
if( in_array($currectCategory,$categories) && in_array($itemid,$menus) && $option=='com_content' && $view=='article'){

// Comments (article page)

// Start Comment counter bug.
// When placing the $output->itemURL in a CDATA block, each '&amp' is encode to '&amp;amp' which is an incorrect url
// to subsequently find the comments belonging to this article using the itemURL not using PHP code, for example when
// determining the number of comments for an article.
// Therefore removed the 'amp;' from the url.

$temp_itemUrl = str_replace('&amp;','&',$output->itemURL);

// End Comment counter bug


$output->comments = '
<div id="disqus_thread"></div>
<script type="text/javascript">
//<![CDATA[
';
if($disqusSubDomain=='disqusforjoomla' || $disqusDevMode){
$output->comments .= '
var disqus_developer = "1";
';
}
$output->comments .= '
var disqus_url= "'.$temp_itemUrl.'";
var disqus_identifier = "'.substr(md5($disqusSubDomain),0,10).'_id'.$row->id.'";
//]]>
</script>
<script type="text/javascript" src="disqus.com/forums/'.$disqusSubDomain.'/embed.js">
<noscript>
<a href="http://'.$disqusSubDomain.'.disqus.com/?url=ref">'.JText::_("View the discussion thread.").'
</noscript>
<a href="disqus.com" class="dsq-brlink">blog comments powered by Disqus
';

} // End fetch elements specific to the "article" view only

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

More
14 years 5 months ago #24145 by ogy
thanks for the reply Rebo69 . We've noticed that comment counter is set to 0 when Joomla page title/url of the article changes which is obviously linked to sef.

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

More
14 years 4 months ago #24146 by k2k2k2
I contacted disqus and they were great, suggesting this:

getsatisfaction.com/disqus/topics/0_comments_in_hyperlink_1_comment_when_clicked_on_opened_up

gist.github.com/467770

I can load up the .js file ready to edit, but I don't know what to change?

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

More
14 years 2 months ago #24147 by cameleons
The Rebo69 fix works for me (thx), but don't forget to change :
var disqus_url= "'.$output->itemURL.'";
To
var disqus_url= "'.$temp_itemUrl.'";


It would be nice if JLW update the plugin with this fix and maybe with the new & recommended count system explain here : gist.github.com/467770 (thanks to k2k2k2).  :P

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

More
14 years 2 months ago #24148 by adnoiseam
I'm also posting on this thread as a way to suscribe to it and say that, as others, I do not understand what to do with the information on Github at gist.github.com/467770

What part of this code are we supposed to use, and what are we supposed to do with it?

Also, I saw that this problem with the comment counts seem to have to do with something with JoomSEF on my site. However, at the moment, if I totally disable this extension, the whole Disqus functionnality disappears  ???

Anyway, I'd be really grateful if somebody could explain what to do with the piece of Javascript posted on Github.

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

More
13 years 10 months ago #24149 by NatalieSmith01
Replied by NatalieSmith01 on topic Re: Display issue with "View Comments" / "0 Comments"

The Rebo69 fix works for me (thx), but don't forget to change :

var disqus_url= "'.$output->itemURL.'";
To
var disqus_url= "'.$temp_itemUrl.'";


It would be nice if JLW update the plugin with this fix and maybe with the new & recommended count system explain here : gist.github.com/467770 (thanks to k2k2k2).  :P

It would be really great if JLW update the plugin. Waiting for it.
Server Management

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

More
13 years 8 months ago #24150 by kailanaun
Is that second quote your answer regarding the blog update? Only that reply was made just after I posted in here, so it's already been answered and read - it's the post directly under mine. Or are you saying there is another comment in the blog rather than this reply in this forum? If so, can you say where as i've looked in the blog and can't find anything? The most recent post in the blog is 12th March, the one before that ten days earlier - nothing else showing. :o

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


Powered by Kunena Forum