Skip to content

Instantly share code, notes, and snippets.

@ezra-g
Created February 6, 2012 16:17
Show Gist options
  • Save ezra-g/1753059 to your computer and use it in GitHub Desktop.
Save ezra-g/1753059 to your computer and use it in GitHub Desktop.
<?php
class og_statistics_handler_filter_posts_count extends views_handler_filter_boolean_operator {
function option_definition() {
$options = parent::option_definition();
$options['value'] = array('default' => 1);
return $options;
}
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$form['value']['#type'] = 'radios';
$form['value']['#title'] = t('Filter on group posts');
$form['value']['#options'] = array(1 => t('Has posts'), 0 => t('Has no posts'));
}
function query() {
// @TODO: insert magical query stuff.
// add_where? perhaps.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment