Disqus Integration

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Josh
Regular
Posts: 110
Joined: Mon Jul 18, 2005 3:02 pm
Location: Berlin
Contact:

Re: Disqus Integration

Post by Josh »

Thank you so much!

I will implement this on Wednesday or Thursday, when the debate on the latest blogpost is over.
Josh
Regular
Posts: 110
Joined: Mon Jul 18, 2005 3:02 pm
Location: Berlin
Contact:

Re: Disqus Integration

Post by Josh »

Thank you for creating the Disqus plugin.

It still does not work for me though. I have installed the plugin, inserted my Disqus username and set the start date for this plugin to yesterday in the settings. I have even replaced by template's entries.tpl with the entries.tpl from the default theme..

When I change the theme to default theme, Disqus comment system does not show up either.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Disqus Integration

Post by garvinhicking »

Hi!

Do you have it currently installed? I don'T see any disqus reference on http://atlanticreview.org/archives/1479 ... urope.html - I might need to see it in action to see why it shouldn't work for you...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Josh
Regular
Posts: 110
Joined: Mon Jul 18, 2005 3:02 pm
Location: Berlin
Contact:

Re: Disqus Integration

Post by Josh »

Hi Garvin,

Yes, I have the plugin installed. When you click on comments, the permalink with a reference to disqus shows up:
http://atlanticreview.org/archives/1479 ... qus_thread

I see some disqus code in the Quelltext.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Disqus Integration

Post by garvinhicking »

Hi!

Can you place a {$entry.disqus} temporarily inside your entries.tpl file to see if that returns anything?

If not:

It seems, even though I don't understand why, that the plugin breaks its execution due to that line in the PHP code of the plugin file:

Code: Select all

if (!$eventData['is_extended']) return true;
this usually indicates that the extended entry is being displayed. You could try to remove that line (line 109 in serendipity_event_disqus.php) so see if you get further output then..?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Josh
Regular
Posts: 110
Joined: Mon Jul 18, 2005 3:02 pm
Location: Berlin
Contact:

Re: Disqus Integration

Post by Josh »

So weird: When I wrote a new blogpost, Disqus was there and I was happy:
http://atlanticreview.org/archives/1481 ... rmany.html

Then just now I wrote yet another blogpost, but Disqus is gone again:
http://atlanticreview.org/archives/1483 ... nized.html

The only thing I changed were some settings in the S9Y comment plugin, because I was tired of moderating requests for spam comments and I wanted to disable commenting on older entries.

I fiddled with the settings, but no luck. I have also posted numerous new blogposts, but Disqus is not showing up. There is, however, a reference to Disqus in the Quelltext of the footer.

Garvin, re your advice
Can you place a {$entry.disqus} temporarily inside your entries.tpl file to see if that returns anything?
Where should I put {$entry.disqus} in the entries.tpl?
Josh
Regular
Posts: 110
Joined: Mon Jul 18, 2005 3:02 pm
Location: Berlin
Contact:

Re: Disqus Integration

Post by Josh »

Not so weird anymore.

Disqus shows up, whenever I write a blog post with an extended body. I will be fine, if they remember to always do that.

Thank you for all your help, Garvin!
zafiro17
Regular
Posts: 5
Joined: Wed May 23, 2012 1:44 pm
Contact:

Re: Disqus Integration

Post by zafiro17 »

I was searching for a how-to showing integration of Disqus into S9Y and came up with this thread. I want to add one final post to it just so it's clear for people wondering if Disqus and S9Y are compatible.

Answer: Yes, and it's come a long way since this thread, which seems to have needed some heavy duty coding. I simply enabled the Disqus plug in using Spartacus and input my Disqus shortname.

The Disqus stuff doesn't show up if you do a short blog post using just the "Entry Body." You also have to put some text into the "Extended Entry Body" and the Disqus stuff will add itself to your post automatically. I had Disqus up and running in under one minute. The Disqus plug in works fine, and required no tweaking at all.

Happy ending.
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Re: Disqus Integration

Post by blog.brockha.us »

Is there some technical reason why there has to be an extended part of the article for the DISQUS code to show up?
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Disqus Integration

Post by garvinhicking »

blog.brockha.us wrote:Is there some technical reason why there has to be an extended part of the article for the DISQUS code to show up?
I don't remember the specific code, it could be that the form of detection if the detai page is opened uses the "extended" property in a wrong way. Generally I don't think the extended part of an entry should be required for this...
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Re: Disqus Integration

Post by blog.brockha.us »

I had a look into the code:

Code: Select all

                case 'frontend_display:html:per_entry':
                    $_ts = explode('-', $this->get_config('enable_since'));
                    $ts = mktime(0, 0, 0, $_ts[1], $_ts[2], $_ts[0]);
                    
                    if ($eventData['timestamp'] < $ts) {
                        return true;
                    }

                    $eventData['comments'] = '<a href="' . $eventData['link'] . '#disqus_thread" data-disqus-identifier="disq_id_' . $eventData['id'] . '">Disqus</a>';
                    if (!$eventData['is_extended']) return true;
I think this "if (!$eventData['is_extended']) return true;" can be deleted, because we are in the "per_entry" hook, doesn't it?
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Re: Disqus Integration

Post by blog.brockha.us »

Ah no, this is not the fix.

i fixed the problem locally but the DISQUS extension is crashing the footer designed by 2k11. So I'll check this out, too and send an update to Spartacus, when ready. :)

(The fixed version is live at my testblog at the moment. First article has no extended part, second has. Both do have the DISQUS extension)
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Re: Disqus Integration

Post by blog.brockha.us »

Okay, I think I have fixed that all.
Only one question: Why are you hiding trackbacks, too, Garvin?
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Disqus Integration

Post by garvinhicking »

Great! I think 'is_extended' should have been the check to only show the disqus plugin on the extended entry page and not on the overview.
Only one question: Why are you hiding trackbacks, too, Garvin?
Because when someone is using disqus, I think he wants to maintain ALL his feedback on disqus, and not have to maintain trackbacks on the local blog.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Re: Disqus Integration

Post by blog.brockha.us »

garvinhicking wrote:Great! I think 'is_extended' should have been the check to only show the disqus plugin on the extended entry page and not on the overview.
Yes, that is how I changed it..
garvinhicking wrote:Because when someone is using disqus, I think he wants to maintain ALL his feedback on disqus, and not have to maintain trackbacks on the local blog.
Huh? Disqus can handle trackbacks, too? Did you switch of the s9y trackback/pingback handling in s9y then with the plugin? I think I don't understand how this part should work..
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
Post Reply