You are here

function _spaces_core_views_user_posts in Spaces 5.2

Same name and namespace in other branches
  1. 5 spaces_core/spaces_core.module \_spaces_core_views_user_posts()
1 string reference to '_spaces_core_views_user_posts'
spaces_core_views_default_views in spaces_core/spaces_core.module
Implementation of hook_default_views().

File

spaces_core/spaces_core.module, line 614

Code

function _spaces_core_views_user_posts() {
  $view = new stdClass();
  $view->name = 'spaces_user_posts';
  $view->description = t('Shows updated posts.');
  $view->access = array();
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = t('Recent Posts');
  $view->page_empty = '<p class="views-empty">' . t('No recent posts found') . '</p>';
  $view->page_empty_format = '2';
  $view->page_type = 'table';
  $view->url = 'userposts';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '25';
  $view->block = TRUE;
  $view->block_title = t('Recent Posts');
  $view->block_empty = '<p class="views-empty">' . t('No recent posts found') . '</p>';
  $view->block_empty_format = '1';
  $view->block_type = 'table';
  $view->nodes_per_block = '10';
  $view->block_more = TRUE;
  $view->sort = array(
    array(
      'tablename' => 'node_comment_statistics',
      'field' => 'last_comment_timestamp',
      'sortorder' => 'DESC',
      'options' => 'normal',
    ),
  );
  $view->argument = array(
    array(
      'type' => 'uidtouch',
      'argdefault' => '7',
      'title' => "%1's Posts",
    ),
  );
  $view->field = array(
    array(
      'tablename' => 'node',
      'field' => 'title',
      'label' => 'Title',
      'handler' => 'views_handler_field_nodelink_with_mark',
      'options' => 'link',
    ),
    array(
      'tablename' => 'node',
      'field' => 'type',
      'label' => 'Type',
    ),
    array(
      'tablename' => 'node_comment_statistics',
      'field' => 'comment_count',
      'label' => 'Replies',
      'handler' => 'views_handler_comments',
    ),
    array(
      'tablename' => 'node_comment_statistics',
      'field' => 'last_comment_timestamp',
      'label' => 'Last Post',
      'handler' => 'views_handler_field_since',
      'options' => 1,
    ),
  );
  $view->filter = array(
    array(
      'tablename' => 'node',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
    array(
      'tablename' => 'node',
      'field' => 'type',
      'operator' => 'NOR',
      'options' => '',
      'value' => array_merge(og_get_types('group'), array(
        'shout',
      )),
    ),
    array(
      'tablename' => 'spaces',
      'field' => 'type',
      'operator' => 'all',
      'options' => '',
      'value' => 'all',
    ),
  );
  $view->requires = array(
    node_comment_statistics,
    node,
  );
  return $view;
}