How does filtering of a node (usernod) by userstatus work? I need the same for other nodetype.

ositoblanco - February 8, 2008 - 22:48
Project:Usernode
Version:5.x-1.3
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I want to filter cck-nodes (content type name: member) in a view by the status of a user.

I know that i need to define a filter but I dont know how to tell them the right tablename. The field status of a user is in the table users. But how to get the connection with my cck-node "members"?

I'm asking here because you have done the same with the usernode. I hope that's OK. As I can see in the function usernode_views_default_views() you added a filter like

<?php

    $view
->filter = array(
   
// ...
   
array(
     
'tablename' => 'usernode_users',
     
'field' => 'status',
     
'operator' => '=',
     
'options' => '',
     
'value' => '1',
    ),
   
//..
 
);
?>

Now I have a Side helper Module with the function you can see below. It's called from the argument-handlingcode. But its not working. What is wrong with my filter? I think he don't know the tablename. But how can I set up this? How have you done it? Maybe I've misunderstood the way how to define the filter. May you help me with this?

<?php
function sitehelper_filter_view_mitglieder(&$view) {
 
$view->filter[] = array(
   
'tablename' => 'node_users',
   
'field' => 'status',
   
'operator' => '=',
   
'options' => '',
   
'value' => '1',
  );
}
?>

 
 

Drupal is a registered trademark of Dries Buytaert.