Content Blocker

Content Blocker enables users to block the content they see according to various parameters. Current implementations are for blocking by user and blocking by leech feed. So like on some social networking sites, users can say "I don't want to see any content by User X."

Logged in users with appropriate permissions see links below selected content, e.g., 'Block content by userx'. Clicking this link triggers an AJAX update (or loads a form, if Javascript isn't available). On subsequent page loads, any content by the blocked user will be filtered out of node lists, views, etc.

Initial evelopment sponsored by patchak. Maintained by nedjo and Roberto Gerola.

Depends on Fast Toggle module.

Developer usage

Content Blocker is fully modularized so as to be easily extended. New types of blocking options can be added by writing an include file and adding it to the module's /modules directory. The .inc file will be automatically detected and offered as a choice for blocking if the module it implements is available on the site.

Blocking comments

To have comments as well as nodes blocked for a given user, include the following function in your theme's template.php file (if it's a PHPTemplate theme; otherwise, adapt it for your theme):

<?php
function phptemplate_comment_view($comment, $links = array(), $visible = 1) {
  global
$user;

 
// Render the comment only if the comment's author isn't blocked by the current user.
 
if (!$user->uid || ($user->uid && !db_num_rows(db_query("SELECT id FROM {contentblocker} WHERE uid = %d AND id = %d AND type = 'user'", $user->uid, $comment->uid)))) {
    return
theme_comment_view($comment, $links, $visible);
  }
  return
'';
}
?>

Releases

Official releasesDateSizeLinksStatus
5.x-1.02008-Jan-3012.04 KBRecommended for 5.xThis is currently the recommended release for 5.x.
Development snapshotsDateSizeLinksStatus
5.x-1.x-dev2008-Jan-3112.01 KBDevelopment snapshotDevelopment snapshots are automatically regenerated and their contents can frequently change, so they are not recommended for production use.


 
 

Drupal is a registered trademark of Dries Buytaert.