2
// $Id: views_plugin_row_comment_view.inc,v 1.1 2008/09/03 19:21:29 merlinofchaos Exp $
5
* Contains the node RSS row style plugin.
9
* Plugin which performs a comment_view on the resulting object.
11
class views_plugin_row_comment_view extends views_plugin_row {
12
function option_definition() {
13
$options = parent::option_definition();
14
$options['links'] = array('default' => TRUE);
18
function options_form(&$form, &$form_state) {
19
$form['links'] = array(
20
'#type' => 'checkbox',
21
'#title' => t('Display links'),
22
'#default_value' => $this->options['links'],
26
function pre_render($result) {
28
$this->comments = array();
30
foreach ($result as $row) {
34
if (count($cids) > 1) {
35
$placeholder = " IN (" . implode(', ', array_fill(0, sizeof($cids), '%d')) . ")";
38
$placeholder = " = %d";
41
$cresult = db_query("SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.thread, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid $placeholder", $cids);
42
while ($comment = db_fetch_object($cresult)) {
43
$comment = drupal_unpack($comment);
44
$comment->name = $comment->uid ? $comment->registered_name : $comment->name;
45
$comment->depth = count(explode('.', $comment->thread)) - 1;
46
$this->comments[$comment->cid] = $comment;