$view = new stdClass();
$view->name = 'group_forum';
$view->description = '';
$view->access = array (
0 => '2',
);
$view->view_args_php = 'if(!isset($args[1])) $args[1] = -1;
else $args[1] = rtrim($args[1], \'f\');
return $args;';
$view->page = TRUE;
$view->page_title = '';
$view->page_header = 'title, "node/$group->nid");
$bc[3] = l(\'Group forum\', "node/$group->nid/forum");
if (user_access(\'administer_site_configuration\')) drupal_set_message(print_r($bc, true));
drupal_set_breadcrumb($bc);
?>';
$view->page_header_format = '2';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = 'args[1] === -1) {
?>
title, "node/$group->nid");
drupal_set_breadcrumb($bc);
$base_view = views_get_view(\'group_forum\');
$node = node_load(arg(1));
foreach($node->field_forums as $key => $value) {
$view = drupal_clone($base_view);
$view->is_cacheable = 0;
views_sanitize_view($view);
// the \'f\' is here because it seems views that use the $group token ignore other 0 arguments.
// it is stripped out in the argument-handling code
print \'\';
print \'
\' . l($value[\'value\'], "node/$group->nid/forum/$key") . \'
\';
print views_build_view(\'block\', $view, array($group->nid, $key . \'f\'), FALSE);
print \'\';
}
$nosub_view = views_get_view(\'group_forum_notag\');
print \'\';
print \'
\' . l(\'No Sub-Forum\', "node/$group->nid/forum/nosub") . \'
\';
print views_build_view(\'block\', $nosub_view, array($group->nid), FALSE);
print \'\';
}
else {
$bc[1] = l(\'My groups\', "og/my");
$bc[2] = l($group->title, "node/$group->nid");
$bc[3] = l(\'Group forum\', "node/$group->nid/forum");
drupal_set_breadcrumb($bc);
print \'There are no posts for you to view in this category\';
}
?>';
$view->page_empty_format = '2';
$view->page_type = 'table';
$view->url = 'node/$group/forum';
$view->use_pager = FALSE;
$view->nodes_per_page = '10';
$view->menu = TRUE;
$view->menu_title = 'Forum';
$view->menu_tab = TRUE;
$view->menu_tab_weight = '0';
$view->menu_tab_default = FALSE;
$view->menu_tab_default_parent = NULL;
$view->menu_tab_default_parent_type = 'tab';
$view->menu_parent_tab_weight = '0';
$view->menu_parent_title = '';
$view->block = TRUE;
$view->block_title = '';
$view->block_header = '';
$view->block_header_format = '1';
$view->block_footer = '';
$view->block_footer_format = '1';
$view->block_empty = 'There are no posts for you to view in this category.';
$view->block_empty_format = '1';
$view->block_type = 'table';
$view->nodes_per_block = '1';
$view->block_more = TRUE;
$view->block_use_page_header = FALSE;
$view->block_use_page_footer = FALSE;
$view->block_use_page_empty = FALSE;
$view->sort = array (
array (
'tablename' => 'node',
'field' => 'created',
'sortorder' => 'DESC',
'options' => 'normal',
),
);
$view->argument = array (
array (
'type' => 'gid',
'argdefault' => '1',
'title' => '%1 forums',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
array (
'type' => 'content: field_forum',
'argdefault' => '7',
'title' => '%2 forum',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => 'Title',
'handler' => 'views_handler_field_nodelink',
'options' => 'link',
),
array (
'tablename' => 'users',
'field' => 'name',
'label' => 'Author',
),
array (
'tablename' => 'node',
'field' => 'created',
'label' => 'Created',
'handler' => 'views_handler_field_date_small',
),
array (
'tablename' => 'node_comment_statistics',
'field' => 'comment_count',
'label' => 'Comments',
'handler' => 'views_handler_comments_with_new',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'topic',
),
),
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
);
$view->exposed_filter = array (
);
$view->requires = array(node, users, node_comment_statistics);
$views[$view->name] = $view;