Comment Count Class


Author Message
Mike

Posted: 12/26/2015
Quote message 

I have a Plugin (JB-Disqus) whose plug in will count the number of comments are made for that article.

But I want to display it's count in the Content footer where Artisteer places it with an Icon.
I am sure I need to edit the plugin but I do not know what css class it needs to use to put it where Artisteer will recognize and display it.

Or am I wrong entirely and this plug will need to create a count Variable Artisteer will use?
 
James G.

Posted: 12/26/2015
Quote message 

The class for the plugin is:
<div class="disqus-count">

Do you have link to your site?
 
Mike

Posted: 12/27/2015
Quote message 

Hi James,
I got that from reviewing the PHP but I'm not sure what I need to do to get it to display in Artisteer's set location.

I'm guessing you are suggesting I have to set this class up while editing the Template in Artisteer.
That would explain my difficulty as this was an after thought on My part.

Site is
http://www.scnyhstory.org
 
James G.

Posted: 12/27/2015
Quote message 

Hey Mike,

I guess I don't understand what your after. Looking at the site I see many articles that have the
icon and comment box. Which articles are you wanting to display message count.
I looked under awards/history makers and saw they didn't have the message count. Are these the articles in question?

I would assume you can do this in joomla.
 
Mike

Posted: 12/27/2015
Quote message 

Sorry Jim for not being clearer...
I have no issue seeing the count created by the plug in.
It shows when it should but not where which would be in art-postfootericons
[url=http://www.freeimage.us/share-5A1E_56809266.html][/url]

I'm almost positive to do what I want I either need to add a a code to the plugin to target it's content to the specific place or to modify the template to have this content display properly.
Ideally I would simply love to use the icon I have set in the template and just take the count and place it there.
But I'm not sure which way to attack this.
 
James G.

Posted: 12/27/2015
Quote message 

I'm not able to test this but insert this at the bottom of the index.php

<script type="text/javascript">
jQuery(document).ready(function($)
{
jQuery('div.disqus-count').insertAfter('span.art-post-metadata-category-name');
});
</script>

Let me know if this works.
 
Mike

Posted: 12/27/2015
Quote message 

Nope afraid not....
I'm wondering if I change the plugin css file to point to the correct Artisteer tag instead?
Or am I completely off track there and what this is about is finding a way to get the plugin to send the count data

This is the code that (I Think) makes the count

                <div class="disqus-count<?php echo $this->params->get('show_logo') != 0 ? ' disqus-logo' : ''; ?>"><a href="<?php echo $link; ?>#disqus_thread" data-disqus-identifier="<?php echo $identifier; ?>"><?php echo JText::_('PLG_CONTENT_JB_DISQUS_0_COMMENTS'); ?></a></div>          

<?php
$html = ob_get_contents();
ob_end_clean();

return $html;
}
[/cpde]
 
Mike

Posted: 12/27/2015
Quote message 

Actually this may be the important bit....The other may just create the div, This seems to actually create the count with the link to the Comments.


if(!defined('COUNT_EXECUTED'))
{
JHtml::_('jquery.framework');

$document->addStyleSheet(JURI::root( true ) . '/plugins/content/jb_disqus/assets/disqus.css');
$document->addStyleSheet(JURI::root( true ) . '/templates/schs16/css/template.css');
$document->addScriptDeclaration("
var disqus_shortname = \"" . $this->params->get('disqus_shortname') . "\";
jQuery(document).ready(function() {
jQuery.getScript('http://" . $this->params->get('disqus_shortname') . ".disqus.com/count.js');
});
");

define('COUNT_EXECUTED', true);
}

 
James G.

Posted: 12/28/2015
Quote message 

Hey Mike,

Here is what needs to be done to achieve your style.

1. edit the jb_disqus.php file located in the following directory:
/plugins/content/jb_disqus

2. edit the following on line 252. Change div to span

3. Then at bottom of index.php file add this script.

<script type="text/javascript">
jQuery(document).ready(function($)
{

jQuery('span.disqus-count').appendTo('div.art-postfootericons');

});
</script>

example:
https://drive.google.com/file/d/0B-n77YpTPCd2OVk5UkM5dlE5bUk/view?usp=sharing
 
Mike

Posted: 12/28/2015
Quote message 

If you didn't hate me already....
You will now! LOL

Nope it did not work and I simply can't figure out why.
Even tried the script you gave in a number of places...
Pre and Post (HTML Close, BODY close)
Pre HEAD close
Post BODY open

Nothing seems to work.

You did mean the template index.php and not the Joomla one correct?

I'm wondering if there isn't some way to edit the template to hardcode it directly where I want it or just give up entirely.

To see what it's doing (I couldn't find any clues from my end.)
http://http://www.scnyhistory.org/index.php/exhibits

 
James G.

Posted: 12/28/2015
Quote message 

Nope, don't give up. As soon as I get back to a computer we will work and resolve issue.

Contact at: jamesg.artisteer@gmail.com
 
James G.

Posted: 12/28/2015
Quote message 

Hey Mike,

I see the change took effect for the div to span.

contact me here: jamesg.artisteer@gmail.com
 
Mike

Posted: 1/15/2016
Quote message 

Well I finally got what I wanted just not in the way I was trying...

Had to resort to using the Disqus code for comment counts and shut it off on the plugin.
I have come to the conclusion that it's impossible to move plug in info for each article in a category listing.

So here is what I did...
You must edit the template php namely blog_item.php from com_contentcategory, default.php from article, and default_item from featured (depending on where you want the comments to be shown)
Go to the end of that file just before the Render Article and add this:

if (strlen($article->titleLink))
$params['metadata-footer-icons'][] = "<span class=\"disqus-comment-count art-postcommentsicon\" data-disqus-url=\"http://www.scnyhistory.org" .$article->titleLink . "\">Comments Closed</span>";

This will place a comment count in the format X Comments if comments are allowed in that item and a Comments Closed on any Article that commenting is not enabled.

I am still using the plugin to insert the actual commenting but shut off all appearances of count in that plugin.
I also switched from JBDisqus plugin to JW Disqus since that is the one they officially tell you to use.

Hope this helps someone else trying to do what I was doing.

Special Thanks to James for all your help and encouragement in this.

 
Mike

Posted: 1/15/2016
Quote message 

NOTE: In the above example you must replace the "www.scnyhistory.org with your own website domain. It is important that the domain be the same as Disqus uses to identify your comments.