/[drupal]/contributions/modules/contentblocker/README.txt
ViewVC logotype

Contents of /contributions/modules/contentblocker/README.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Wed Jun 6 21:09:01 2007 UTC (2 years, 5 months ago) by nedjo
Branch: MAIN
CVS Tags: DRUPAL-5--1-0, HEAD
Changes since 1.2: +18 -0 lines
File MIME type: text/plain
Issue #141504, document how to block comments.
1 Content Blocker:
2 *****************
3
4 This module enables users to block the content they see according to various
5 parameters. Current implementations are for blocking by user and blocking
6 by leech feed.
7
8 Logged in users with appropriate permissions see links below selected
9 content, e.g., 'Block content by userx'. Clicking this link triggers
10 an AJAX update (or loads a form, if Javascript isn't available). On
11 subsequent page loads, any content by the blocked user will be filtered out
12 of node lists, views, etc.
13
14 Depends on Fast Toggle module.
15
16 Developer usage:
17
18 Content Blocker is fully modularized so as to be easily extended. New types
19 of blocking options can be added by writing an include file and adding it
20 to the module's /modules directory. The .inc file will be automatically
21 detected and offered as a choice for blocking if the module it implements
22 is available on the site.
23
24 Blocking comments
25
26 To have comments as well as nodes blocked for a given user, include the
27 following function in your theme's template.php file (if it's a PHPTemplate
28 theme; otherwise, adapt it for your theme):
29
30 <?php
31 function phptemplate_comment_view($comment, $links = array(), $visible = 1) {
32 global $user;
33
34 // Render the comment only if the comment's author isn't blocked by the current user.
35 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)))) {
36 return theme_comment_view($comment, $links, $visible);
37 }
38 return '';
39 }
40 ?>

  ViewVC Help
Powered by ViewVC 1.1.2