Hide new topic link based on the forum topics My goal is to create a second forum. I created a new content type called forum2 and added taxonomy_forums term reference to it.

Drupal automatically creates links for each content type.


I would like to display links based on the forum topics. 
For example ,


namesite/forum/1 - only New topic link is visible
namesite/forum/4 - only link for forum2 is visible


and so on.

here is what I did

function theme_advanced_forum_node_type_create_list(&amp;$variables) {
  $forum_id = $variables['forum_id'];

  // Get the list of node types to display links for.
  $type_list = advanced_forum_node_type_create_list($forum_id);


  $output = '';
  if ($forum_id == 1 || $forum_id == 2)  {

      $output .= '&lt;div class="forum-add-node forum-add-forum"&gt;';
      $output .= theme('advanced_forum_l', array(
        'text' =&gt; 'Add to forum',
        'path' =&gt; $type_list['forum']['href'],
        'options' =&gt; NULL,
        'button_class' =&gt; 'large',
        ));
      $output .= '&lt;/div&gt;';

  }
  elseif ($forum_id == 3 || $forum_id == 4)  {
    $output .= '&lt;div class="forum-add-node forum-add-forum2"&gt;';
      $output .= theme('advanced_forum_l', array(
        'text' =&gt; 'Add to forum2',
        'path' =&gt; $type_list['forum2']['href'],
        'options' =&gt; NULL,
        'button_class' =&gt; 'large',
        ));
      $output .= '&lt;/div&gt;';
    }
  else {
    // User did not have access to create any node types in this fourm so
    // we just return the denial text / login prompt.
    $output = $type_list;
  }

  return $output;
}


Any help would be greatly appreciated
I got it working.
Here is the code

function theme_advanced_forum_node_type_create_list(&amp;$variables) {
  $forum_id = $variables['forum_id'];

  // Get the list of node types to display links for.
  $type_list = advanced_forum_node_type_create_list($forum_id);


  $forum_ids = array(1,2,3,4); // Ids of forum1
  $forum2_ids = array(5,6,7,8,9,10);  // Ids of forum2



  $output = '';

    if (in_array($forum_id, $forum_ids))  {

      $output .= '&lt;div class="forum-add-node forum-add-forum"&gt;';
      $output .= theme('advanced_forum_l', array(
        'text' =&gt; 'New topic',
        'path' =&gt; $type_list['forum']['href'],
        'options' =&gt; NULL,
        'button_class' =&gt; 'large',
        ));
      $output .= '&lt;/div&gt;';

  }
  elseif (in_array($forum_id, $forum2_ids))  {
    $output .= '&lt;div class="forum-add-node forum-add-forum2"&gt;';
      $output .= theme('advanced_forum_l', array(
        'text' =&gt; 'New topic',
        'path' =&gt; $type_list['forum2']['href'],
        'options' =&gt; NULL,
        'button_class' =&gt; 'large',
        ));
      $output .= '&lt;/div&gt;';
    }
  else {
    // User did not have access to create any node types in this fourm so
    // we just return the denial text / login prompt.
    $output = $type_list;
  }


  return $output;
}