DISQUS

iSeanReiser | ~ is where the <3 is: HowTo: Integrate Disqus with Drupal | iSeanReiser

  • Rob Loach · 1 year ago
    Just made a Disqus Drupal module: http://drupal.org/project/disqus . Might make it a bit easier.
  • sreiser · 1 year ago
    Thank you Rob! I haven't had the time to do this. I'll check it out tonight, if I'm happy with it I'll update my posts accordingly
  • Rob Loach · 1 year ago
    If you notice any features missing (like the hidden parameters), then
    please let me know so we can add it in!

    --
    Rob
  • sreiser · 1 year ago
    Uggh! I haven't made the jump to Drupal 6 yet on this blog (the cobbler's children always have the worst shoes). I haven't had the time to port my hand hacked modules over to D6 yet.

    I'm curious... does your module back up the comments into Drupal's comment system. This might be useful as a fall back position should Disqus go down.
  • Uzzi · 1 year ago
    I finally have Disqus integrated to my drupal 6.2 blog site http://goteratv.com thanks to your pointers on how to get it done, would you mind if i use your instructions and translate them to spanish on my blog? to also help a few of my readers, ill link to your page and ill give you full credit for this and thank you so much , maybe a post on this on the drupal.org page or on the Disqus site would also benefit a lot of people since there is no info on this on any of those sites.
  • sreiser · 1 year ago
    1) It's covered under a creative commons Attribution-Noncommercial-No Derivative license. Don't know if a translation is technically a derivative, but if it is feel free to translate this into Spanish. I'll go one step further I hereby grant anyone the right to translate this into the language of their choice as long as the content retains it's meaning and the other aspects of the license are still kept in force. Please also mention any translations in the comments here and I'll update the post appropriately.

    2) Daniel Ha Already Posted this on the Disqus Blog (I mentioned it in their forums). I'll post something over in Drupal Land later today.

    3) I'm curious, was it much different under 6.2?
  • Andy C · 1 year ago
    I tried Sean's instructions to the letter but can't get the Disqus comment block to display under the content using Drupal 6.2.

    I had already used method 1 but would prefer the 'block' solution.

    I tried different settings for 'Page Visibility' (blog/*) but still no joy. Any pointers ?
  • sreiser · 1 year ago
    Well.. looking at the instructions, I did forget to mention that you needed to turn on the block (Select "Content" from the dropdown on the block list page). I'll fix that in a bit.

    If that isn't it try this in the validation (note that I have added a block type of blog):

    <?php
    $match = FALSE;
    $types = array('story' => 1, 'page' => 1, 'blog'=>1);
    if (arg(0) == 'node' && is_numeric(arg(1))) {
    $nid = arg(1);
    $node = node_load(array('nid' => $nid));
    $type = $node->type;
    if (isset($types[$type])) {
    $match = TRUE;
    }
    }
    return $match;
    ?>

    Good Luck and let me know!
  • Andy C · 1 year ago
    It's working fine now. Thanks a lot Sean. Nice to be able to switch themes and preserve Disqus functionality.
  • sreiser · 1 year ago
    For my own edification was it the node type, not turning on the block or a third thing. If I can use these ver v 6.x directions I'll update the post.
  • Andy C · 1 year ago
    It was failing to enable the Disqus block on the 'content' region. Obvious to experienced Drupal types but I am a clueless newbie.

    However, I would probably include 'blog' as a node type in the example as I am sure this will be pretty common.

    Couple of minor typo-ettes: 12. 'Past' -> 'paste' and on /edit 'to content' -> 'the content'
  • sreiser · 1 year ago
    Thanks...

    Well, welcome to Drupal!

    I'll mention that it works for version 6.x as well then and correct the minor typos tonight (Blogging at 1AM is never a good idea).

    If I get 10 mins I'll try and write a proper module instead of this hack, and merge it with the comments module. The nice thing about that approach is that we can backup the disqus comments into the current comment infrastructure so if disqus isn't around I don't lose my content history.
  • Paul · 1 year ago
    Yes, it worked for me too.
  • ramanujs · 1 year ago
    This is cool
  • conann · 1 year ago
    That worked a treat, any idea how to add image nodes created using the image.module?
  • sreiser · 1 year ago
    I don't use image.module (I host my photos on Flickr so I just grab the URL from there), but all things being equal, after you enable the module you just select image from under "create content".
  • Anthony Farrior · 1 year ago
    Great step by step!!!
  • dbodoff · 1 year ago
    Yeah, I'm a new Drupal guy. Psyched about this solution. But one problem, I don't see this "drop down" menu with "content" as an option in the Blocks- List area. Any idea?
  • sreiser · 1 year ago
    Sorry for the delay... was busy the last day or so... look here http://www.flickr.com/photos/sean_reiser/250116... it's the menu marked "Region"
  • dbodoff · 1 year ago
    Thank you very much for response. The drop down that I have in that
    screen only gives me the option to add it to the left sidebar. Which
    makes me wonder if either this is specific to the theme you are using,
    or if I am missing a module. How were you able to add "content" to
    that particular drop down?

    And by the way, this how-to was awesome. Exactly what a new guy like
    me needs. Really appreciate.
  • seemsArtless · 1 year ago
    Thanks Sean, I've got my Drupal blog updated with comments now, thanks to this posting, and it is interesting to see how the PHP conditional block worked. Without this tutorial I suspect I'd gone with the easy/wrong route. Next step, my written-from-scratch PHP photoblog.
  • sreiser · 1 year ago
    There are a couple of ways I could've implemented the php block. If this was a module, I could've had a comments on / off switch similar to the one the comments module use.

    Why write from scratch? Take a good look at some of the photo gallery type modules in drupal. you might find a solution to what you want without the work.
  • seemsArtless · 1 year ago
    Yeah, when I started my photoblog back in August 2004 ( http://www.seemsartless.com/index.php?pic=37 ) there weren't nearly as many options as there are now, and Drupal was still in diapers, only 3 years old or so.

    And I started the blog for two reasons, to force myself to learn more about photography, but also as a project to learn more about PHP and MySQL, etc... 979 unique photos later, it is safe to say that I've got the hang of things... ;-)
  • Phil Glockner · 1 year ago
    Hey, nice job integrating Disqus! Looks good! Are you planning on massaging the Disqus CSS any?
  • sreiser · 1 year ago
    Too much code to write right now to start tinkering with the disqus css. It blends in well enough for today.
  • Jon-Paul Busoli · 1 year ago
    Thanks for the great post.
  • Czar · 1 year ago
    @sreiser, Does your drupal tutorial allow Google to index your disqus comments? I did a quick search and it appears only the disqus community page is indexed...
  • Gifts and Bones Audio Book · 8 months ago
    Hi,
    Thanks for sharing the " Correct Way " ... : )