Limitations of the Drupal 5 version

Last modified: September 3, 2008 - 19:33

This module is shipped in two versions: for Drupal 5 and for Drupal 6.

This module utilizes Views for producing lists of flagged objects. And here lies the limitations of the Drupal 5 version.

Listing only nodes

Views 1.x (Drupal 5) can only produce lists of nodes, or of things belonging to nodes. It can not produce lists of anything else. (It can sometimes give the impression it can, but it can't really do it.)

In other words, you can not produce lists of flagged users, or of flagged comments, using Views 1.x.

(Theoretically, it could have been possible with this module to produce lists of flagged comments in Views 1.x, but the Flag module doesn't support this.)

This limitation (and many others) were lifted in Views 2.x, which is not available for Drupal 5.

"So I can't flag, and I can't list, users in Drupal 5?"

You can! But not directly:

Drupal 5 websites usually use modules such as Bio or Node Profile, that create corresponding nodes for users. So you can flag these nodes. Views can easily produce a list of them.

Listing content which isn't flagged

Another feature possible with Views 2.x is listing content which is specifically not flagged. This is not supported in the Drupal 5 version of this module.

Controlling access to tabs

A feature this module will very soon support is selective display of tabs on nodes. For eample, you'll be able to place a "Who's bookmarked this" tab on a node only if somebody has actually bookmarked it. Or place some tab on the user profile page only if that user is flagged somehow. This too is not supported in Views 1.x.

creating a list of flagged comments in D5 and Views 1.x

ncameron - November 3, 2008 - 11:49

We're using flags for users to indicate when a content is inappropriate or offensive. I needed to create a view showing all the flagged content for site admins to check out. No problem with nodes, but since we use comments to produce the forums and a 'wall' for the user page, we needed a way to aggregate all flagged comments.

I knocked up the MySQL query below which pulls up all the flagged comments and outputs them in a table along with a link to flag and unflag.

<?php
$result
= db_query("
  SELECT comments.subject, comments.nid, comments.cid, comments.comment, flag_content.timestamp
  FROM {comments}, {flag_content}
  WHERE comments.cid =  flag_content.content_id
  ORDER BY flag_content.timestamp DESC;"
);
 
$output .= '<table><th>Subject</th><th>Body</th><th>Date</th><th>Action</th>';

  while (
$c = db_fetch_object($result)) {
   
$output .= '<tr>';
   
$output .= '<td><a href="node/'.$c->nid.'#comment-'.$c->cid.'">'.$c->subject.'</a></td>';
   
$output .= '<td>'.$c->comment.'</td>';
   
$output .= '<td>'.date("d/m/y",$c->timestamp).'</td>';
   
$output .= '<td>'.flag_create_link('inappropriate_content',$c->cid).'</td>';
   
$output .= '</tr>';
    }

$output .= '</table>';
 
print
$output;
?>

Hope this helps,

Neil

--
Technology, Society and Economics in Latin America
http://altate.ch

Thanks

mroswell - December 18, 2008 - 21:00

Thanks, ncameron,

I put it in a block, and it worked "right out of the box" with one modification. I added a forward slash before the node link.

$output .= '<td><a href="/node/'.$c->nid.'#comment-'.$c->cid.'">'.$c->subject.'</a></td>';

I also limited the block to appear in the footer of
admin/content/comment

 
 

Drupal is a registered trademark of Dries Buytaert.