Commit 68ba8bde authored by merlinofchaos's avatar merlinofchaos

Add "not" option to nid argument

parent bf0f9a9f
......@@ -271,6 +271,10 @@ function node_views_arguments() {
'nid' => array(
'name' => t('Node: ID'),
'handler' => 'views_handler_arg_nid',
'option' => array(
'#type' => 'select',
'#options' => array('equal', 'not equal'),
),
'help' => t('This argument is a single Node ID.'),
),
// renamed from 'feed' so things don't DIE when you have viewfeed.module still
......@@ -615,8 +619,9 @@ function views_handler_arg_nid($op, &$query, $argtype, $arg = '') {
case 'filter':
$args = _views_break_phrase($arg);
if ($args[0] == 'and') {
$operator = $argtype['options'] ? '!=' : '=';
foreach ($args[1] as $arg) {
$query->add_where("node.nid = %d", $arg);
$query->add_where("node.nid $operator %d", $arg);
}
}
else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment