mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge pull request #3395 from s9e/ticket/13595
[ticket/13595] Remove unused instances of the bbcode class
This commit is contained in:
commit
098854a822
6 changed files with 3 additions and 65 deletions
|
@ -1036,7 +1036,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms
|
||||||
*/
|
*/
|
||||||
function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true)
|
function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true)
|
||||||
{
|
{
|
||||||
global $user, $auth, $db, $template, $bbcode, $cache;
|
global $user, $auth, $db, $template, $cache;
|
||||||
global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
|
global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
|
||||||
|
|
||||||
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
|
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
|
||||||
|
@ -1094,13 +1094,11 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
||||||
$sql = $db->sql_build_query('SELECT', $sql_ary);
|
$sql = $db->sql_build_query('SELECT', $sql_ary);
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$bbcode_bitfield = '';
|
|
||||||
$rowset = array();
|
$rowset = array();
|
||||||
$has_attachments = false;
|
$has_attachments = false;
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$rowset[$row['post_id']] = $row;
|
$rowset[$row['post_id']] = $row;
|
||||||
$bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
|
|
||||||
|
|
||||||
if ($row['post_attachment'])
|
if ($row['post_attachment'])
|
||||||
{
|
{
|
||||||
|
@ -1109,13 +1107,6 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
// Instantiate BBCode class
|
|
||||||
if (!isset($bbcode) && $bbcode_bitfield !== '')
|
|
||||||
{
|
|
||||||
include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
|
||||||
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Grab extensions
|
// Grab extensions
|
||||||
$extensions = $attachments = array();
|
$extensions = $attachments = array();
|
||||||
if ($has_attachments && $auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id))
|
if ($has_attachments && $auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id))
|
||||||
|
|
|
@ -1957,7 +1957,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
|
||||||
*/
|
*/
|
||||||
function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode = false)
|
function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode = false)
|
||||||
{
|
{
|
||||||
global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth, $bbcode;
|
global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth;
|
||||||
|
|
||||||
// Select all receipts and the author from the pm we currently view, to only display their pm-history
|
// Select all receipts and the author from the pm we currently view, to only display their pm-history
|
||||||
$sql = 'SELECT author_id, user_id
|
$sql = 'SELECT author_id, user_id
|
||||||
|
@ -2009,7 +2009,6 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
|
||||||
$title = $row['message_subject'];
|
$title = $row['message_subject'];
|
||||||
|
|
||||||
$rowset = array();
|
$rowset = array();
|
||||||
$bbcode_bitfield = '';
|
|
||||||
$folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm') . '&folder=';
|
$folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm') . '&folder=';
|
||||||
|
|
||||||
do
|
do
|
||||||
|
@ -2025,7 +2024,6 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$rowset[$row['msg_id']] = $row;
|
$rowset[$row['msg_id']] = $row;
|
||||||
$bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while ($row = $db->sql_fetchrow($result));
|
while ($row = $db->sql_fetchrow($result));
|
||||||
|
@ -2036,16 +2034,6 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instantiate BBCode class
|
|
||||||
if ((empty($bbcode) || $bbcode === false) && $bbcode_bitfield !== '')
|
|
||||||
{
|
|
||||||
if (!class_exists('bbcode'))
|
|
||||||
{
|
|
||||||
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
|
||||||
}
|
|
||||||
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
|
|
||||||
}
|
|
||||||
|
|
||||||
$title = censor_text($title);
|
$title = censor_text($title);
|
||||||
|
|
||||||
$url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
|
$url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
|
||||||
|
|
|
@ -147,21 +147,13 @@ function mcp_topic_view($id, $mode, $action)
|
||||||
$result = $db->sql_query_limit($sql, $posts_per_page, $start);
|
$result = $db->sql_query_limit($sql, $posts_per_page, $start);
|
||||||
|
|
||||||
$rowset = $post_id_list = array();
|
$rowset = $post_id_list = array();
|
||||||
$bbcode_bitfield = '';
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$rowset[] = $row;
|
$rowset[] = $row;
|
||||||
$post_id_list[] = $row['post_id'];
|
$post_id_list[] = $row['post_id'];
|
||||||
$bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
|
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
if ($bbcode_bitfield !== '')
|
|
||||||
{
|
|
||||||
include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
|
||||||
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
|
|
||||||
}
|
|
||||||
|
|
||||||
$topic_tracking_info = array();
|
$topic_tracking_info = array();
|
||||||
|
|
||||||
// Get topic tracking info
|
// Get topic tracking info
|
||||||
|
|
|
@ -53,15 +53,6 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||||
// Grab icons
|
// Grab icons
|
||||||
$icons = $cache->obtain_icons();
|
$icons = $cache->obtain_icons();
|
||||||
|
|
||||||
$bbcode = false;
|
|
||||||
|
|
||||||
// Instantiate BBCode if need be
|
|
||||||
if ($message_row['bbcode_bitfield'])
|
|
||||||
{
|
|
||||||
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
|
||||||
$bbcode = new bbcode($message_row['bbcode_bitfield']);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load the custom profile fields
|
// Load the custom profile fields
|
||||||
if ($config['load_cpf_pm'])
|
if ($config['load_cpf_pm'])
|
||||||
{
|
{
|
||||||
|
|
|
@ -797,7 +797,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$bbcode_bitfield = $text_only_message = '';
|
$text_only_message = '';
|
||||||
$attach_list = array();
|
$attach_list = array();
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
@ -817,7 +817,6 @@ if ($keywords || $author || $author_id || $search_id || $submit)
|
||||||
if ($return_chars == -1 || utf8_strlen($text_only_message) < ($return_chars + 3))
|
if ($return_chars == -1 || utf8_strlen($text_only_message) < ($return_chars + 3))
|
||||||
{
|
{
|
||||||
$row['display_text_only'] = false;
|
$row['display_text_only'] = false;
|
||||||
$bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
|
|
||||||
|
|
||||||
// Does this post have an attachment? If so, add it to the list
|
// Does this post have an attachment? If so, add it to the list
|
||||||
if ($row['post_attachment'] && $config['allow_attachments'])
|
if ($row['post_attachment'] && $config['allow_attachments'])
|
||||||
|
@ -837,13 +836,6 @@ if ($keywords || $author || $author_id || $search_id || $submit)
|
||||||
|
|
||||||
unset($text_only_message);
|
unset($text_only_message);
|
||||||
|
|
||||||
// Instantiate BBCode if needed
|
|
||||||
if ($bbcode_bitfield !== '')
|
|
||||||
{
|
|
||||||
include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
|
||||||
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pull attachment data
|
// Pull attachment data
|
||||||
if (sizeof($attach_list))
|
if (sizeof($attach_list))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1015,7 +1015,6 @@ else
|
||||||
// Container for user details, only process once
|
// Container for user details, only process once
|
||||||
$post_list = $user_cache = $id_cache = $attachments = $attach_list = $rowset = $update_count = $post_edit_list = $post_delete_list = array();
|
$post_list = $user_cache = $id_cache = $attachments = $attach_list = $rowset = $update_count = $post_edit_list = $post_delete_list = array();
|
||||||
$has_unapproved_attachments = $has_approved_attachments = $display_notice = false;
|
$has_unapproved_attachments = $has_approved_attachments = $display_notice = false;
|
||||||
$bbcode_bitfield = '';
|
|
||||||
$i = $i_total = 0;
|
$i = $i_total = 0;
|
||||||
|
|
||||||
// Go ahead and pull all data for this topic
|
// Go ahead and pull all data for this topic
|
||||||
|
@ -1181,15 +1180,6 @@ while ($row = $db->sql_fetchrow($result))
|
||||||
|
|
||||||
$rowset[$row['post_id']] = $rowset_data;
|
$rowset[$row['post_id']] = $rowset_data;
|
||||||
|
|
||||||
// Define the global bbcode bitfield, will be used to load bbcodes
|
|
||||||
$bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
|
|
||||||
|
|
||||||
// Is a signature attached? Are we going to display it?
|
|
||||||
if ($row['enable_sig'] && $config['allow_sig'] && $user->optionget('viewsigs'))
|
|
||||||
{
|
|
||||||
$bbcode_bitfield = $bbcode_bitfield | base64_decode($row['user_sig_bbcode_bitfield']);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cache various user specific data ... so we don't have to recompute
|
// Cache various user specific data ... so we don't have to recompute
|
||||||
// this each time the same user appears on this page
|
// this each time the same user appears on this page
|
||||||
if (!isset($user_cache[$poster_id]))
|
if (!isset($user_cache[$poster_id]))
|
||||||
|
@ -1463,12 +1453,6 @@ if (sizeof($attach_list))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instantiate BBCode if need be
|
|
||||||
if ($bbcode_bitfield !== '')
|
|
||||||
{
|
|
||||||
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the list of users who can receive private messages
|
// Get the list of users who can receive private messages
|
||||||
$can_receive_pm_list = $auth->acl_get_list(array_keys($user_cache), 'u_readpm');
|
$can_receive_pm_list = $auth->acl_get_list(array_keys($user_cache), 'u_readpm');
|
||||||
$can_receive_pm_list = (empty($can_receive_pm_list) || !isset($can_receive_pm_list[0]['u_readpm'])) ? array() : $can_receive_pm_list[0]['u_readpm'];
|
$can_receive_pm_list = (empty($can_receive_pm_list) || !isset($can_receive_pm_list[0]['u_readpm'])) ? array() : $can_receive_pm_list[0]['u_readpm'];
|
||||||
|
|
Loading…
Add table
Reference in a new issue