Return to Snippet

Revision: 6315
at May 15, 2008 22:36 by shrop


Initial Code
$view = new stdClass();
  $view->name = 'NewComments';
  $view->description = 'Block for new blog entry comments.';
  $view->access = array (
  0 => '3',
  1 => '4',
);
  $view->view_args_php = '';
  $view->page = FALSE;
  $view->page_title = '';
  $view->page_header = '';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'node';
  $view->url = '';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '10';
  $view->block = TRUE;
  $view->block_title = 'New Comments';
  $view->block_header = '';
  $view->block_header_format = '1';
  $view->block_footer = '<a href="/admin/content/comment/list/approval">Approval Queue</a>';
  $view->block_footer_format = '1';
  $view->block_empty = '';
  $view->block_empty_format = '1';
  $view->block_type = 'list';
  $view->nodes_per_block = '25';
  $view->block_more = FALSE;
  $view->block_use_page_header = FALSE;
  $view->block_use_page_footer = FALSE;
  $view->block_use_page_empty = FALSE;
  $view->sort = array (
    array (
      'tablename' => 'comments',
      'field' => 'timestamp',
      'sortorder' => 'DESC',
      'options' => 'normal',
    ),
  );
  $view->argument = array (
  );
  $view->field = array (
    array (
      'tablename' => 'comments',
      'field' => 'subject',
      'label' => '',
      'handler' => 'views_handler_field_commentlink',
      'options' => 'link',
    ),
    array (
      'tablename' => 'comments',
      'field' => 'name',
      'label' => '',
    ),
    array (
      'tablename' => 'comments',
      'field' => 'timestamp',
      'label' => '',
      'handler' => 'views_handler_field_date_small',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'comments',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(comments);
  $views[$view->name] = $view;

Initial URL

                                

Initial Description
A Views export for Drupal 5. A block that only site admin and site manager roles can access, showing unpublished comments for blog entry content type.

Initial Title
Drupal: New Comments Block

Initial Tags
drupal

Initial Language
PHP