Commit a87e1399 authored by merlinofchaos's avatar merlinofchaos

Body filter patch by goodtod -- 75561

parent 7cd3489e
......@@ -170,6 +170,12 @@ function node_views_tables() {
'option' => 'string',
'help' => t('This filter allows nodes to be filtered by their creation date. Enter dates in the format: CCYY-MM-DD HH:MM:SS. Enter \'now\' to use the current time. You may enter a delta (in seconds) to the option that will be added to the time; this is most useful when combined with now. If you have the jscalendar module from jstools installed, you can use a popup date picker here.'),
),
'body' => array(
'name' => t('Node: Body'),
'operator' => 'views_handler_operator_like',
'handler' => 'views_handler_filter_body',
'help' => t('This filter allows nodes to be filtered by their body.'),
),
),
);
......@@ -629,6 +635,24 @@ function views_handler_filter_distinct($op, $filter, $filterinfo, &$query) {
$query->set_distinct();
}
/*
* Filter by body
*/
function views_handler_filter_body($op, $filter, $filterinfo, &$query) {
$filterinfo['table'] = 'node_revisions';
$joininfo = array(
'left' => array(
'table' => 'node',
'field' => 'vid',
),
'right' => array(
'field' => 'vid',
),
);
$query->add_table($filterinfo['table'], FALSE, 1, $joininfo);
views_handler_filter_like($op, $filter, $filterinfo, $query);
}
function views_handler_sort_random($action, &$query, $sortinfo, $sort) {
switch ($GLOBALS['db_type']) {
case 'mysql':
......
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