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

CommentFileSizeAuthor
#2 forum_empty_forum.patch1.46 KBrobloach

Comments

webchick’s picture

Version: 5.2 » 6.x-dev

I 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.

robloach’s picture

Status: Active » Needs review
StatusFileSize
new1.46 KB

Try this one out... Using some of your provided if statement.

liam mcdermott’s picture

Status: Needs review » Closed (duplicate)

Marking as duplicate of #13120: Make 'Post new forum topic' change according to context (look at #1 on that feature request).