diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-07-06 16:46:53 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-07-06 16:46:53 +0000 |
commit | 462dc69b8e8568f4656675b31b99a31ad98e1331 (patch) | |
tree | 80887b741981fbb7ae508039ae8da66e5e918310 /phpBB/includes | |
parent | 2b531a279f267642582b275dc3f215367e6a5396 (diff) | |
download | forums-462dc69b8e8568f4656675b31b99a31ad98e1331.tar forums-462dc69b8e8568f4656675b31b99a31ad98e1331.tar.gz forums-462dc69b8e8568f4656675b31b99a31ad98e1331.tar.bz2 forums-462dc69b8e8568f4656675b31b99a31ad98e1331.tar.xz forums-462dc69b8e8568f4656675b31b99a31ad98e1331.zip |
some bugfixes
git-svn-id: file:///svn/phpbb/trunk@6149 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_attachments.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_board.php | 1 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_icons.php | 111 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_permissions.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 10 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 24 | ||||
-rw-r--r-- | phpBB/includes/functions_admin.php | 8 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 35 | ||||
-rw-r--r-- | phpBB/includes/functions_messenger.php | 34 | ||||
-rw-r--r-- | phpBB/includes/functions_user.php | 33 | ||||
-rw-r--r-- | phpBB/includes/message_parser.php | 6 | ||||
-rw-r--r-- | phpBB/includes/session.php | 7 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 20 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_profile.php | 27 |
14 files changed, 153 insertions, 167 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 641ceac03e..52c5460847 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -97,7 +97,7 @@ class acp_attachments 'max_attachments_pm' => array('lang' => 'MAX_ATTACHMENTS_PM', 'type' => 'text:3:3', 'explain' => false), 'secure_downloads' => array('lang' => 'SECURE_DOWNLOADS', 'type' => 'radio:yes_no', 'explain' => true), 'secure_allow_deny' => array('lang' => 'SECURE_ALLOW_DENY', 'type' => 'custom', 'method' => 'select_allow_deny', 'explain' => true), - 'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERER', 'type' => 'radio:yes_no', 'explain' => true), + 'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERRER', 'type' => 'radio:yes_no', 'explain' => true), 'legend2' => $l_legend_cat_images, 'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'type' => 'radio:yes_no', 'explain' => true), diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 011bbede7f..be98c6fd49 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -204,7 +204,6 @@ class acp_board 'coppa_enable' => array('lang' => 'ENABLE_COPPA', 'type' => 'radio:yes_no', 'explain' => true), 'coppa_mail' => array('lang' => 'COPPA_MAIL', 'type' => 'textarea:5:40', 'explain' => true), 'coppa_fax' => array('lang' => 'COPPA_FAX', 'type' => 'text:25:100', 'explain' => false), - 'coppa_hide_groups' => array('lang' => 'COPPA_HIDE_GROUPS', 'type' => 'radio:yes_no', 'explain' => true), ) ); break; diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index b74e5f8b4f..0587122423 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -108,44 +108,41 @@ class acp_icons ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC'); $result = $db->sql_query($sql); - if ($row = $db->sql_fetchrow($result)) + while ($row = $db->sql_fetchrow($result)) { - do + if ($action == 'add') { - if ($action == 'add') - { - unset($_images[$row[$fields . '_url']]); - } + unset($_images[$row[$fields . '_url']]); + } - if ($row[$fields . '_id'] == $icon_id) + if ($row[$fields . '_id'] == $icon_id) + { + $after = true; + $data[$row[$fields . '_url']] = $row; + } + else + { + if ($action == 'edit' && !$icon_id) { - $after = true; $data[$row[$fields . '_url']] = $row; } - else - { - if ($action == 'edit' && !$icon_id) - { - $data[$row[$fields . '_url']] = $row; - } - - $selected = ''; - if (!empty($after)) - { - $selected = ' selected="selected"'; - $after = false; - } - $after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url']; - $order_list = '<option value="' . ($row[$fields . '_order']) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -> ' . htmlspecialchars($after_txt)) . '</option>' . $order_list; + $selected = ''; + if (!empty($after)) + { + $selected = ' selected="selected"'; + $after = false; } + + $after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url']; + $order_list = '<option value="' . ($row[$fields . '_order']) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -> ' . htmlspecialchars($after_txt)) . '</option>' . $order_list; } - while ($row = $db->sql_fetchrow($result)); } $db->sql_freeresult($result); $order_list = '<option value="1"' . ((!isset($after)) ? ' selected="selected"' : '') . '>' . $user->lang['FIRST'] . '</option>' . $order_list; + $data = array(); if ($action == 'add') { $data = $_images; @@ -231,20 +228,20 @@ class acp_icons } $img_sql = array( - $fields . '_url' => $image, - $fields . '_width' => $image_width[$image], - $fields . '_height' => $image_height[$image], - 'display_on_posting'=> (isset($image_display_on_posting[$image])) ? 1 : 0, + $fields . '_url' => $image, + $fields . '_width' => $image_width[$image], + $fields . '_height' => $image_height[$image], + 'display_on_posting' => (isset($image_display_on_posting[$image])) ? 1 : 0, ); if ($mode == 'smilies') { $img_sql = array_merge($img_sql, array( - 'emotion' => $image_emotion[$image], - 'code' => $image_code[$image]) + 'emotion' => $image_emotion[$image], + 'code' => $image_code[$image]) ); } - + if (!empty($image_order[$image])) { $img_sql = array_merge($img_sql, array( @@ -351,7 +348,10 @@ class acp_icons $cur_img = array(); $field_sql = ($mode == 'smilies') ? 'code' : 'icons_url'; - $result = $db->sql_query("SELECT $field_sql FROM $table"); + + $sql = "SELECT $field_sql + FROM $table"; + $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { @@ -371,8 +371,8 @@ class acp_icons $data = array(); if (preg_match_all("#'(.*?)', #", $pak_entry, $data)) { - if ((sizeof($data[1]) != 3 && $mode == 'icons') || - (sizeof($data[1]) != 5 && $mode == 'smilies')) + if ((sizeof($data[1]) != 4 && $mode == 'icons') || + (sizeof($data[1]) != 6 && $mode == 'smilies')) { trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action)); } @@ -381,11 +381,12 @@ class acp_icons $img = stripslashes($data[1][0]); $width = stripslashes($data[1][1]); $height = stripslashes($data[1][2]); + $display_on_posting = stripslashes($data[1][3]); - if (isset($data[1][3]) && isset($data[1][4])) + if (isset($data[1][4]) && isset($data[1][5])) { - $emotion = stripslashes($data[1][3]); - $code = stripslashes($data[1][4]); + $emotion = stripslashes($data[1][4]); + $code = stripslashes($data[1][5]); } if ($current == 'replace' && @@ -394,15 +395,16 @@ class acp_icons { $replace_sql = ($mode == 'smilies') ? $code : $img; $sql = array( - $fields . '_url' => $img, - $fields . '_height' => (int) $height, - $fields . '_width' => (int) $width, + $fields . '_url' => $img, + $fields . '_height' => (int) $height, + $fields . '_width' => (int) $width, + 'display_on_posting' => (int) $display_on_posting, ); if ($mode == 'smilies') { $sql = array_merge($sql, array( - 'emotion' => $emotion + 'emotion' => $emotion, )); } @@ -415,17 +417,18 @@ class acp_icons ++$order; $sql = array( - $fields . '_url' => $img, - $fields . '_height' => (int) $height, - $fields . '_width' => (int) $width, - $fields . '_order' => (int) $order, + $fields . '_url' => $img, + $fields . '_height' => (int) $height, + $fields . '_width' => (int) $width, + $fields . '_order' => (int) $order, + 'display_on_posting'=> (int) $display_on_posting, ); if ($mode == 'smilies') { $sql = array_merge($sql, array( - 'code' => $code, - 'emotion' => $emotion + 'code' => $code, + 'emotion' => $emotion, )); } $db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql)); @@ -435,7 +438,7 @@ class acp_icons $cache->destroy('icons'); $cache->destroy('sql', $table); - + trigger_error($user->lang[$lang . '_IMPORT_SUCCESS'] . adm_back_link($this->u_action)); } else @@ -476,7 +479,7 @@ class acp_icons ); return; - + break; case 'send': @@ -492,6 +495,7 @@ class acp_icons $pak .= "'" . addslashes($row[$fields . '_url']) . "', "; $pak .= "'" . addslashes($row[$fields . '_width']) . "', "; $pak .= "'" . addslashes($row[$fields . '_height']) . "', "; + $pak .= "'" . addslashes($row['display_on_posting']) . "', "; if ($mode == 'smilies') { @@ -505,7 +509,7 @@ class acp_icons if ($pak != '') { - $db->sql_close(); + garbage_collection(); header('Pragma: public'); @@ -519,15 +523,16 @@ class acp_icons } else { - trigger_error($user->lang['NO_' . $fields . '_EXPORT'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_' . strtoupper($fields) . '_EXPORT'] . adm_back_link($this->u_action)); } break; case 'delete': - $db->sql_query("DELETE FROM $table - WHERE {$fields}_id = $icon_id"); + $sql = "DELETE FROM $table + WHERE {$fields}_id = $icon_id"; + $db->sql_query($sql); switch ($mode) { diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 76edb094da..3619075fc8 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -70,7 +70,7 @@ class acp_permissions if ($select_all_groups) { // Add default groups to selection - $sql_and = ($config['coppa_hide_groups']) ? " AND group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : ''; + $sql_and = (!$config['coppa_enable']) ? " AND group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : ''; $sql = 'SELECT group_id FROM ' . GROUPS_TABLE . ' diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index f8b289da5e..f6fe02e617 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1505,6 +1505,7 @@ class acp_users case 'sig': include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx); $enable_bbcode = ($config['allow_sig_bbcode']) ? request_var('enable_bbcode', $this->optionget($user_row, 'bbcode')) : false; $enable_smilies = ($config['allow_sig_smilies']) ? request_var('enable_smilies', $this->optionget($user_row, 'smilies')) : false; @@ -1576,9 +1577,14 @@ class acp_users 'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']), 'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'], - 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'],) + 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'], + 'S_BBCODE_IMG' => ($config['allow_sig_img']) ? true : false, + 'S_BBCODE_FLASH' => ($config['allow_sig_flash']) ? true : false) ); + // Assigning custom bbcodes + display_custom_bbcodes(); + break; case 'attach': @@ -1808,7 +1814,7 @@ class acp_users $s_group_options = ''; while ($row = $db->sql_fetchrow($result)) { - if ($config['coppa_hide_groups'] && in_array($row['group_name'], array('INACTIVE_COPPA', 'REGISTERED_COPPA'))) + if (!$config['coppa_enable'] && in_array($row['group_name'], array('INACTIVE_COPPA', 'REGISTERED_COPPA'))) { continue; } diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4185837917..50cdd6a121 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1202,15 +1202,12 @@ function redirect($url) { global $db, $cache, $config, $user; - if (isset($db)) + if (empty($user->lang)) { - $db->sql_close(); + $user->add_lang('common'); } - if (isset($cache)) - { - $cache->unload(); - } + garbage_collection(); // Make sure no &'s are in, this will break the redirect $url = str_replace('&', '&', $url); @@ -2341,16 +2338,8 @@ function msg_handler($errno, $msg_text, $errfile, $errline) case E_USER_ERROR: - if (isset($db)) - { - $db->sql_close(); - } + garbage_collection(); - if (isset($cache)) - { - $cache->unload(); - } - echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; echo '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">'; echo '<head>'; @@ -2499,7 +2488,9 @@ function page_header($page_title = '', $display_online_list = true) if (!empty($_REQUEST['f'])) { $f = request_var('f', 0); - $reading_sql = " AND s.session_page LIKE '%f=$f%'"; + + // Do not change this (it is defined as _f_={forum_id}x within session.php) + $reading_sql = " AND s.session_page LIKE '%\_f\_={$f}x%'"; } // Get number of online guests @@ -2727,6 +2718,7 @@ function page_header($page_title = '', $display_online_list = true) 'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false, 'S_BOARD_DISABLED' => ($config['board_disable'] && !defined('IN_LOGIN') && $auth->acl_gets('a_', 'm_')) ? true : false, 'S_REGISTERED_USER' => $user->data['is_registered'], + 'S_IS_BOT' => $user->data['is_bot'], 'S_USER_PM_POPUP' => $user->optionget('popuppm'), 'S_USER_LANG' => $user->data['user_lang'], 'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'], diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 76d9f66a07..dc873eff60 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -212,7 +212,7 @@ function group_select_options($group_id, $exclude_ids = false) global $db, $user, $config; $exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE group_id NOT IN (' . implode(', ', array_map('intval', $exclude_ids)) . ')' : ''; - $sql_and = ($config['coppa_hide_groups']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : ''; + $sql_and = (!$config['coppa_enable']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : ''; $sql = 'SELECT group_id, group_name, group_type FROM ' . GROUPS_TABLE . " @@ -483,7 +483,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true) */ function delete_topics($where_type, $where_ids, $auto_sync = true) { - global $db; + global $db, $config; $forum_ids = $topic_ids = array(); @@ -546,6 +546,8 @@ function delete_topics($where_type, $where_ids, $auto_sync = true) sync('topic_reported', $where_type, $where_ids); } + set_config('num_topics', $config['num_topics'] - sizeof($return['topics']), true); + return $return; } @@ -638,6 +640,8 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = sync('forum', 'forum_id', $forum_ids, true); } + set_config('num_posts', $config['num_posts'] - sizeof($post_ids), true); + return sizeof($post_ids); } diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index c408f39d50..eec11408dd 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -652,7 +652,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold break; default: - if ($replies >= $config['hot_threshold']) + if ($config['hot_threshold'] && $replies >= $config['hot_threshold']) { $folder = 'folder_hot'; $folder_new = 'folder_hot_new'; @@ -898,6 +898,39 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ } /** +* Assign/Build custom bbcodes for display in screens supporting using of bbcodes +* The custom bbcodes buttons will be placed within the template block 'custom_codes' +*/ +function display_custom_bbcodes() +{ + global $db, $template; + + // Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing) + $num_predefined_bbcodes = 22; + + /* + * @todo while adjusting custom bbcodes, think about caching this query as well as correct ordering + */ + $sql = 'SELECT bbcode_id, bbcode_tag + FROM ' . BBCODES_TABLE . ' + WHERE display_on_posting = 1'; + $result = $db->sql_query($sql); + + $i = 0; + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('custom_tags', array( + 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'", + 'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2), + 'BBCODE_TAG' => $row['bbcode_tag']) + ); + + $i++; + } + $db->sql_freeresult($result); +} + +/** * Display reasons */ function display_reasons($reason_id = 0) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 20101f1750..21edb9fd13 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -118,7 +118,7 @@ class messenger */ function headers($headers) { - $this->extra_headers .= trim($headers) . "\n"; + $this->extra_headers .= trim($headers) . "\r\n"; } /** @@ -339,22 +339,22 @@ class messenger } // Build header - $headers = 'From: ' . $this->from . "\n"; - $headers .= ($cc != '') ? "Cc: $cc\n" : ''; - $headers .= ($bcc != '') ? "Bcc: $bcc\n" : ''; - $headers .= 'Reply-to: ' . $this->replyto . "\n"; - $headers .= 'Return-Path: <' . $config['board_email'] . ">\n"; - $headers .= 'Sender: <' . $config['board_email'] . ">\n"; - $headers .= "MIME-Version: 1.0\n"; - $headers .= 'Message-ID: <' . md5(unique_id(time())) . "@" . $config['server_name'] . ">\n"; - $headers .= 'Date: ' . gmdate('D, d M Y H:i:s T', time()) . "\n"; - $headers .= "Content-type: text/plain; charset={$this->encoding}\n"; - $headers .= "Content-transfer-encoding: 8bit\n"; - $headers .= "X-Priority: {$this->mail_priority}\n"; - $headers .= 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High')) . "\n"; - $headers .= "X-Mailer: PhpBB\n"; - $headers .= "X-MimeOLE: phpBB\n"; - $headers .= "X-phpBB-Origin: phpbb://" . str_replace(array('http://', 'https://'), array('', ''), generate_board_url()) . "\n"; + $headers = 'From: ' . $this->from . "\r\n"; + $headers .= ($cc != '') ? "Cc: $cc\r\n" : ''; + $headers .= ($bcc != '') ? "Bcc: $bcc\r\n" : ''; + $headers .= 'Reply-to: ' . $this->replyto . "\r\n"; + $headers .= 'Return-Path: <' . $config['board_email'] . ">\r\n"; + $headers .= 'Sender: <' . $config['board_email'] . ">\r\n"; + $headers .= "MIME-Version: 1.0\r\n"; + $headers .= 'Message-ID: <' . md5(unique_id(time())) . "@" . $config['server_name'] . ">\r\n"; + $headers .= 'Date: ' . gmdate('D, d M Y H:i:s T', time()) . "\r\n"; + $headers .= "Content-type: text/plain; charset={$this->encoding}\r\n"; + $headers .= "Content-transfer-encoding: 8bit\r\n"; + $headers .= "X-Priority: {$this->mail_priority}\r\n"; + $headers .= 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High')) . "\r\n"; + $headers .= "X-Mailer: PhpBB3\r\n"; + $headers .= "X-MimeOLE: phpBB3\r\n"; + $headers .= "X-phpBB-Origin: phpbb://" . str_replace(array('http://', 'https://'), array('', ''), generate_board_url()) . "\r\n"; $headers .= ($this->extra_headers != '') ? $this->extra_headers : ''; // Send message ... removed $this->encode() from subject for time being diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 4e943a2028..6bccea43ea 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -219,34 +219,6 @@ function user_add($user_row, $cp_data = false) { $cp_data['user_id'] = (int) $user_id; - switch (SQL_LAYER) - { - case 'oracle': - case 'firebird': - case 'postgres': - $right_delim = $left_delim = '"'; - break; - - case 'sqlite': - case 'mssql': - case 'mssql_odbc': - $right_delim = ']'; - $left_delim = '['; - break; - - case 'mysql': - case 'mysql4': - case 'mysqli': - $right_delim = $left_delim = '`'; - break; - } - - foreach ($cp_data as $key => $value) - { - $cp_data[$right_delim . $key . $left_delim] = $value; - unset($cp_data[$key]); - } - if (!class_exists('custom_profile')) { include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); @@ -375,6 +347,9 @@ function user_delete($mode, $user_id, $post_username = false) set_config('num_users', $config['num_users'] - 1, true); + // Adjust last post info... + + $db->sql_transaction('commit'); return false; @@ -1187,7 +1162,7 @@ function avatar_remote($data, &$error) // Make sure getimagesize works... if (($image_data = @getimagesize($data['remotelink'])) === false) { - $error[] = $user->lang['AVATAR_URL_INVALID']; + $error[] = $user->lang['UNABLE_GET_IMAGE_SIZE']; return false; } diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 85f99d349b..26e754033a 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -803,8 +803,10 @@ class bbcode_firstpass extends bbcode { global $config, $phpEx, $user; + $check_path = ($user->page['root_script_path'] != '/') ? substr($user->page['root_script_path'], 0, -1) : '/'; + // Is the user trying to link to a php file in this domain and script path? - if (strpos($url, ".{$phpEx}") !== false && strpos($url, substr($user->page['root_script_path'], 0, -1)) !== false) + if (strpos($url, ".{$phpEx}") !== false && strpos($url, $check_path) !== false) { $server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'); @@ -816,7 +818,7 @@ class bbcode_firstpass extends bbcode // Check again in correct order... $pos_ext = strpos($url, ".{$phpEx}"); - $pos_path = strpos($url, substr($user->page['root_script_path'], 0, -1)); + $pos_path = strpos($url, $check_path); $pos_domain = strpos($url, $server_name); if ($pos_domain !== false && $pos_path >= $pos_domain && $pos_ext >= $pos_path) diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index e6418416e0..3e340b7e16 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -51,7 +51,7 @@ class session // Now, remove the sid and let us get a clean query string... foreach ($args as $key => $argument) { - if (strpos($argument, 'sid=') === 0) + if (strpos($argument, 'sid=') === 0 || strpos($argument, '_f_=') === 0) { unset($args[$key]); break; @@ -143,7 +143,8 @@ class session $this->host = (!empty($_SERVER['HTTP_HOST'])) ? (string) $_SERVER['HTTP_HOST'] : 'localhost'; $this->page = $this->extract_current_page($phpbb_root_path); - $this->page['page'] .= (isset($_POST['f'])) ? ((strpos($this->page['page'], '?') !== false) ? '&' : '?') . 'f=' . intval($_POST['f']) : ''; + // Add forum to the page for tracking online users - also adding a "x" to the end to properly identify the number + $this->page['page'] .= (isset($_REQUEST['f'])) ? ((strpos($this->page['page'], '?') !== false) ? '&' : '?') . '_f_=' . (int) $_REQUEST['f'] . 'x' : ''; if (isset($_COOKIE[$config['cookie_name'] . '_sid']) || isset($_COOKIE[$config['cookie_name'] . '_u'])) { @@ -420,7 +421,7 @@ class session $db->sql_freeresult($result); } - if ($this->data['user_id'] != ANONYMOUS) + if ($this->data['user_id'] != ANONYMOUS && !$bot) { $this->data['session_last_visit'] = (isset($this->data['session_time']) && $this->data['session_time']) ? $this->data['session_time'] : (($this->data['user_lastvisit']) ? $this->data['user_lastvisit'] : time()); } diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index e8b8606015..08f911ef64 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -18,6 +18,7 @@ function compose_pm($id, $mode, $action) global $phpbb_root_path, $phpEx, $config; include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); include($phpbb_root_path . 'includes/message_parser.' . $phpEx); if (!$action) @@ -572,7 +573,6 @@ function compose_pm($id, $mode, $action) // Attachment Preview if (sizeof($message_parser->attachment_data)) { - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); $extensions = $update_count = array(); $template->assign_var('S_HAS_ATTACHMENTS', true); @@ -818,23 +818,7 @@ function compose_pm($id, $mode, $action) ); // Build custom bbcodes array - $sql = 'SELECT bbcode_id, bbcode_tag - FROM ' . BBCODES_TABLE . ' - WHERE display_on_posting = 1'; - $result = $db->sql_query($sql); - - $i = 0; - while ($row = $db->sql_fetchrow($result)) - { - $template->assign_block_vars('custom_tags', array( - 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'", - 'BBCODE_ID' => 22 + ($i * 2), - 'BBCODE_TAG' => $row['bbcode_tag']) - ); - - $i++; - } - $db->sql_freeresult($result); + display_custom_bbcodes(); // Attachment entry if ($auth->acl_get('u_pm_attach') && $config['allow_pm_attach'] && $form_enctype) diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index e7b602b0d1..c529e55223 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -225,7 +225,7 @@ class ucp_profile 'S_CHANGE_EMAIL' => ($auth->acl_get('u_chgemail')) ? true : false, 'S_CHANGE_PASSWORD' => ($auth->acl_get('u_chgpasswd')) ? true : false) ); - break; + break; case 'profile_info': @@ -399,7 +399,7 @@ class ucp_profile $cp->generate_profile_fields('profile', $user->get_iso_lang_id()); - break; + break; case 'signature': @@ -408,7 +408,8 @@ class ucp_profile trigger_error('NO_AUTH_SIGNATURE'); } - include($phpbb_root_path . 'includes/functions_posting.'.$phpEx); + include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); $enable_bbcode = ($config['allow_sig_bbcode']) ? request_var('enable_bbcode', $user->optionget('bbcode')) : false; $enable_smilies = ($config['allow_sig_smilies']) ? request_var('enable_smilies', $user->optionget('smilies')) : false; @@ -486,23 +487,7 @@ class ucp_profile ); // Build custom bbcodes array - $sql = 'SELECT bbcode_id, bbcode_tag - FROM ' . BBCODES_TABLE . ' - WHERE display_on_posting = 1'; - $result = $db->sql_query($sql); - - $i = 0; - while ($row = $db->sql_fetchrow($result)) - { - $template->assign_block_vars('custom_tags', array( - 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'", - 'BBCODE_ID' => 22 + ($i * 2), - 'BBCODE_TAG' => $row['bbcode_tag']) - ); - - $i++; - } - $db->sql_freeresult($result); + display_custom_bbcodes(); break; @@ -665,7 +650,7 @@ class ucp_profile ); } - break; + break; } $template->assign_vars(array( |