Like the comment module, allow comments to be toggled for every individual node who's node type has Disqus enabled.



I also have this feature request and also on a node type bases. (For example, no disqus comments on quote nodes.)

It is already possible to enable/disable Disqus comments per content type but I echo the original poster's request to be able to do this on a node-per-node base in the same way that the core comment module allows for this.

Yeah I have a lot of older content I have moved to read only for comments and since switching to DISQUS all of those nodes are open to commenting again. I'd like an ability to use DISQUS only going forward - this might be hackable actually (I just need to set it for a certain value of node in the DB and up I think) but it would be nice to have it in the admin. I would imagine a lot of people would have my concern with switching to a new comment system.

Is there a way to disable Disqus on user pages? It is throwing a JS error.

Having this as an option in the module would be very helpful.

Kevin: I believe you can find that in the access permissions page.

Node-level comments is a requirement, so we are going to have to revert back to core comments. Too bad. I like this disqus module.

...... or you could help out with a patch :-) .

Couldn't the response from the DISQUS call be parsed and created into comments attributed to that node on demand/during cron? Then add 'via (servicename)' at the bottom? Seems like the first approach. Just spitballing. Then you could still have the DISQUS interface to enter comments, but the core comment module displays them on the node.

That might be more complicated then it really needs to be. All we really want here is the ability to have node-level Disqus settings. Synchronizing on cron, and then altering Drupal core's comment module could get a bit hairy.

Oh, it sounded like #7 wanted the Disqus comments as real comments on the node. My bad.

Kevin: Did you manage to find out how to disable Disqus on the user profiles?

Don't know if this has been addressed already but you can toggle disqus on a node by node basis (provided that the content type is enabled) by using $node->disqus_comments (available in the development version). For example, if you have a custom template, and your user has enabled or disabled comments for that node, you can write a simple code like the following:

if ($node->comment)  //if the user has enabled comments for the node
   print $node->disqus_comments;  //then print out the disqus widget

Status:Active» Needs review
new10.61 KB

Here's a patch for this functionality applied against dev 6.x-1.x-dev

Version:6.x-1.x-dev» 7.x-1.x-dev
Priority:Normal» Critical
Status:Needs review» Patch (to be ported)

Thanks! This is awesome. I made some small tweaks...

  • Checks the status for the block
  • Update hook reports the installation
  • Updating checks the nid so that there arn't duplicates
  • Uses drupal_write_record for the insert (why not)
  • Uses the Comment Settings fieldset to make it look more like the Drupal UI

Thanks Rob, I'll also look into the D7 version too.

Status:Patch (to be ported)» Needs review
new7.07 KB

As promised.

new5.99 KB

I updated the patch to the latest DRUPAL-7--1. Not sure why the update.php isn't registering the update function.

@Rob Loach is this patch applied to the latest v7 release ?

I've tried to solve this issue via special field for this in content types and block visibility php code but no luck.
It will be great to have a solid solution for this issue.


Status:Needs review» Fixed

Committed to DRUPAL-7--1

Woo! Releases soon?

Of course! ...... The problem with the patch was that drupal_write_record($something,$something, 'nid') in Drupal 7 only updates and does not insert if the record doesn't exist.... Weird, yes. Might be a Drupal core bug. Think we should make an issue?

@Rob Loach Thanks, i will try as soons as possible.
Also if there is a bug, we should create an issue ? ;)

@Rob, yeah that sounds strange to me, I wonder if the table was primed with some fake data first if it will run an insert.

Also, no love for 6.x?

Haha :-) ....... If you test out 6.x-1.x-dev and say it's good, I'd be more then happy to tag a release off that.

I've been running it without issue on my blog since #15, granted it gets no traffic but the functionality works as expected.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

I'm having an issue where the enable Disqus comments is viewable/editable for all roles that have permissions to create a node, but I only want certain (admin) roles to control this. Desired workflow would be: all nodes (of a specified content type), would have disqus comments on by default, but only roles with permission could toggle per-node comments on/off. Currently, this feature is on for anyone with access to create a node. Unless I'm missing something?

Status:Closed (fixed)» Needs review


This is happening to me too but in 6.x. I am currently going through the code to see if I can find a fix.

EDIT: I made a change in the hook_form_alter() function to include a new permission to handle the display for roles without the permission enabled. Personally I believe if we include the ability to change it for each node type the amount of permissions settings will be to many. The functionality for this feature should be reviewed. I believe we should have an option when editing a content type to include disqus comments or not, that or at least allow the user that has access to add that content type to enable disqus comments or not.

* Implementation of hook_perm().
function disqus_perm() {
  return array(
    'administer disqus',
    'view disqus comments',
    'display disqus comments on profile',
    'enable disqus comments',
* Implementation of hook_form_alter().
function disqus_form_alter(&$form, $form_state, $form_id) {
  $types = variable_get('disqus_nodetypes', array());
  if (isset($form['type']) && isset($form['#node']) && !empty($types[$form['type']['#value']]) && $form['type']['#value'] .'_node_form' == $form_id) {
    // Add the Disqus settings into the Comment settings fieldset if it exists.
    if (!isset($form['comment_settings'])) {
      $form['comment_settings'] = array(
        '#type' => 'fieldset',
        '#access' => user_access('enable disqus comments'),
        '#title' => t('Comment settings'),
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
        '#weight' => 30,
      $node = $form['#node'];
      $form['comment_settings']['disqus'] = array(
        '#tree' => TRUE,
        'status' => array(
          '#type' => 'checkbox',
          '#title' => t('Enable Disqus comments'),
          '#default_value' => isset($node->disqus['status']) ? $node->disqus['status'] : TRUE,

new1.78 KB

Hi Rob. I'm assuming the patch in #30 is for 6.x even though the version is set for 7.x?

Nope, that's for 7.x :-) . Gotta fix in 7 before we get it into 6. Needs a review.

Status:Needs review» Reviewed & tested by the community

Patch #30 worked for me on D7 with the latest, dev version of disqus. I can confirm that I'm seeing the proper behavior for all roles as well.

Feel free to set back to 'needs review' if you need additional reviewers.

Status:Reviewed & tested by the community» Fixed

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.