You are here

function _spaces_shoutbox_views_shouts in Spaces 5

Same name and namespace in other branches
  1. 5.2 spaces_shoutbox/spaces_shoutbox.module \_spaces_shoutbox_views_shouts()
1 call to _spaces_shoutbox_views_shouts()
spaces_shoutbox_views_default_views in spaces_shoutbox/spaces_shoutbox.module
Implementation hook_views_default_views()

File

spaces_shoutbox/spaces_shoutbox.module, line 179

Code

function _spaces_shoutbox_views_shouts() {
  $view = new stdClass();
  $view->name = 'spaces_shouts';
  $view->description = t('Displays a short list of shouts.');
  $view->access = array();
  $view->view_args_php = '';
  $view->block = TRUE;
  $view->block_title = t('Shoutbox');
  $view->block_empty = '<p class="views-empty">' . t('There are no shouts to view.') . '</p>';
  $view->block_empty_format = '1';
  $view->block_type = 'list';
  $view->nodes_per_block = '10';
  $view->sort = array(
    array(
      'tablename' => 'node',
      'field' => 'created',
      'sortorder' => 'DESC',
      'options' => 'normal',
    ),
  );
  $view->argument = array();
  $view->field = array(
    array(
      'tablename' => 'users',
      'field' => 'name',
      'label' => '',
    ),
    array(
      'tablename' => 'node',
      'field' => 'title',
      'label' => '',
      'handler' => 'views_handler_field_nodelink',
      'options' => 'nolink',
    ),
  );
  $view->filter = array(
    array(
      'tablename' => 'node',
      'field' => 'type',
      'operator' => 'OR',
      'options' => '',
      'value' => array(
        0 => 'shout',
      ),
    ),
    array(
      'tablename' => 'node',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
    array(
      'tablename' => 'og_ancestry',
      'field' => 'picg',
      'operator' => '=',
      'options' => '',
      'value' => '***CURRENT_GID***',
    ),
    array(
      'tablename' => 'node',
      'field' => 'changed',
      'operator' => '>',
      'options' => -1 * SPACES_ARCHIVE_TIMESTAMP,
      'value' => 'now',
    ),
  );
  $view->exposed_filter = array();
  $view->requires = array(
    node,
    users,
  );
  return $view;
}