diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-04-21 16:35:32 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-04-21 16:35:32 +0000 |
commit | c0a09ef80af1851a003c19b3894fde4d51c1f502 (patch) | |
tree | 248e6e4a9e5c873ebd49ee940012926c6151cea7 /phpBB/includes/functions.php | |
parent | cfc85ff84d38298bbd61d3c7b5517f628ca96187 (diff) | |
download | forums-c0a09ef80af1851a003c19b3894fde4d51c1f502.tar forums-c0a09ef80af1851a003c19b3894fde4d51c1f502.tar.gz forums-c0a09ef80af1851a003c19b3894fde4d51c1f502.tar.bz2 forums-c0a09ef80af1851a003c19b3894fde4d51c1f502.tar.xz forums-c0a09ef80af1851a003c19b3894fde4d51c1f502.zip |
A few changes, moved some items to templates
git-svn-id: file:///svn/phpbb/trunk@3909 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 80a3d3fe34..1862629e52 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -155,6 +155,7 @@ function get_forum_parents($forum_data) { $forum_parents[$row['forum_id']] = $row['forum_name']; } + $db->sql_freeresult($result); $sql = 'UPDATE ' . FORUMS_TABLE . " SET forum_parents = '" . $db->sql_escape(serialize($forum_parents)) . "' @@ -176,7 +177,7 @@ function get_moderators(&$forum_moderators, $forum_id = false) global $config, $template, $db; // Have we disabled the display of moderators? If so, then return - // from whence we came ... after setting an S_ template var + // from whence we came ... if (empty($config['load_moderators'])) { return; @@ -256,18 +257,15 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, return; } -function make_jumpbox($action, $forum_id = false, $enable_select_all = false) +function make_jumpbox($action, $forum_id = false, $select_all = false) { global $auth, $template, $user, $db, $nav_links, $phpEx, $SID; - $boxstring = '<select name="f" onChange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }">'; - $boxstring .= ($enable_select_all) ? '<option value="0">' . $user->lang['ALL_FORUMS'] : '<option value="-1">' . $user->lang['SELECT_FORUM']; - $boxstring .= '</option><option value="-1">-----------------</option>'; - + $boxstring = ''; $sql = 'SELECT forum_id, forum_name, forum_postable, left_id, right_id FROM ' . FORUMS_TABLE . ' ORDER BY left_id ASC'; - $result = $db->sql_query($sql, 120); + $result = $db->sql_query($sql, 600); $right = $cat_right = 0; $padding = $forum_list = $holding = ''; @@ -322,16 +320,13 @@ function make_jumpbox($action, $forum_id = false, $enable_select_all = false) } $db->sql_freeresult($result); - if (!$right) + if ($boxstring != '') { - $boxstring .= '<option value="-1">' . $user->lang['NO_FORUMS'] . '</option>'; + $boxstring = (($select_all) ? '<option value="0">' . $user->lang['ALL_FORUMS'] : '<option value="-1">' . $user->lang['SELECT_FORUM']) . '</option><option value="-1">-----------------</option>' . $boxstring; } - $boxstring .= '</select>'; - $boxstring .= '<input type="hidden" name="sid" value="' . $user->session_id . '" />'; - $template->assign_vars(array( - 'S_JUMPBOX_SELECT' => $boxstring, + 'S_JUMPBOX_OPTIONS' => $boxstring, 'S_JUMPBOX_ACTION' => $action) ); @@ -434,14 +429,8 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat AND user_id = $user_id"; $result = $db->sql_query($sql); - if ($row = $db->sql_fetchrow($result)) - { - $notify_status = $row['notify_status']; - } - else - { - $notify_status = NULL; - } + $notify_status = ($row = $db->sql_fetchrow($result)) ? $row['notify_status'] : NULL; + $db->sql_freeresult($result); } if (!is_null($notify_status)) @@ -532,7 +521,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat // Marks a topic or form as read in the 'lastread' table. function markread($mode, $forum_id = 0, $topic_id = 0, $post_id = 0) { - global $db, $user; + global $config, $db, $user; if ($user->data['user_id'] == ANONYMOUS) { |