This can either be seen as a usability bug or as a feature request.
I propose the following patch to forum.module to replace the "Post new forum topic" link with "Select a forum below" on pages where only forum containers are shown. Look for line 901 in forum.module, function theme_forum_display() (Drupal 5.2, works also in Drupal 5.1):
if (user_access('create forum topics')) {
// [ShutterFreak] replaced 1 line:
// $output .= '<li>'. l(t('Post new forum topic.'), "node/add/forum/$tid") .'</li>';
// with the following 5 lines:
if (!in_array($tid, variable_get('forum_containers', array())) && ($tid != 0)) {
$output .= '<li>'. l(t('Post new forum topic.'), "node/add/forum/$tid") .'</li>';
} else {
$output .= '<li>'. t('Select a forum below.') .'</li>';
}
// [ShutterFreak] End of added lines
}
I got my inspiration from the og_forum module.
Best regards,
Olivier
Comments
Comment #1
webchickI agree. This is very silly.
Moving to 6.x so this can get more attention. I have an idea, which involves adding an access callback to node/add/forum that checks both that the current user has 'create forum topics' permissions *and* that forums actually exist.
Comment #2
robloachTry this one out... Using some of your provided if statement.
Comment #3
liam mcdermott commentedMarking as duplicate of #13120: Make 'Post new forum topic' change according to context (look at #1 on that feature request).