diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_board.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_database.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_extensions.php | 18 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_icons.php | 1 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_main.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_reasons.php | 1 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_admin.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_content.php | 12 | ||||
-rw-r--r-- | phpBB/includes/functions_convert.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 3 | ||||
-rw-r--r-- | phpBB/includes/functions_messenger.php | 12 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 9 | ||||
-rw-r--r-- | phpBB/includes/functions_user.php | 2 |
15 files changed, 55 insertions, 17 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index f487662da5..02af98ec54 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -1044,7 +1044,7 @@ class acp_board $user->timezone = $old_tz; return "<select name=\"dateoptions\" id=\"dateoptions\" onchange=\"if (this.value == 'custom') { document.getElementById('" . addslashes($key) . "').value = '" . addslashes($value) . "'; } else { document.getElementById('" . addslashes($key) . "').value = this.value; }\">$dateformat_options</select> - <input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"30\" />"; + <input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"64\" />"; } /** diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 5e430e82ea..00c7ef40c0 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -115,7 +115,6 @@ class acp_database // We might wanna empty out all that junk :D switch ($db->get_sql_layer()) { - case 'sqlite': case 'sqlite3': $extractor->flush('DELETE FROM ' . $table_name . ";\n"); break; @@ -304,7 +303,6 @@ class acp_database case 'mysql': case 'mysql4': case 'mysqli': - case 'sqlite': case 'sqlite3': while (($sql = $fgetd($fp, ";\n", $read, $seek, $eof)) !== false) { diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index 9fbf2f20f1..d2e01c80cc 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -34,7 +34,7 @@ class acp_extensions function main() { // Start the page - global $config, $user, $template, $request, $phpbb_extension_manager, $db, $phpbb_root_path, $phpbb_log, $cache; + global $config, $user, $template, $request, $phpbb_extension_manager, $db, $phpbb_root_path, $phpbb_log, $cache, $phpbb_dispatcher; $this->db = $db; $this->config = $config; @@ -43,6 +43,7 @@ class acp_extensions $this->cache = $cache; $this->request = $request; $this->log = $phpbb_log; + $this->phpbb_dispatcher = $phpbb_dispatcher; $user->add_lang(array('install', 'acp/extensions', 'migrator')); @@ -55,6 +56,21 @@ class acp_extensions $safe_time_limit = (ini_get('max_execution_time') / 2); $start_time = time(); + /** + * Event to run a specific action on extension + * + * @event core.acp_extensions_run_action + * @var string action Action to run + * @var string u_action Url we are at + * @var string ext_name Extension name from request + * @var int safe_time_limit Safe limit of execution time + * @var int start_time Start time + * @since 3.1.11-RC1 + */ + $u_action = $this->u_action; + $vars = array('action', 'u_action', 'ext_name', 'safe_time_limit', 'start_time'); + extract($this->phpbb_dispatcher->trigger_event('core.acp_extensions_run_action', compact($vars))); + // Cancel action if ($request->is_set_post('cancel')) { diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index f5c7ab0dfe..6cd5386857 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -563,7 +563,6 @@ class acp_icons { switch ($db->get_sql_layer()) { - case 'sqlite': case 'sqlite3': $db->sql_query('DELETE FROM ' . $table); break; diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 8697504c77..fe9657aecb 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -275,7 +275,6 @@ class acp_main case 'db_track': switch ($db->get_sql_layer()) { - case 'sqlite': case 'sqlite3': $db->sql_query('DELETE FROM ' . TOPICS_POSTED_TABLE); break; @@ -386,7 +385,6 @@ class acp_main { switch ($db->get_sql_layer()) { - case 'sqlite': case 'sqlite3': $db->sql_query("DELETE FROM $table"); break; diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php index 020bd8f48c..51c398681d 100644 --- a/phpBB/includes/acp/acp_reasons.php +++ b/phpBB/includes/acp/acp_reasons.php @@ -250,7 +250,6 @@ class acp_reasons // Teh standard case 'postgres': case 'oracle': - case 'sqlite': case 'sqlite3': // Change the reports using this reason to 'other' $sql = 'UPDATE ' . REPORTS_TABLE . ' diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index fc7f3bb56a..25e9d6f658 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1959,7 +1959,7 @@ class acp_users 'S_FORM_ENCTYPE' => ' enctype="multipart/form-data"', - 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024), + 'L_AVATAR_EXPLAIN' => $user->lang(($config['avatar_filesize'] == 0) ? 'AVATAR_EXPLAIN_NO_FILESIZE' : 'AVATAR_EXPLAIN', $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024), 'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled), )); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index bbd3e524cc..8996c0e766 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3522,7 +3522,7 @@ function obtain_guest_count($item_id = 0, $item = 'forum') // Get number of online guests - if ($db->get_sql_layer() === 'sqlite' || $db->get_sql_layer() === 'sqlite3') + if ($db->get_sql_layer() === 'sqlite3') { $sql = 'SELECT COUNT(session_ip) as num_guests FROM ( diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index df89b1c0ff..c1a99da231 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2403,7 +2403,6 @@ function phpbb_cache_moderators($db, $cache, $auth) // Clear table switch ($db->get_sql_layer()) { - case 'sqlite': case 'sqlite3': $db->sql_query('DELETE FROM ' . MODERATOR_CACHE_TABLE); break; @@ -2861,7 +2860,6 @@ function get_database_size() } break; - case 'sqlite': case 'sqlite3': global $dbhost; diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index e36eb8119b..9ec965a6a1 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1035,7 +1035,7 @@ function bbcode_nl2br($text) */ function smiley_text($text, $force_option = false) { - global $config, $user, $phpbb_path_helper; + global $config, $user, $phpbb_path_helper, $phpbb_dispatcher; if ($force_option || !$config['allow_smilies'] || !$user->optionget('viewsmilies')) { @@ -1044,6 +1044,16 @@ function smiley_text($text, $force_option = false) else { $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_path_helper->get_web_root_path(); + + /** + * Event to override the root_path for smilies + * + * @event core.smiley_text_root_path + * @var string root_path root_path for smilies + * @since 3.1.11-RC1 + */ + $vars = array('root_path'); + extract($phpbb_dispatcher->trigger_event('core.smiley_text_root_path', compact($vars))); return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img class="smilies" src="' . $root_path . $config['smilies_path'] . '/\2 />', $text); } } diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index c508ef313b..176e3dd6de 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -1652,7 +1652,6 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting = ACL_NO) $sql = 'VALUES ' . implode(', ', preg_replace('#^(.*?)$#', '(\1)', $sql_subary)); break; - case 'sqlite': case 'sqlite3': case 'mssqlnative': $sql = implode(' UNION ALL ', preg_replace('#^(.*?)$#', 'SELECT \1', $sql_subary)); @@ -2040,7 +2039,6 @@ function update_topics_posted() switch ($db->get_sql_layer()) { - case 'sqlite': case 'sqlite3': $db->sql_query('DELETE FROM ' . TOPICS_POSTED_TABLE); break; diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 4726676e2d..53d485cae3 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -282,6 +282,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $subforums[$parent_id][$forum_id]['name'] = $row['forum_name']; $subforums[$parent_id][$forum_id]['orig_forum_last_post_time'] = $row['forum_last_post_time']; $subforums[$parent_id][$forum_id]['children'] = array(); + $subforums[$parent_id][$forum_id]['type'] = $row['forum_type']; if (isset($subforums[$parent_id][$row['parent_id']]) && !$row['display_on_index']) { @@ -490,6 +491,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'link' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $subforum_id), 'name' => $subforum_row['name'], 'unread' => $subforum_unread, + 'type' => $subforum_row['type'], ); } else @@ -571,6 +573,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'U_SUBFORUM' => $subforum['link'], 'SUBFORUM_NAME' => $subforum['name'], 'S_UNREAD' => $subforum['unread'], + 'IS_LINK' => $subforum['type'] == FORUM_LINK, ); } $s_subforums_list = (string) implode($user->lang['COMMA_SEPARATOR'], $s_subforums_list); diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 0056cbca35..526e18528f 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -431,7 +431,7 @@ class messenger */ function build_header($to, $cc, $bcc) { - global $config; + global $config, $phpbb_dispatcher; // We could use keys here, but we won't do this for 3.0.x to retain backwards compatibility $headers = array(); @@ -463,6 +463,16 @@ class messenger $headers[] = 'X-MimeOLE: phpBB3'; $headers[] = 'X-phpBB-Origin: phpbb://' . str_replace(array('http://', 'https://'), array('', ''), generate_board_url()); + /** + * Event to modify email header entries + * + * @event core.modify_email_headers + * @var array headers Array containing email header entries + * @since 3.1.11-RC1 + */ + $vars = array('headers'); + extract($phpbb_dispatcher->trigger_event('core.modify_email_headers', compact($vars))); + if (sizeof($this->extra_headers)) { $headers = array_merge($headers, $this->extra_headers); diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 3a2004396c..551165c558 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -120,6 +120,15 @@ function generate_smilies($mode, $forum_id) foreach ($smilies as $row) { + /** + * Modify smiley root path before populating smiley list + * + * @event core.generate_smilies_before + * @var string root_path root_path for smilies + * @since 3.1.11-RC1 + */ + $vars = array('root_path'); + extract($phpbb_dispatcher->trigger_event('core.generate_smilies_before', compact($vars))); $template->assign_block_vars('smiley', array( 'SMILEY_CODE' => $row['code'], 'A_SMILEY_CODE' => addslashes($row['code']), diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index f29f974ccf..227ac3fe0c 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2204,7 +2204,7 @@ function phpbb_avatar_explanation_string() { global $config, $user; - return $user->lang('AVATAR_EXPLAIN', + return $user->lang(($config['avatar_filesize'] == 0) ? 'AVATAR_EXPLAIN_NO_FILESIZE' : 'AVATAR_EXPLAIN', $user->lang('PIXELS', (int) $config['avatar_max_width']), $user->lang('PIXELS', (int) $config['avatar_max_height']), round($config['avatar_filesize'] / 1024)); |