--- forum.module 2005-02-05 20:13:33.544951200 -0500 +++ forum.module.orig 2004-11-06 07:01:39.000000000 -0500 @@ -80,8 +80,6 @@ $output .= form_group(t('Forum viewing options'), $group); $group = form_select(t('Number of topics in block'), 'forum_block_num', variable_get('forum_block_num', '5'), drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)), t('The number of topics to show in the "Forum topics" block. To enable the block, go to the block administration page.', array('%block-administration' => url('admin/block')))); - $group .= form_checkbox(t('Show Active Topics'), 'forum_show_block_active', 1, variable_get('forum_show_block_active', 1), t('Show a list of active topics in the forum block')); - $group .= form_checkbox(t('Show New Topics'), 'forum_show_block_new', 1, variable_get('forum_show_block_new', 0), t('Show a list of new topics in the forum block')); $output .= form_group(t('"Forum topic" block settings'), $group); } } @@ -123,34 +121,15 @@ } else { if (user_access('access content')) { - $show_block_active = variable_get('forum_show_block_active', 1); - $show_block_new = variable_get('forum_show_block_new', 0); + $content = node_title_list(db_query_range("SELECT DISTINCT(n.nid), n.title, l.last_comment_timestamp FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid ". node_access_join_sql() ." WHERE n.status = 1 AND n.type='forum' AND ". node_access_where_sql() ." ORDER BY l.last_comment_timestamp DESC", 0, variable_get('forum_block_num', '5')), t('Active forum topics:')); - // Check the headers - $title = 'Forum topics'; - $subtitle = 'Active forum topics'; - if ( $show_block_active && !$show_block_new ) { - $title = ''; - $subtitle = 'Active forum topics'; - } - if ( $show_block_active ) { - $content = node_title_list(db_query_range("SELECT DISTINCT(n.nid), n.title, l.last_comment_timestamp FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid ". node_access_join_sql() ." WHERE n.status = 1 AND n.type='forum' AND ". node_access_where_sql() ." ORDER BY l.last_comment_timestamp DESC", 0, variable_get('forum_block_num', '5')), t($subtitle)); - } - - $subtitle = 'New forum topics'; - if ( !$show_block_active && $show_block_new ) { - $title = ''; - $subtitle = 'New forum topics'; - } - if ( $show_block_new ) { - $content .= node_title_list(db_query_range("SELECT DISTINCT(n.nid), n.title FROM {node} n ". node_access_join_sql() ." WHERE n.type = 'forum' AND n.status = 1 AND ". node_access_where_sql() ." ORDER BY n.nid DESC", 0, variable_get('forum_block_num', '5')), t($subtitle)); - } + $content .= node_title_list(db_query_range("SELECT DISTINCT(n.nid), n.title FROM {node} n ". node_access_join_sql() ." WHERE n.type = 'forum' AND n.status = 1 AND ". node_access_where_sql() ." ORDER BY n.nid DESC", 0, variable_get('forum_block_num', '5')), t('New forum topics:')); if ($content) { $content .= ''; } - $blocks['subject'] = t($title); + $blocks['subject'] = t('Forum topics'); $blocks['content'] = $content; } }