diff options
author | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2003-01-31 02:11:38 +0000 |
---|---|---|
committer | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2003-01-31 02:11:38 +0000 |
commit | dc26ed59601dfcc22b093911286cd9f13f9261ce (patch) | |
tree | 7ab3ae4555b229b0fa2bc28fac949f3a5c656573 | |
parent | 5b0315305fc5e50338ca61b6b8671c45f39bf724 (diff) | |
download | forums-dc26ed59601dfcc22b093911286cd9f13f9261ce.tar forums-dc26ed59601dfcc22b093911286cd9f13f9261ce.tar.gz forums-dc26ed59601dfcc22b093911286cd9f13f9261ce.tar.bz2 forums-dc26ed59601dfcc22b093911286cd9f13f9261ce.tar.xz forums-dc26ed59601dfcc22b093911286cd9f13f9261ce.zip |
Do not display table headers when no subforum is shown
git-svn-id: file:///svn/phpbb/trunk@3437 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/includes/functions.php | 10 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 8 | ||||
-rw-r--r-- | phpBB/viewforum.php | 7 |
3 files changed, 17 insertions, 8 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 724ede0da5..090a36b0e3 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -199,11 +199,11 @@ function get_forum_rules($mode, &$rules, &$forum_id) return; } -function make_jumpbox($action, $forum_id = false) +function make_jumpbox($action, $forum_id = false, $extra_form_fields = array()) { global $auth, $template, $user, $db, $nav_links, $phpEx; - $boxstring = '<input type="hidden" name="sid" value="' . $user->session_id . '" /><select name="f" onChange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }"><option value="-1">' . $user->lang['Select_forum'] . '</option><option value="-1">-----------------</option>'; + $boxstring = '<select name="f" onChange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }"><option value="-1">' . $user->lang['Select_forum'] . '</option><option value="-1">-----------------</option>'; $sql = 'SELECT forum_id, forum_name, forum_postable, left_id, right_id FROM ' . FORUMS_TABLE . ' @@ -270,6 +270,12 @@ function make_jumpbox($action, $forum_id = false) $boxstring .= '</select>'; + $extra_form_fields['sid'] = $user->session_id; + foreach ($extra_form_fields as $key => $val) + { + $boxstring .= '<input type="hidden" name="' . $key . '" value="' . htmlspecialchars($val) . '" />'; + } + $template->assign_vars(array( 'L_GO' => $user->lang['Go'], 'L_JUMP_TO' => $user->lang['Jump_to'], diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 16228dee88..a9a97af31c 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -23,6 +23,8 @@ function display_forums($root_data = '', $display_moderators = TRUE) { global $db, $template, $auth, $user, $phpEx, $SID, $forum_moderators; + $visible_forums = 0; + if (!$root_data) { $root_data = array('forum_id' => 0); @@ -148,6 +150,7 @@ function display_forums($root_data = '', $display_moderators = TRUE) unset($hold); } + ++$visible_forums; $forum_id = $row['forum_id']; $unread_topics = ($user->data['user_id'] && $row['lastread_time'] < $row['forum_last_post_time'] ) ? TRUE : FALSE; @@ -237,5 +240,10 @@ function display_forums($root_data = '', $display_moderators = TRUE) 'U_VIEWFORUM' => 'viewforum.' . $phpEx . $SID . '&f=' . $row['forum_id'] )); } + + $template->assign_vars(array( + 'S_HAS_SUBFORUM' => ($visible_forums) ? TRUE : FALSE, + 'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['Subforum'] : $user->lang['Subforums'] + )); } ?>
\ No newline at end of file diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 63c83fe131..4c6746c99a 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -102,14 +102,9 @@ generate_forum_nav($forum_data); // Moderators $forum_moderators = array(); -// Do we have subforums? if so, let's include this harmless file +// Do we have subforums? if ($forum_data['left_id'] != $forum_data['right_id'] - 1) { - $template->assign_vars(array( - 'S_HAS_SUBFORUM' => TRUE, - 'L_SUBFORUM' => (count($forum_rows) == 1) ? $user->lang['Subforum'] : $user->lang['Subforums'] - )); - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); display_forums($forum_data); } |