2
// $Id: views_handler_argument_comment_user_uid.inc,v 1.1 2008/09/03 19:21:29 merlinofchaos Exp $
5
* Argument handler to accept a user id to check for nodes that
6
* user posted or commented on.
8
class views_handler_argument_comment_user_uid extends views_handler_argument {
10
if (!$this->argument) {
11
$title = variable_get('anonymous', t('Anonymous'));
14
$title = db_result(db_query("SELECT u.name FROM {users} u WHERE u.uid = %d", $this->argument));
20
return check_plain($title);
23
function default_actions($which = NULL) {
24
// Disallow summary views on this argument.
26
$actions = parent::default_actions();
27
unset($actions['summary asc']);
28
unset($actions['summary desc']);
32
if ($which != 'summary asc' && $which != 'summary desc') {
33
return parent::default_actions($which);
38
$this->ensure_my_table();
39
$this->query->add_where(0, "$this->table_alias.uid = %d OR (SELECT COUNT(*) FROM {comments} c WHERE c.uid = %d AND c.nid = $this->table_alias.nid)", $this->argument, $this->argument);