Hi everyone,

I have run into some problems with trying to create a custom forum menu.. I am new to Drupal so I will try and explain this the best that I can.

What I want to be able to do is to create a block menu to be placed on a sidebar with direct links to multiple forums. and next to the link a statistic that shows how many new posts there have been in say the last 24 hours. Like this for example:

Teaching Forums - 8 New Posts
Party Forums - 6 New Posts
etc.
etc.

I have the forums set up and have tried to setup the block using Views, but have had little luck. So far I have only been able to create a Global:Custom Text with a direct link to the forum, but this isn't connecting to the forum to get the 'new post' information. I have tried to use a filter to select the forum pages, but it never works..

Any ideas? Am I making any sense here..? =P

Thanks!

Comments

rkdeveloper’s picture

i have seen your last posts also. wan to know which forum you use depends on that i can give solution.

dunklea’s picture

thanks for replying..

right now i am using the forums that shipped with drupal along with this theme, you can see the demo here:
http://www.themeshark.com/demo/diver/

i also have these modules installed if it helps:
Admin Menu
Auto Node Title
CCK
Collapsible Block
DD Block
FCK Editor
FileField
Image API
Image Cache
Image Field
JQuery
JS Tools
Thickbox
Token
Views

Thanks for any feedback!

michelle’s picture

I think you're going to have problems doing this in views. What you're asking for is a linked term name along with a sum of the nodes in that term and all the comments on them. You would need to either make a custom field for the view or just do some custom code to begin with.

The query to get the number of new comments in a forum is in Advanced Forum if you need an example. It's a pretty heavy query, though.

Michelle

rkdeveloper’s picture

$view = new view;
$view->name = 'archive';
$view->description = 'Display a list of months that link to content for that month.';
$view->tag = 'default';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('sorts', array(
'created' => array(
'id' => 'created',
'table' => 'node',
'field' => 'created',
'order' => 'DESC',
'granularity' => 'second',
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'name' => array(
'default_action' => 'summary desc',
'style_plugin' => 'default_summary',
'style_options' => array(
'count' => 1,
'override' => 0,
'items_per_page' => '25',
),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '%1',
'breadcrumb' => '',
'default_argument_type' => 'fixed',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
'glossary' => 0,
'limit' => '0',
'case' => 'none',
'path_case' => 'none',
'transform_dash' => 0,
'add_table' => 0,
'require_value' => 0,
'id' => 'name',
'table' => 'term_data',
'field' => 'name',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
'3' => 0,
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_user' => 0,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'blog' => 0,
'aggregation_feed' => 0,
'aggregation_item' => 0,
'image' => 0,
'forum' => 0,
'page' => 0,
'story' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'3' => 0,
'1' => 0,
'2' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'image_size' => array(
'_original' => '_original',
'thumbnail' => 'thumbnail',
'preview' => 'preview',
),
'validate_argument_php' => '',
),
));
$handler->override_option('filters', array(
'status' => array(
'id' => 'status',
'table' => 'node',
'field' => 'status',
'operator' => '=',
'value' => 1,
'group' => 0,
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'relationship' => 'none',
),
'type' => array(
'operator' => 'in',
'value' => array(
'forum' => 'forum',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
'role' => array(),
'perm' => '',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('title', 'Monthly archive');
$handler->override_option('use_pager', '1');
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
'teaser' => TRUE,
'links' => TRUE,
));
$handler = $view->new_display('page', 'Page', 'page');
$handler->override_option('path', 'archive');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
$handler = $view->new_display('block', 'Block', 'block');
$handler->override_option('block_description', 'Archive list');
$handler->override_option('block_caching', -1);