New module 'Nodecomment'
This commit is contained in:
parent
09b74574f1
commit
3c2bb788b4
26 changed files with 3513 additions and 0 deletions
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
/**
|
||||
* Argument handler to accept a user id to check for nodes that
|
||||
* user posted or commented on (using Nodecomment).
|
||||
*
|
||||
* Based on original handler from the Views module.
|
||||
*/
|
||||
class nodecomment_handler_argument_comment_user_uid extends views_handler_argument_comment_user_uid {
|
||||
function query() {
|
||||
$this->ensure_my_table();
|
||||
// This copies comment handler query. It could be rewritten in various
|
||||
// different ways, but all variants would suck in terms of performance.
|
||||
$where = "$this->table_alias.uid = %d OR
|
||||
((SELECT COUNT(*) FROM {comments} c WHERE c.uid = %d AND c.nid = $this->table_alias.nid) > 0) OR
|
||||
((SELECT COUNT(*) FROM {node_comments} nc WHERE nc.uid = %d AND nc.nid = $this->table_alias.nid) > 0)";
|
||||
$this->query->add_where(0, $where, $this->argument, $this->argument, $this->argument);
|
||||
}
|
||||
}
|
Reference in a new issue