diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-03-06 14:03:56 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-03-06 14:03:56 +0000 |
commit | c01597499cbfbce0a429b7196a315e1643d9e5c2 (patch) | |
tree | a93e25f2581db47848a99cbde681193e35f6f74f | |
parent | 14b6714c93944b6af9ec01d978cfe7f387dc7e9a (diff) | |
download | forums-c01597499cbfbce0a429b7196a315e1643d9e5c2.tar forums-c01597499cbfbce0a429b7196a315e1643d9e5c2.tar.gz forums-c01597499cbfbce0a429b7196a315e1643d9e5c2.tar.bz2 forums-c01597499cbfbce0a429b7196a315e1643d9e5c2.tar.xz forums-c01597499cbfbce0a429b7196a315e1643d9e5c2.zip |
- added "display_on_posting" setting to custom bbcodes (creates a button with the bbcode tag)
- fixed forum editing and parent id selection
- completely removed HTML support (it only creates security problems)
- changed cache_moderators() to reflect permission changes
git-svn-id: file:///svn/phpbb/trunk@5603 89ea8834-ac86-4346-8a33-228a782c2dd0
42 files changed, 322 insertions, 328 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 37f872dbdd..2120232759 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -15,7 +15,6 @@ define('NEED_SID', true); // Include files $phpbb_root_path = './../'; -$phpbb_admin_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); require($phpbb_root_path . 'common.'.$phpEx); require($phpbb_root_path . 'includes/functions_admin.'.$phpEx); @@ -46,8 +45,9 @@ if (!$auth->acl_get('a_')) trigger_error($user->lang['NO_ADMIN']); } -// We define it now, because the user is now able to use the admin related features... +// We define the admin variables now, because the user is now able to use the admin related features... define('IN_ADMIN', true); +$phpbb_admin_path = './'; // Some oft used variables $safe_mode = (@ini_get('safe_mode') || @strtolower(ini_get('safe_mode')) == 'on') ? true : false; diff --git a/phpBB/adm/style/acp_bbcodes.html b/phpBB/adm/style/acp_bbcodes.html index 5caf3391ec..00af899397 100644 --- a/phpBB/adm/style/acp_bbcodes.html +++ b/phpBB/adm/style/acp_bbcodes.html @@ -30,11 +30,20 @@ </dl> </fieldset> + <fieldset> + <legend>{L_SETTINGS}</legend> + <dl> + <dt><label for="display_on_posting">{L_DISPLAY_ON_POSTING}</label></dt> + <dd><input type="checkbox" name="display_on_posting" id="display_on_posting" value="1"<!-- IF DISPLAY_ON_POSTING --> checked="checked"<!-- ENDIF --> /></dd> + </dl> + </fieldset> + <fieldset class="submit-buttons"> <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> </fieldset> - + + <br /> <table cellspacing="1"> <thead> <tr> diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index e1f2c69152..73e3f65f1c 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -78,7 +78,7 @@ <!-- ENDIF --> <dl> <dt><label for="parent">{L_FORUM_PARENT}:</label></dt> - <dd><select id="parent" name="parent_id"><option value="0"<!-- IF not S_PARENT_ID --> selected="selected"<!-- ENDIF -->>{L_NO_PARENT}</option>{S_PARENT_OPTIONS}</select></dd> + <dd><select id="parent" name="forum_parent_id"><option value="0"<!-- IF not S_FORUM_PARENT_ID --> selected="selected"<!-- ENDIF -->>{L_NO_PARENT}</option>{S_PARENT_OPTIONS}</select></dd> </dl> <dl> <dt><label for="forum_name">{L_FORUM_NAME}:</label></dt> diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html index 35ceefe171..6b3a5b25c9 100644 --- a/phpBB/adm/style/acp_users.html +++ b/phpBB/adm/style/acp_users.html @@ -363,10 +363,6 @@ <dd><input type="radio" class="radio" name="bbcode" value="1"<!-- IF BBCODE --> id="bbcode" checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" class="radio" name="bbcode" value="0"<!-- IF not BBCODE --> id="bbcode" checked="checked"<!-- ENDIF --> /> {L_NO}</dd> </dl> <dl> - <dt><label for="html">{L_DEFAULT_HTML}:</label></dt> - <dd><input type="radio" class="radio" name="html" value="1"<!-- IF HTML --> id="html" checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" class="radio" name="html" value="0"<!-- IF HTML --> id="html" checked="checked"<!-- ENDIF --> /> {L_NO}</dd> - </dl> - <dl> <dt><label for="smilies">{L_DEFAULT_SMILIES}:</label></dt> <dd><input type="radio" class="radio" name="smilies" value="1"<!-- IF SMILIES --> id="smilies" checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" class="radio" name="smilies" value="0"<!-- IF not SMILIES --> id="smilies" checked="checked"<!-- ENDIF --> /> {L_NO}</dd> </dl> @@ -603,11 +599,10 @@ </dt> <dd style="text-align: left; margin-left: 110px;"><textarea name="signature" rows="10" cols="60" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></dd> <dd style="text-align: left; margin-left: 110px;"> - <!-- IF S_HTML_ALLOWED --><input type="checkbox" name="disable_html"{S_HTML_CHECKED} /> {L_DISABLE_HTML} <!-- ENDIF --> <!-- IF S_BBCODE_ALLOWED --><input type="checkbox" name="disable_bbcode"{S_BBCODE_CHECKED} /> {L_DISABLE_BBCODE} <!-- ENDIF --> <!-- IF S_SMILIES_ALLOWED --><input type="checkbox" name="disable_smilies"{S_SMILIES_CHECKED} /> {L_DISABLE_SMILIES} <!-- ENDIF --> <input type="checkbox" name="disable_magic_url"{S_MAGIC_URL_CHECKED} /> {L_DISABLE_MAGIC_URL} - <br /><br /><strong>{L_OPTIONS}: </strong>{HTML_STATUS} :: {BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {SMILIES_STATUS} + <br /><br /><strong>{L_OPTIONS}: </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {SMILIES_STATUS} </dd> </dl> </fieldset> diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 81ccd1daaa..9f17ae0c2f 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -34,10 +34,11 @@ class acp_bbcodes { case 'add': $bbcode_match = $bbcode_tpl = ''; + $display_on_posting = 0; break; case 'edit': - $sql = 'SELECT bbcode_match, bbcode_tpl + $sql = 'SELECT bbcode_match, bbcode_tpl, display_on_posting FROM ' . BBCODES_TABLE . ' WHERE bbcode_id = ' . $bbcode_id; $result = $db->sql_query($sql); @@ -50,6 +51,7 @@ class acp_bbcodes $bbcode_match = $row['bbcode_match']; $bbcode_tpl = htmlspecialchars($row['bbcode_tpl']); + $display_on_posting = $row['display_on_posting']; break; case 'modify': @@ -67,6 +69,8 @@ class acp_bbcodes // No break here case 'create': + $display_on_posting = request_var('display_on_posting', 0); + $bbcode_match = (isset($_POST['bbcode_match'])) ? htmlspecialchars(stripslashes($_POST['bbcode_match'])) : ''; $bbcode_tpl = (isset($_POST['bbcode_tpl'])) ? stripslashes($_POST['bbcode_tpl']) : ''; break; @@ -83,9 +87,9 @@ class acp_bbcodes 'U_BACK' => $this->u_action, 'U_ACTION' => $this->u_action . '&action=' . (($action == 'add') ? 'create' : 'modify') . (($bbcode_id) ? "&bbcode=$bbcode_id" : ''), - 'BBCODE_MATCH' => $bbcode_match, - 'BBCODE_TPL' => $bbcode_tpl, - ) + 'BBCODE_MATCH' => $bbcode_match, + 'BBCODE_TPL' => $bbcode_tpl, + 'DISPLAY_ON_POSTING' => $display_on_posting) ); foreach ($user->lang['tokens'] as $token => $token_explain) @@ -109,6 +113,7 @@ class acp_bbcodes 'bbcode_tag' => $data['bbcode_tag'], 'bbcode_match' => $bbcode_match, 'bbcode_tpl' => $bbcode_tpl, + 'display_on_posting' => $display_on_posting, 'first_pass_match' => $data['first_pass_match'], 'first_pass_replace' => $data['first_pass_replace'], 'second_pass_match' => $data['second_pass_match'], @@ -170,6 +175,7 @@ class acp_bbcodes break; case 'delete': + $sql = 'SELECT bbcode_tag FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id"; @@ -186,7 +192,7 @@ class acp_bbcodes } $template->assign_vars(array( - 'U_ACTION' => $this->u_action . '&mode=add') + 'U_ACTION' => $this->u_action . '&action=add') ); $sql = 'SELECT * @@ -312,7 +318,7 @@ class acp_bbcodes } // Lowercase tags - $bbcode_tag = preg_replace('/.*?\[([a-z]+).*/i', '$1', $msg_bbcode); + $bbcode_tag = preg_replace('/.*?\[([a-z]+=?).*/i', '$1', $msg_bbcode); $fp_match = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $fp_match); $fp_replace = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $fp_replace); $sp_match = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $sp_match); diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 1414bbdc82..ace7dd4990 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -117,7 +117,6 @@ class acp_board 'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'type' => 'text::255', 'explain' => true), 'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false), 'board_dst' => array('lang' => 'SYSTEM_DST', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_html_tags' => array('lang' => 'ALLOWED_TAGS', 'type' => 'text:30:255', 'explain' => true), 'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'type' => 'text:5:4', 'explain' => true), 'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'type' => 'text:5:4', 'explain' => true), 'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'type' => 'text:5:4', 'explain' => true), @@ -131,14 +130,12 @@ class acp_board 'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false), 'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'type' => 'radio:yes_no', 'explain' => false), 'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_html' => array('lang' => 'ALLOW_HTML', 'type' => 'radio:yes_no', 'explain' => false), 'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'type' => 'radio:yes_no', 'explain' => false), 'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'type' => 'radio:yes_no', 'explain' => false), 'allow_sig' => array('lang' => 'ALLOW_SIG', 'type' => 'radio:yes_no', 'explain' => false), 'allow_sig_bbcode' => array('lang' => 'ALLOW_SIG_BBCODE', 'type' => 'radio:yes_no', 'explain' => false), 'allow_sig_img' => array('lang' => 'ALLOW_SIG_IMG', 'type' => 'radio:yes_no', 'explain' => false), 'allow_sig_flash' => array('lang' => 'ALLOW_SIG_FLASH', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_sig_html' => array('lang' => 'ALLOW_SIG_HTML', 'type' => 'radio:yes_no', 'explain' => false), 'allow_sig_smilies' => array('lang' => 'ALLOW_SIG_SMILIES', 'type' => 'radio:yes_no', 'explain' => false), 'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'type' => 'radio:yes_no', 'explain' => true), 'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'type' => 'radio:yes_no', 'explain' => true) @@ -253,7 +250,6 @@ class acp_board 'legend2' => 'GENERAL_OPTIONS', 'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_html_pm' => array('lang' => 'ALLOW_HTML_PM', 'type' => 'radio:yes_no', 'explain' => false), 'auth_bbcode_pm' => array('lang' => 'ALLOW_BBCODE_PM', 'type' => 'radio:yes_no', 'explain' => false), 'auth_smilies_pm' => array('lang' => 'ALLOW_SMILIES_PM', 'type' => 'radio:yes_no', 'explain' => false), 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false), diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 00052b8d23..3869a3ac4a 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -91,7 +91,7 @@ class acp_forums case 'add': $forum_data += array( - 'parent_id' => $this->parent_id, + 'parent_id' => request_var('forum_parent_id', $this->parent_id), 'forum_type' => request_var('forum_type', FORUM_POST), 'type_action' => request_var('type_action', ''), 'forum_status' => request_var('forum_status', ITEM_UNLOCKED), @@ -132,7 +132,7 @@ class acp_forums $forum_data['forum_rules_flags'] = (($allow_bbcode) ? 1 : 0) + (($allow_smilies) ? 2 : 0) + (($allow_urls) ? 4 : 0); $message_parser = new parse_message($forum_data['forum_rules']); - $message_parser->parse(false, $allow_bbcode, $allow_urls, $allow_smilies); + $message_parser->parse($allow_bbcode, $allow_urls, $allow_smilies); $forum_data['forum_rules'] = $message_parser->message; $forum_data['forum_rules_bbcode_uid'] = $message_parser->bbcode_uid; @@ -363,7 +363,7 @@ class acp_forums $forum_data = $row; } - $parents_list = make_forum_select($this->parent_id, $forum_id, false, false, false); + $parents_list = make_forum_select($forum_data['parent_id'], $forum_id, false, false, false); $forum_data['forum_password_confirm'] = $forum_data['forum_password']; } @@ -421,10 +421,10 @@ class acp_forums } else { - $message_parser->parse(false, ($forum_data['forum_rules_flags'] & 1), ($forum_data['forum_rules_flags'] & 4), ($forum_data['forum_rules_flags'] & 2)); + $message_parser->parse(($forum_data['forum_rules_flags'] & 1), ($forum_data['forum_rules_flags'] & 4), ($forum_data['forum_rules_flags'] & 2)); } - $forum_rules_preview = $message_parser->format_display(false, ($forum_data['forum_rules_flags'] & 1), ($forum_data['forum_rules_flags'] & 4), ($forum_data['forum_rules_flags'] & 2), false); + $forum_rules_preview = $message_parser->format_display(($forum_data['forum_rules_flags'] & 1), ($forum_data['forum_rules_flags'] & 4), ($forum_data['forum_rules_flags'] & 2), false); $forum_rules_plain = $message_parser->decode_message('', false); } @@ -449,17 +449,17 @@ class acp_forums if ($db->sql_fetchrow($result)) { $template->assign_vars(array( - 'S_MOVE_FORUM_OPTIONS' => make_forum_select($this->parent_id, $forum_id, false, true, false)) + 'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $forum_id, false, true, false)) ); } $db->sql_freeresult($result); $s_show_display_on_index = false; - if ($action == 'edit' && $this->parent_id > 0) + if ($action == 'edit' && $forum_data['parent_id'] > 0) { // if this forum is a subforum put the "display on index" checkbox - if ($parent_info = $this->get_forum_info($this->parent_id)) + if ($parent_info = $this->get_forum_info($forum_data['parent_id'])) { if ($parent_info['parent_id'] > 0 || $parent_info['forum_type'] == FORUM_CAT) { @@ -469,10 +469,11 @@ class acp_forums } $template->assign_vars(array( - 'S_EDIT_FORUM' => true, - 'S_ERROR' => (sizeof($errors)) ? true : false, - 'S_PARENT_ID' => $this->parent_id, - 'S_ADD_ACTION' => ($action == 'add') ? true : false, + 'S_EDIT_FORUM' => true, + 'S_ERROR' => (sizeof($errors)) ? true : false, + 'S_PARENT_ID' => $this->parent_id, + 'S_FORUM_PARENT_ID' => $forum_data['parent_id'], + 'S_ADD_ACTION' => ($action == 'add') ? true : false, 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, 'U_EDIT_ACTION' => $this->u_action . "&parent_id={$this->parent_id}&action=$action&f=$forum_id", @@ -545,7 +546,7 @@ class acp_forums $subforums_id[] = $row['forum_id']; } - $forums_list = make_forum_select($this->parent_id, $subforums_id); + $forums_list = make_forum_select($forum_data['parent_id'], $subforums_id); $sql = 'SELECT forum_id FROM ' . FORUMS_TABLE . ' @@ -556,14 +557,16 @@ class acp_forums if ($db->sql_fetchrow($result)) { $template->assign_vars(array( - 'S_MOVE_FORUM_OPTIONS' => make_forum_select($this->parent_id, $subforums_id)) // , false, true, false??? + 'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $subforums_id)) // , false, true, false??? ); } $db->sql_freeresult($result); + $parent_id = ($this->parent_id == $forum_id) ? 0 : $this->parent_id; + $template->assign_vars(array( 'S_DELETE_FORUM' => true, - 'U_ACTION' => $this->u_action . "&parent_id={$this->parent_id}&action=delete&f=$forum_id", + 'U_ACTION' => $this->u_action . "&parent_id={$parent_id}&action=delete&f=$forum_id", 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, 'FORUM_NAME' => $forum_data['forum_name'], @@ -1209,6 +1212,10 @@ class acp_forums case 'POSTS_': add_log('admin', 'LOG_FORUM_DEL_POSTS', $forum_data['forum_name']); break; + + default: + add_log('admin', 'LOG_FORUM_DEL_FORUM', $forum_data['forum_name']); + break; } return $errors; diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index af9918ea37..999336ceb9 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1015,7 +1015,6 @@ class acp_users 'view_wordcensor' => false, 'bbcode' => true, - 'html' => false, 'smilies' => true, 'sig' => true, 'notify' => false, @@ -1050,7 +1049,6 @@ class acp_users $this->optionset($user_row, 'viewavatars', $data['view_avatars']); $this->optionset($user_row, 'viewcensors', $data['view_wordcensor']); $this->optionset($user_row, 'bbcode', $data['bbcode']); - $this->optionset($user_row, 'html', $data['html']); $this->optionset($user_row, 'smilies', $data['smilies']); $this->optionset($user_row, 'attachsig', $data['sig']); @@ -1181,7 +1179,6 @@ class acp_users 'REPORT_PM_NOTIFY' => (isset($data['report_pm_notify'])) ? $data['report_pm_notify'] : $this->optionget($user_row, 'report_pm_notify'), 'DST' => (isset($data['dst'])) ? $data['dst'] : $user_row['user_dst'], 'BBCODE' => (isset($data['bbcode'])) ? $data['bbcode'] : $this->optionget($user_row, 'bbcode'), - 'HTML' => (isset($data['html'])) ? $data['html'] : $this->optionget($user_row, 'html'), 'SMILIES' => (isset($data['smilies'])) ? $data['smilies'] : $this->optionget($user_row, 'smilies'), 'ATTACH_SIG' => (isset($data['sig'])) ? $data['sig'] : $this->optionget($user_row, 'attachsig'), 'NOTIFY' => (isset($data['notify'])) ? $data['notify'] : $user_row['user_notify'], @@ -1398,7 +1395,6 @@ class acp_users include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); - $enable_html = ($config['allow_sig_html']) ? request_var('enable_html', false) : false; $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; $enable_urls = request_var('enable_urls', true); @@ -1413,7 +1409,7 @@ class acp_users $message_parser = new parse_message($signature); // Allowing Quote BBCode - $message_parser->parse($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, true, 'sig'); + $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, true, 'sig'); if (sizeof($message_parser->warn_msg)) { @@ -1445,7 +1441,7 @@ class acp_users if ($preview) { // Now parse it for displaying - $signature_preview = $message_parser->format_display($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, false); + $signature_preview = $message_parser->format_display($enable_bbcode, $enable_urls, $enable_smilies, false); unset($message_parser); } @@ -1457,12 +1453,10 @@ class acp_users 'SIGNATURE' => $signature, 'SIGNATURE_PREVIEW' => $signature_preview, - 'S_HTML_CHECKED' => (!$enable_html) ? 'checked="checked"' : '', 'S_BBCODE_CHECKED' => (!$enable_bbcode) ? 'checked="checked"' : '', 'S_SMILIES_CHECKED' => (!$enable_smilies) ? 'checked="checked"' : '', 'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? 'checked="checked"' : '', - 'HTML_STATUS' => ($config['allow_sig_html']) ? $user->lang['HTML_IS_ON'] : $user->lang['HTML_IS_OFF'], 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . $phpbb_root_path . "faq.$phpEx$SID&mode=bbcode" . '" onclick="target=\'_phpbbcode\';">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . "{$phpbb_root_path}faq.$phpEx$SID&mode=bbcode" . '" onclick="target=\'_phpbbcode\';">', '</a>'), 'SMILIES_STATUS' => ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], 'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], @@ -1470,7 +1464,6 @@ class acp_users 'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']), - 'S_HTML_ALLOWED' => $config['allow_sig_html'], 'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'], 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'],) ); diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index ba830857ea..3812a3719e 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1771,95 +1771,136 @@ function split_sql_file($sql, $delimiter) /** * Cache moderators, called whenever permissions are changed via admin_permissions. Changes of username * and group names must be carried through for the moderators table +* +* @todo let the admin define if he wants to display moderators (forum-based) - display_on_index already present and checked for... */ function cache_moderators() { - global $db, $cache; + global $db, $cache, $auth, $phpbb_root_path, $phpEx; // Clear table $sql = (SQL_LAYER != 'sqlite') ? 'TRUNCATE ' . MODERATOR_TABLE : 'DELETE FROM ' . MODERATOR_TABLE; $db->sql_query($sql); - // Holding array - $m_sql = array(); - $user_id_sql = ''; + // We add moderators who have forum moderator permissions without an explicit ACL_NO setting + $hold_ary = $ug_id_ary = $sql_ary = array(); - $sql = 'SELECT a.forum_id, u.user_id, u.username - FROM ' . ACL_OPTIONS_TABLE . ' o, ' . ACL_USERS_TABLE . ' a, ' . USERS_TABLE . " u - WHERE o.auth_option = 'm_' - AND a.auth_option_id = o.auth_option_id - AND a.auth_setting = " . ACL_YES . ' - AND u.user_id = a.user_id'; - $result = $db->sql_query($sql); + // Grab all users having moderative options... + $hold_ary = $auth->acl_user_raw_data(false, 'm_%', false); - while ($row = $db->sql_fetchrow($result)) + // Add users? + if (sizeof($hold_ary)) { - $m_sql['f_' . $row['forum_id'] . '_u_' . $row['user_id']] = $row['forum_id'] . ', ' . $row['user_id'] . ", '" . $row['username'] . "', NULL, NULL"; - $user_id_sql .= (($user_id_sql) ? ', ' : '') . $row['user_id']; - } - $db->sql_freeresult($result); + // At least one moderative option warrants a display + $ug_id_ary = array_keys($hold_ary); - // Remove users who have group memberships with DENY moderator permissions - if ($user_id_sql) - { + // Remove users who have group memberships with DENY moderator permissions $sql = 'SELECT a.forum_id, ug.user_id - FROM ' . ACL_OPTIONS_TABLE . ' o, ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . " ug - WHERE o.auth_option = 'm_' - AND a.auth_option_id = o.auth_option_id - AND a.auth_setting = " . ACL_NO . " + FROM (' . ACL_OPTIONS_TABLE . ' o, ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug) + LEFT JOIN ' . ACL_ROLES_DATA_TABLE . ' r ON (a.auth_role_id = r.role_id) + WHERE (o.auth_option_id = a.auth_option_id OR o.auth_option_id = r.auth_option_id) + AND ((a.auth_setting = ' . ACL_NO . ' AND r.auth_setting IS NULL) + OR r.auth_setting = ' . ACL_NO . ') AND a.group_id = ug.group_id - AND ug.user_id IN ($user_id_sql)"; + AND ug.user_id IN (' . implode(', ', $ug_id_ary) . ") + AND o.auth_option LIKE 'm\_%'"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - unset($m_sql['f_' . $row['forum_id'] . '_u_' . $row['user_id']]); + if (isset($hold_ary[$row['user_id']][$row['forum_id']])) + { + unset($hold_ary[$row['user_id']][$row['forum_id']]); + } } $db->sql_freeresult($result); + + if (sizeof($hold_ary)) + { + // Get usernames... + $sql = 'SELECT user_id, username + FROM ' . USERS_TABLE . ' + WHERE user_id IN (' . implode(', ', array_keys($hold_ary)) . ')'; + $result = $db->sql_query($sql); + + $usernames_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $usernames_ary[$row['user_id']] = $row['username']; + } + + foreach ($hold_ary as $user_id => $forum_id_ary) + { + foreach ($forum_id_ary as $forum_id => $auth_ary) + { + $sql_ary[] = array( + 'forum_id' => $forum_id, + 'user_id' => $user_id, + 'username' => $usernames_ary[$user_id], + 'group_id' => 0, + 'groupname' => '' + ); + } + } + } } - $sql = 'SELECT a.forum_id, g.group_name, g.group_id - FROM ' . ACL_OPTIONS_TABLE . ' o, ' . ACL_GROUPS_TABLE . ' a, ' . GROUPS_TABLE . " g - WHERE o.auth_option = 'm_' - AND a.auth_option_id = o.auth_option_id - AND a.auth_setting = " . ACL_YES . ' - AND g.group_id = a.group_id - AND g.group_type NOT IN (' . GROUP_HIDDEN . ', ' . GROUP_SPECIAL . ')'; - $result = $db->sql_query($sql); + // Now to the groups... + $hold_ary = $auth->acl_group_raw_data(false, 'm_%', false); - while ($row = $db->sql_fetchrow($result)) + if (sizeof($hold_ary)) { - $m_sql['f_' . $row['forum_id'] . '_g_' . $row['group_id']] = $row['forum_id'] . ', NULL, NULL, ' . $row['group_id'] . ", '" . $row['group_name'] . "'"; + $ug_id_ary = array_keys($hold_ary); + + // Make sure not hidden or special groups are involved... + $sql = 'SELECT group_name, group_id, group_type + FROM ' . GROUPS_TABLE . ' + WHERE group_id IN (' . implode(', ', $ug_id_ary) . ')'; + $result = $db->sql_query($sql); + + $groupnames_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + if ($row['group_type'] == GROUP_HIDDEN || $row['group_type'] == GROUP_SPECIAL) + { + unset($hold_ary[$row['group_id']]); + } + + $groupnames_ary[$row['group_id']] = $row['group_name']; + } + $db->sql_freeresult($result); + + foreach ($hold_ary as $group_id => $forum_id_ary) + { + foreach ($forum_id_ary as $forum_id => $auth_ary) + { + $sql_ary[] = array( + 'forum_id' => $forum_id, + 'user_id' => 0, + 'username' => '', + 'group_id' => $group_id, + 'groupname' => $groupnames_ary[$group_id] + ); + } + } } - $db->sql_freeresult($result); - if (sizeof($m_sql)) + if (sizeof($sql_ary)) { switch (SQL_LAYER) { case 'mysql': - $sql = 'INSERT INTO ' . MODERATOR_TABLE . ' (forum_id, user_id, username, group_id, groupname) - VALUES ' . implode(', ', preg_replace('#^(.*)$#', '(\1)', $m_sql)); - $db->sql_query($sql); - break; - case 'mysql4': case 'mysqli': - case 'mssql': - case 'mssql_odbc': - case 'sqlite': - $sql = 'INSERT INTO ' . MODERATOR_TABLE . ' (forum_id, user_id, username, group_id, groupname) - ' . implode(' UNION ALL ', preg_replace('#^(.*)$#', 'SELECT \1', $m_sql)); - $db->sql_query($sql); - break; + $db->sql_query('INSERT INTO ' . MODERATOR_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); + break; default: - foreach ($m_sql as $k => $sql) + foreach ($sql_ary as $ary) { - $sql = 'INSERT INTO ' . MODERATOR_TABLE . " (forum_id, user_id, username, group_id, groupname) - VALUES ($sql)"; - $db->sql_query($sql); + $db->sql_query('INSERT INTO ' . MODERATOR_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); } + break; } } } diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 3670d118c5..28f2ef40fd 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -490,7 +490,6 @@ function decode_message(&$message, $bbcode_uid = '') '#<!\-\- w \-\-><a href="http:\/\/(.*?)" target="_blank">.*?</a><!\-\- w \-\->#', '#<!\-\- l \-\-><a href="(.*?)">.*?</a><!\-\- l \-\->#', '#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#', - '#<!\-\- h \-\-><(.*?)><!\-\- h \-\->#', '#<.*?>#s' ); diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index dffa4717c5..a7e8dcd884 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1164,7 +1164,6 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr 'author_ip' => $data['from_user_ip'], 'message_time' => $current_time, 'enable_bbcode' => $data['enable_bbcode'], - 'enable_html' => $data['enable_html'], 'enable_smilies' => $data['enable_smilies'], 'enable_magic_url' => $data['enable_urls'], 'enable_sig' => $data['enable_sig'], @@ -1185,7 +1184,6 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr 'icon_id' => $data['icon_id'], 'message_edit_time' => $current_time, 'enable_bbcode' => $data['enable_bbcode'], - 'enable_html' => $data['enable_html'], 'enable_smilies' => $data['enable_smilies'], 'enable_magic_url' => $data['enable_urls'], 'enable_sig' => $data['enable_sig'], diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 606976c99b..495c9ef08b 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -390,12 +390,14 @@ class custom_profile { case 'int': return (int) $value; - break; + break; + case 'string': return str_replace("\n", '<br />', $value); - break; + break; + case 'text': - // Prepare further, censor_text, smilies, bbcode, html, whatever + // Prepare further, censor_text, smilies, bbcode, whatever if ($ident_ary['data']['bbcode_bitfield']) { $bbcode = new bbcode($ident_ary['data']['bbcode_bitfield']); @@ -404,9 +406,11 @@ class custom_profile $value = censor_text($value); } return str_replace("\n", '<br />', $value); - break; + break; + case 'date': - break; + break; + case 'dropdown': $field_id = $ident_ary['data']['field_id']; $lang_id = $ident_ary['data']['lang_id']; @@ -416,12 +420,14 @@ class custom_profile } return $this->options_lang[$field_id][$lang_id][(int) $value]; - break; + break; + case 'bool': - break; + break; + default: trigger_error('Unknown profile type'); - break; + break; } } @@ -665,6 +671,7 @@ class custom_profile switch ($profile_row['field_type']) { case FIELD_DATE: + if (!isset($_REQUEST[$var_name . '_day'])) { if ($profile_row['field_default_value'] == 'now') @@ -682,25 +689,30 @@ class custom_profile } $var = sprintf('%2d-%2d-%4d', $day, $month, $year); - break; + break; + case FIELD_TEXT: - include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx); + include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx); - $message_parser = new parse_message(request_var($var_name, '')); + $message_parser = new parse_message(request_var($var_name, '')); - // Get the allowed settings from the global settings. Magic URLs are always set to true. - // TODO: It might be nice to make this a per field setting. - $message_parser->parse($config['allow_html'], $config['allow_bbcode'], true, $config['allow_smilies']); - $var = array( - $profile_row['field_ident'] => $message_parser->message, - $profile_row['field_ident'] . '_bbcode_uid' => $message_parser->bbcode_uid, - $profile_row['field_ident'] . '_bbcode_bitfield' => $message_parser->bbcode_bitfield, - 'submitted' => request_var($var_name, '') - ); - break; + /** + * Get the allowed settings from the global settings. Magic URLs are always set to true. + * @todo It might be nice to make this a per field setting. + */ + $message_parser->parse($config['allow_bbcode'], true, $config['allow_smilies']); + + $var = array( + $profile_row['field_ident'] => $message_parser->message, + $profile_row['field_ident'] . '_bbcode_uid' => $message_parser->bbcode_uid, + $profile_row['field_ident'] . '_bbcode_bitfield' => $message_parser->bbcode_bitfield, + 'submitted' => request_var($var_name, '') + ); + break; + default: $var = request_var($var_name, $profile_row['field_default_value']); - break; + break; } return $var; diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 28f8acd57c..269fee2c26 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1321,6 +1321,11 @@ function group_delete($group_id, $group_name = false) WHERE group_id = $group_id"; $db->sql_query($sql); + // Delete auth entries from the groups table + $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . " + WHERE group_id = $group_id"; + $db->sql_query($sql); + add_log('admin', 'LOG_GROUP_DELETE', $group_name); return false; diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 06c06cd98a..0143957223 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -847,7 +847,6 @@ function mcp_fork_topic($topic_ids) 'post_approved' => 1, 'post_reported' => 0, 'enable_bbcode' => (int) $row['enable_bbcode'], - 'enable_html' => (int) $row['enable_html'], 'enable_smilies' => (int) $row['enable_smilies'], 'enable_magic_url' => (int) $row['enable_magic_url'], 'enable_sig' => (int) $row['enable_sig'], diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 317713625f..044c261873 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -105,13 +105,6 @@ function mcp_topic_view($id, $mode, $action) $message = $row['post_text']; $post_subject = ($row['post_subject'] != '') ? $row['post_subject'] : $topic_info['topic_title']; - // If the board has HTML off but the post has HTML - // on then we process it, else leave it alone - if (!$config['allow_html'] && $row['enable_html']) - { - $message = preg_replace('#(<)([\/]?.*?)(>)#is', '<\\2>', $message); - } - if ($row['bbcode_bitfield']) { $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']); diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 9872387b78..d0ffb37874 100755 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -262,12 +262,6 @@ function mcp_warn_post_view($id, $mode, $action) // Parse the message and subject $message = $userrow['post_text']; - // If the board has HTML off but the post has HTML on then we process it, else leave it alone - if (!$auth->acl_get('f_html', $userrow['forum_id']) && $row['enable_html']) - { - $message = preg_replace('#(<!\-\- h \-\-><)([\/]?.*?)(><!\-\- h \-\->)#is', "<\\2>", $message); - } - // Second parse bbcode here if ($userrow['bbcode_bitfield']) { @@ -277,12 +271,6 @@ function mcp_warn_post_view($id, $mode, $action) // Always process smilies after parsing bbcodes $message = smiley_text($message); - if ($userrow['enable_html'] && $auth->acl_get('f_html', $userrow['forum_id'])) - { - // Remove Comments from post content - $message = preg_replace('#<!\-\-(.*?)\-\->#is', '', $message); - } - // Replace naughty words such as farty pants $message = str_replace("\n", '<br />', censor_text($message)); @@ -391,7 +379,7 @@ function add_warning($userrow, $warning, $send_pm = true, $post_id = 0) $message_parser = new parse_message(); $message_parser->message = sprintf($lang['WARNING_PM_BODY'], $warning); $message_md5 = md5($message_parser->message); - $message_parser->parse(false, true, true, true, false, false, true); + $message_parser->parse(true, true, true, false, false, true); $pm_data = array( 'from_user_id' => $user->data['user_id'], @@ -399,7 +387,6 @@ function add_warning($userrow, $warning, $send_pm = true, $post_id = 0) 'from_username' => $user->data['username'], 'enable_sig' => false, 'enable_bbcode' => true, - 'enable_html' => false, 'enable_smilies' => true, 'enable_urls' => false, 'icon_id' => 0, diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index dc206d1ba1..f5386f1fd7 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -113,7 +113,13 @@ class bbcode_firstpass extends bbcode 'flash' => array('bbcode_id' => 11, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#ie' => "\$this->bbcode_flash('\$1', '\$2', '\$3')")) ); - $this->parsed_items = array('code' => 0, 'quote' => 0, 'attachment' => 0, 'b' => 0, 'i' => 0, 'url' => 0, 'img' => 0, 'size' => 0, 'color' => 0, 'u' => 0, 'list' => 0, 'email' => 0, 'flash' => 0); + // Zero the parsed items array + $this->parsed_items = array(); + + foreach ($this->bbcodes as $tag => $bbcode_data) + { + $this->parsed_items[$tag] = 0; + } if (!is_array($rowset)) { @@ -128,8 +134,9 @@ class bbcode_firstpass extends bbcode { $rowset[] = $row; } + $db->sql_freeresult($result); } - + foreach ($rowset as $row) { $this->bbcodes[$row['bbcode_tag']] = array( @@ -279,7 +286,6 @@ class bbcode_firstpass extends bbcode '#<!\-\- w \-\-><a href="http:\/\/(.*?)" target="_blank">.*?</a><!\-\- w \-\->#', '#<!\-\- l \-\-><a href="(.*?)">.*?</a><!\-\- l \-\->#', '#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#', - '#<!\-\- h \-\-><(.*?)><!\-\- h \-\->#', '#&\#([0-9]+);#', ); $htm_replace = array('\1', '\1', '\1', '\1', '\1', '<\1>', '&#\1;'); @@ -694,7 +700,7 @@ class bbcode_firstpass extends bbcode /** * @package phpBB3 * Main message parser for posting, pm, etc. takes raw message -* and parses it for attachments, html, bbcode and smilies +* and parses it for attachments, bbcode and smilies */ class parse_message extends bbcode_firstpass { @@ -723,7 +729,7 @@ class parse_message extends bbcode_firstpass } // Parse Message : public - function parse($allow_html, $allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $update_this_message = true, $mode = 'post') + function parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $update_this_message = true, $mode = 'post') { global $config, $db, $user; @@ -766,12 +772,6 @@ class parse_message extends bbcode_firstpass } } - // Parse HTML - if ($allow_html && $config['allow_html_tags']) - { - $this->html($config['allow_html_tags']); - } - // Parse smilies if ($allow_smilies) { @@ -827,7 +827,7 @@ class parse_message extends bbcode_firstpass } // Formatting text for display - function format_display($allow_html, $allow_bbcode, $allow_magic_url, $allow_smilies, $update_this_message = true) + function format_display($allow_bbcode, $allow_magic_url, $allow_smilies, $update_this_message = true) { // If false, then the parsed message get returned but internal message not processed. if (!$update_this_message) @@ -839,7 +839,7 @@ class parse_message extends bbcode_firstpass if ($this->message_status == 'plain') { // Force updating message - of course. - $this->parse($allow_html, $allow_bbcode, $allow_magic_url, $allow_smilies, $this->allow_img_bbcode, $this->allow_flash_bbcode, $this->allow_quote_bbcode, true); + $this->parse($allow_bbcode, $allow_magic_url, $allow_smilies, $this->allow_img_bbcode, $this->allow_flash_bbcode, $this->allow_quote_bbcode, true); } // Parse BBcode @@ -889,19 +889,6 @@ class parse_message extends bbcode_firstpass $this->message_status = 'plain'; } - // Parse HTML - function html($allowed_tags) - { - // If $allow_html is true then "allowed_tags" are converted back from entity - // form, others remain - $allowed_tags = split(',', $allowed_tags); - - if (sizeof($allowed_tags)) - { - $this->message = preg_replace('#<(\/?)(' . str_replace('*', '.*?', implode('|', $allowed_tags)) . ')>#is', '<!-- h --><$1$2><!-- h -->', $this->message); - } - } - // Replace magic urls of form http://xxx.xxx., www.xxx. and xxx@xxx.xxx. // Cuts down displayed size of link if over 50 chars, turns absolute links // into relative versions when the server/script path matches the link @@ -916,7 +903,7 @@ class parse_message extends bbcode_firstpass // Be sure to not let the matches cross over. ;) // relative urls for this board - $match[] = '#(^|[\n ]|\()(' . preg_quote($server_url, '#') . ')/([^ \t\n\r<"\'\)&]+|&(?!lt;))*)#i'; + $match[] = '#(^|[\n ]|\()(' . preg_quote($server_url, '#') . ')/([^ \t\n\r<"\'\)&]+|&(?!lt;))*#i'; $replace[] = '$1<!-- l --><a href="$2/$3">$3</a><!-- l -->'; // matches a xxxx://aaaaa.bbb.cccc. ... @@ -1184,7 +1171,7 @@ class parse_message extends bbcode_firstpass $this->message = $poll['poll_option_text']; $bbcode_bitfield = $this->bbcode_bitfield; - $poll['poll_option_text'] = $this->parse($poll['enable_html'], $poll['enable_bbcode'], $poll['enable_urls'], $poll['enable_smilies'], $poll['img_status'], false, false, false); + $poll['poll_option_text'] = $this->parse($poll['enable_bbcode'], $poll['enable_urls'], $poll['enable_smilies'], $poll['img_status'], false, false, false); $this->bbcode_bitfield |= $bbcode_bitfield; $this->message = $tmp_message; @@ -1194,7 +1181,7 @@ class parse_message extends bbcode_firstpass $this->message = $poll['poll_title']; $bbcode_bitfield = $this->bbcode_bitfield; - $poll['poll_title'] = $this->parse($poll['enable_html'], $poll['enable_bbcode'], $poll['enable_urls'], $poll['enable_smilies'], $poll['img_status'], false, false, false); + $poll['poll_title'] = $this->parse($poll['enable_bbcode'], $poll['enable_urls'], $poll['enable_smilies'], $poll['img_status'], false, false, false); $this->bbcode_bitfield |= $bbcode_bitfield; $this->message = $tmp_message; diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 9bf6068e46..5888d579f1 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -772,7 +772,8 @@ class user extends session var $lang_path; var $img_lang; - var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'html' => 7, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10, 'report_pm_notify' => 11); + // Able to add new option (id 7) + var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10, 'report_pm_notify' => 11); var $keyvalues = array(); function setup($lang_set = false, $style = false) diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 2ab9bcdca3..e49edc0f7f 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -97,7 +97,7 @@ function compose_pm($id, $mode, $action) if ($action == 'quotepost') { - $sql = 'SELECT p.post_id as msg_id, p.post_text as message_text, p.poster_id as author_id, p.post_time as message_time, p.bbcode_bitfield, p.bbcode_uid, p.enable_sig, p.enable_html, p.enable_smilies, p.enable_magic_url, t.topic_title as message_subject, u.username as quote_username + $sql = 'SELECT p.post_id as msg_id, p.post_text as message_text, p.poster_id as author_id, p.post_time as message_time, p.bbcode_bitfield, p.bbcode_uid, p.enable_sig, p.enable_smilies, p.enable_magic_url, t.topic_title as message_subject, u.username as quote_username FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . " u WHERE p.post_id = $msg_id AND t.topic_id = p.topic_id @@ -210,7 +210,7 @@ function compose_pm($id, $mode, $action) } else { - $check_value = (($post['enable_html']+1) << 16) + (($post['enable_bbcode']+1) << 8) + (($post['enable_smilies']+1) << 4) + (($enable_urls+1) << 2) + (($post['enable_sig']+1) << 1); + $check_value = (($post['enable_bbcode']+1) << 8) + (($post['enable_smilies']+1) << 4) + (($enable_urls+1) << 2) + (($post['enable_sig']+1) << 1); } } else @@ -347,7 +347,6 @@ function compose_pm($id, $mode, $action) $message_parser->bbcode_uid = $bbcode_uid; } - $html_status = ($config['allow_html'] && $config['auth_html_pm'] && $auth->acl_get('u_pm_html')); $bbcode_status = ($config['allow_bbcode'] && $config['auth_bbcode_pm'] && $auth->acl_get('u_pm_bbcode')); $smilies_status = ($config['allow_smilies'] && $config['auth_smilies_pm'] && $auth->acl_get('u_pm_smilies')); $img_status = ($config['auth_img_pm'] && $auth->acl_get('u_pm_img')); @@ -422,13 +421,11 @@ function compose_pm($id, $mode, $action) } $subject = preg_replace('#&(\#[0-9]+;)#', '&\1', $subject); - $message_parser->message = (isset($_POST['message'])) ? htmlspecialchars(str_replace(array('\\\'', '\\"', '\\0', '\\\\'), array('\'', '"', '\0', '\\'), $_POST['message'])) : ''; $message_parser->message = preg_replace('#&(\#[0-9]+;)#', '&\1', $message_parser->message); $icon_id = request_var('icon', 0); - $enable_html = (!$html_status || isset($_POST['disable_html'])) ? false : true; $enable_bbcode = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true; $enable_smilies = (!$smilies_status || isset($_POST['disable_smilies'])) ? false : true; $enable_urls = (isset($_POST['disable_magic_url'])) ? 0 : 1; @@ -436,7 +433,7 @@ function compose_pm($id, $mode, $action) if ($submit) { - $status_switch = (($enable_html+1) << 16) + (($enable_bbcode+1) << 8) + (($enable_smilies+1) << 4) + (($enable_urls+1) << 2) + (($enable_sig+1) << 1); + $status_switch = (($enable_bbcode+1) << 8) + (($enable_smilies+1) << 4) + (($enable_urls+1) << 2) + (($enable_sig+1) << 1); $status_switch = ($status_switch != $check_value); } else @@ -455,7 +452,7 @@ function compose_pm($id, $mode, $action) if ($update_message) { - $message_parser->parse($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, $img_status, $flash_status, true); + $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $img_status, $flash_status, true); } else { @@ -505,7 +502,6 @@ function compose_pm($id, $mode, $action) 'icon_id' => (int) $icon_id, 'enable_sig' => (bool) $enable_sig, 'enable_bbcode' => (bool) $enable_bbcode, - 'enable_html' => (bool) $enable_html, 'enable_smilies' => (bool) $enable_smilies, 'enable_urls' => (bool) $enable_urls, 'message_md5' => (int) $message_md5, @@ -537,7 +533,7 @@ function compose_pm($id, $mode, $action) { $post_time = ($action == 'edit') ? $post_time : $current_time; - $preview_message = $message_parser->format_display($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, false); + $preview_message = $message_parser->format_display($enable_bbcode, $enable_urls, $enable_smilies, false); $preview_signature = $user->data['user_sig']; $preview_signature_uid = $user->data['user_sig_bbcode_uid']; @@ -550,7 +546,7 @@ function compose_pm($id, $mode, $action) $parse_sig->bbcode_uid = $preview_signature_uid; $parse_sig->bbcode_bitfield = $preview_signature_bitfield; - $parse_sig->format_display($enable_html, $enable_bbcode, $enable_urls, $enable_smilies); + $parse_sig->format_display($enable_bbcode, $enable_urls, $enable_smilies); $preview_signature = $parse_sig->message; unset($parse_sig); } @@ -716,7 +712,6 @@ function compose_pm($id, $mode, $action) } } - $html_checked = (isset($enable_html)) ? !$enable_html : (($config['allow_html'] && $auth->acl_get('u_pm_html')) ? !$user->optionget('html') : 1); $bbcode_checked = (isset($enable_bbcode)) ? !$enable_bbcode : (($config['allow_bbcode'] && $auth->acl_get('u_pm_bbcode')) ? !$user->optionget('bbcode') : 1); $smilies_checked = (isset($enable_smilies)) ? !$enable_smilies : (($config['allow_smilies'] && $auth->acl_get('u_pm_smilies')) ? !$user->optionget('smilies') : 1); $urls_checked = (isset($enable_urls)) ? !$enable_urls : 0; @@ -766,7 +761,6 @@ function compose_pm($id, $mode, $action) 'SUBJECT' => (isset($message_subject)) ? $message_subject : '', 'MESSAGE' => $message_text, - 'HTML_STATUS' => ($html_status) ? $user->lang['HTML_IS_ON'] : $user->lang['HTML_IS_OFF'], 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . "faq.$phpEx$SID&mode=bbcode" . '" onclick="target=\'_phpbbcode\';">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . "faq.$phpEx$SID&mode=bbcode" . '" onclick="target=\'_phpbbcode\';">', '</a>'), 'IMG_STATUS' => ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], 'FLASH_STATUS' => ($flash_status) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], @@ -776,8 +770,6 @@ function compose_pm($id, $mode, $action) 'S_EDIT_POST' => ($action == 'edit'), 'S_SHOW_PM_ICONS' => $s_pm_icons, - 'S_HTML_ALLOWED' => $html_status, - 'S_HTML_CHECKED' => ($html_checked) ? ' checked="checked"' : '', 'S_BBCODE_ALLOWED' => $bbcode_status, 'S_BBCODE_CHECKED' => ($bbcode_checked) ? ' checked="checked"' : '', 'S_SMILIES_ALLOWED' => $smilies_status, @@ -789,11 +781,34 @@ function compose_pm($id, $mode, $action) 'S_HAS_DRAFTS' => ($auth->acl_get('u_savedrafts') && $drafts), 'S_FORM_ENCTYPE' => $form_enctype, + 'S_BBCODE_IMG' => $img_status, + 'S_BBCODE_FLASH' => $flash_status, + 'S_BBCODE_QUOTE' => true, + 'S_POST_ACTION' => $s_action, 'S_HIDDEN_ADDRESS_FIELD'=> $s_hidden_address_field, 'S_HIDDEN_FIELDS' => $s_hidden_fields) ); + // 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); + // Attachment entry if ($auth->acl_get('u_pm_attach') && $config['allow_pm_attach'] && $form_enctype) { diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 1bb57845f8..aec007a36b 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -53,15 +53,6 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) // Parse the message and subject $message = $message_row['message_text']; - // If the board has HTML off but the message has HTML on then we process it, else leave it alone - if (!$config['auth_html_pm'] || !$auth->acl_get('u_pm_html')) - { - if ($message_row['enable_html'] && $config['auth_bbcode_pm'] && $auth->acl_get('u_pm_bbcode')) - { - $message = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $message); - } - } - // Second parse bbcode here if ($message_row['bbcode_bitfield']) { diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index aec1531d77..c58caa7ef0 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -359,7 +359,6 @@ class ucp_prefs { $var_ary = array( 'bbcode' => true, - 'html' => false, 'smilies' => true, 'sig' => true, 'notify' => false, @@ -371,7 +370,6 @@ class ucp_prefs } $user->optionset('bbcode', $bbcode); - $user->optionset('html', $html); $user->optionset('smilies', $smilies); $user->optionset('attachsig', $sig); @@ -399,9 +397,6 @@ class ucp_prefs $bbcode = (isset($bbcode)) ? $bbcode : $user->optionget('bbcode'); $bbcode_yes = ($bbcode) ? ' checked="checked"' : ''; $bbcode_no = (!$bbcode) ? ' checked="checked"' : ''; - $html = (isset($html)) ? $html : $user->optionget('html'); - $html_yes = ($html) ? ' checked="checked"' : ''; - $html_no = (!$html) ? ' checked="checked"' : ''; $smilies = (isset($smilies)) ? $smilies : $user->optionget('smilies'); $smilies_yes = ($smilies) ? ' checked="checked"' : ''; $smilies_no = (!$smilies) ? ' checked="checked"' : ''; @@ -417,8 +412,6 @@ class ucp_prefs 'DEFAULT_BBCODE_YES' => $bbcode_yes, 'DEFAULT_BBCODE_NO' => $bbcode_no, - 'DEFAULT_HTML_YES' => $html_yes, - 'DEFAULT_HTML_NO' => $html_no, 'DEFAULT_SMILIES_YES' => $smilies_yes, 'DEFAULT_SMILIES_NO' => $smilies_no, 'DEFAULT_SIG_YES' => $sig_yes, diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index d5a24efd87..342bdd06cf 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -380,7 +380,6 @@ class ucp_profile include($phpbb_root_path . 'includes/functions_posting.'.$phpEx); - $enable_html = ($config['allow_sig_html']) ? request_var('enable_html', false) : false; $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; $enable_urls = request_var('enable_urls', true); @@ -395,7 +394,7 @@ class ucp_profile $message_parser = new parse_message($signature); // Allowing Quote BBCode - $message_parser->parse($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, true, 'sig'); + $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, true, 'sig'); if (sizeof($message_parser->warn_msg)) { @@ -428,7 +427,7 @@ class ucp_profile if ($preview) { // Now parse it for displaying - $signature_preview = $message_parser->format_display($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, false); + $signature_preview = $message_parser->format_display($enable_bbcode, $enable_urls, $enable_smilies, false); unset($message_parser); } @@ -439,12 +438,10 @@ class ucp_profile 'SIGNATURE' => $signature, 'SIGNATURE_PREVIEW' => $signature_preview, - 'S_HTML_CHECKED' => (!$enable_html) ? 'checked="checked"' : '', 'S_BBCODE_CHECKED' => (!$enable_bbcode) ? 'checked="checked"' : '', 'S_SMILIES_CHECKED' => (!$enable_smilies) ? 'checked="checked"' : '', 'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? 'checked="checked"' : '', - 'HTML_STATUS' => ($config['allow_sig_html']) ? $user->lang['HTML_IS_ON'] : $user->lang['HTML_IS_OFF'], 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . "faq.$phpEx$SID&mode=bbcode" . '" onclick="target=\'_phpbbcode\';">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . "faq.$phpEx$SID&mode=bbcode" . '" onclick="target=\'_phpbbcode\';">', '</a>'), 'SMILIES_STATUS' => ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], 'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], @@ -452,7 +449,6 @@ class ucp_profile 'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']), - 'S_HTML_ALLOWED' => $config['allow_sig_html'], 'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'], 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'],) ); diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 89abbf98bd..560b402222 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -81,6 +81,7 @@ CREATE TABLE phpbb_banlist ( CREATE TABLE phpbb_bbcodes ( bbcode_id INTEGER DEFAULT 0 NOT NULL, bbcode_tag VARCHAR(16) NOT NULL, + display_on_posting INTEGER DEFAULT 0 NOT NULL, bbcode_match VARCHAR(255) NOT NULL, bbcode_tpl BLOB SUB_TYPE TEXT NOT NULL, first_pass_match VARCHAR(255) NOT NULL, @@ -331,7 +332,6 @@ CREATE TABLE phpbb_posts ( post_approved INTEGER DEFAULT 1 NOT NULL, post_reported INTEGER DEFAULT 0 NOT NULL, enable_bbcode INTEGER DEFAULT 1 NOT NULL, - enable_html INTEGER DEFAULT 0 NOT NULL, enable_smilies INTEGER DEFAULT 1 NOT NULL, enable_magic_url INTEGER DEFAULT 1 NOT NULL, enable_sig INTEGER DEFAULT 1 NOT NULL, @@ -360,7 +360,6 @@ CREATE TABLE phpbb_privmsgs ( message_time INTEGER DEFAULT 0 NOT NULL, message_reported INTEGER DEFAULT 0 NOT NULL, enable_bbcode INTEGER DEFAULT 1 NOT NULL, - enable_html INTEGER DEFAULT 0 NOT NULL, enable_smilies INTEGER DEFAULT 1 NOT NULL, enable_magic_url INTEGER DEFAULT 1 NOT NULL, enable_sig INTEGER DEFAULT 1 NOT NULL, @@ -956,6 +955,11 @@ ADD PRIMARY KEY ( confirm_id );; +CREATE INDEX display_on_posting +ON phpbb_bbcodes( + display_on_posting +);; + ALTER TABLE phpbb_disallow ADD PRIMARY KEY ( disallow_id diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index d67c2e3e8f..945bf97f6c 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -86,6 +86,7 @@ GO CREATE TABLE [phpbb_bbcodes] ( [bbcode_id] [int] NOT NULL , [bbcode_tag] [varchar] (16) NOT NULL , + [display_on_posting] [int] NOT NULL , [bbcode_match] [varchar] (255) NOT NULL , [bbcode_tpl] [text] NOT NULL , [first_pass_match] [varchar] (255) NOT NULL , @@ -336,7 +337,6 @@ CREATE TABLE [phpbb_posts] ( [post_approved] [int] NOT NULL , [post_reported] [int] NOT NULL , [enable_bbcode] [int] NOT NULL , - [enable_html] [int] NOT NULL , [enable_smilies] [int] NOT NULL , [enable_magic_url] [int] NOT NULL , [enable_sig] [int] NOT NULL , @@ -365,7 +365,6 @@ CREATE TABLE [phpbb_privmsgs] ( [message_time] [int] NOT NULL , [message_reported] [int] NOT NULL , [enable_bbcode] [int] NOT NULL , - [enable_html] [int] NOT NULL , [enable_smilies] [int] NOT NULL , [enable_magic_url] [int] NOT NULL , [enable_sig] [int] NOT NULL , @@ -1228,7 +1227,8 @@ ALTER TABLE [phpbb_banlist] WITH NOCHECK ADD GO ALTER TABLE [phpbb_bbcodes] WITH NOCHECK ADD - CONSTRAINT [DF_bbcode_bbcode_id] DEFAULT (0) FOR [bbcode_id] + CONSTRAINT [DF_bbcode_bbcode_id] DEFAULT (0) FOR [bbcode_id], + CONSTRAINT [DF_bbcode_display_on_posting] DEFAULT (0) FOR [display_on_posting] GO ALTER TABLE [phpbb_bookmarks] WITH NOCHECK ADD @@ -1377,7 +1377,6 @@ ALTER TABLE [phpbb_posts] WITH NOCHECK ADD CONSTRAINT [DF_posts__post_approved] DEFAULT (1) FOR [post_approved], CONSTRAINT [DF_posts__post_reported] DEFAULT (0) FOR [post_reported], CONSTRAINT [DF_posts__enable_bbcode] DEFAULT (1) FOR [enable_bbcode], - CONSTRAINT [DF_posts__enable_html] DEFAULT (0) FOR [enable_html], CONSTRAINT [DF_posts__enable_smilies] DEFAULT (1) FOR [enable_smilies], CONSTRAINT [DF_posts__enable_magic_url] DEFAULT (1) FOR [enable_magic_url], CONSTRAINT [DF_posts__enable_sig] DEFAULT (1) FOR [enable_sig], @@ -1397,7 +1396,6 @@ ALTER TABLE [phpbb_privmsgs] WITH NOCHECK ADD CONSTRAINT [DF_privms_message_time] DEFAULT (0) FOR [message_time], CONSTRAINT [DF_privms_message_reported] DEFAULT (0) FOR [message_reported], CONSTRAINT [DF_privms_enable_bbcode] DEFAULT (1) FOR [enable_bbcode], - CONSTRAINT [DF_privms_enable_html] DEFAULT (0) FOR [enable_html], CONSTRAINT [DF_privms_enable_smilies] DEFAULT (1) FOR [enable_smilies], CONSTRAINT [DF_privms_enable_magic_url] DEFAULT (1) FOR [enable_magic_url], CONSTRAINT [DF_privms_enable_sig] DEFAULT (1) FOR [enable_sig], @@ -1698,6 +1696,9 @@ GO CREATE INDEX [is_dynamic] ON [phpbb_config]([is_dynamic]) ON [PRIMARY] GO +CREATE INDEX [display_on_posting] ON [phpbb_bbcodes]([display_on_posting]) ON [PRIMARY] +GO + CREATE INDEX [save_time] ON [phpbb_drafts]([save_time]) ON [PRIMARY] GO diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index b13a2092f3..9fb2e4b302 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -98,13 +98,15 @@ CREATE TABLE phpbb_banlist ( CREATE TABLE phpbb_bbcodes ( bbcode_id tinyint(3) UNSIGNED DEFAULT '0' NOT NULL, bbcode_tag varchar(16) DEFAULT '' NOT NULL, + display_on_posting tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, bbcode_match varchar(255) DEFAULT '' NOT NULL, bbcode_tpl text DEFAULT '' NOT NULL, first_pass_match varchar(255) DEFAULT '' NOT NULL, first_pass_replace varchar(255) DEFAULT '' NOT NULL, second_pass_match varchar(255) DEFAULT '' NOT NULL, second_pass_replace text DEFAULT '' NOT NULL, - PRIMARY KEY (bbcode_id) + PRIMARY KEY (bbcode_id), + KEY display_in_posting (display_on_posting) ); # Table: 'phpbb_bookmarks' @@ -390,7 +392,6 @@ CREATE TABLE phpbb_posts ( post_approved tinyint(1) DEFAULT '1' NOT NULL, post_reported tinyint(1) DEFAULT '0' NOT NULL, enable_bbcode tinyint(1) DEFAULT '1' NOT NULL, - enable_html tinyint(1) DEFAULT '0' NOT NULL, enable_smilies tinyint(1) DEFAULT '1' NOT NULL, enable_magic_url tinyint(1) DEFAULT '1' NOT NULL, enable_sig tinyint(1) DEFAULT '1' NOT NULL, @@ -426,7 +427,6 @@ CREATE TABLE phpbb_privmsgs ( message_time int(11) DEFAULT '0' NOT NULL, message_reported tinyint(1) DEFAULT '0' NOT NULL, enable_bbcode tinyint(1) DEFAULT '1' NOT NULL, - enable_html tinyint(1) DEFAULT '0' NOT NULL, enable_smilies tinyint(1) DEFAULT '1' NOT NULL, enable_magic_url tinyint(1) DEFAULT '1' NOT NULL, enable_sig tinyint(1) DEFAULT '1' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index b4bf0afb05..080393632c 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -233,6 +233,7 @@ END; CREATE TABLE phpbb_bbcodes ( bbcode_id number(3) DEFAULT '0' NOT NULL, bbcode_tag varchar2(16) DEFAULT '', + display_on_posting number(1) DEFAULT '0' NOT NULL, bbcode_match varchar2(255) DEFAULT '', bbcode_tpl clob DEFAULT '', first_pass_match varchar2(255) DEFAULT '', @@ -243,6 +244,9 @@ CREATE TABLE phpbb_bbcodes ( ) / +CREATE INDEX display_on_posting on phpbb_bbcodes (display_on_posting) +/ + /* Table: phpbb_bookmarks */ @@ -793,7 +797,6 @@ CREATE TABLE phpbb_posts ( post_approved number(1) DEFAULT '1' NOT NULL, post_reported number(1) DEFAULT '0' NOT NULL, enable_bbcode number(1) DEFAULT '1' NOT NULL, - enable_html number(1) DEFAULT '0' NOT NULL, enable_smilies number(1) DEFAULT '1' NOT NULL, enable_magic_url number(1) DEFAULT '1' NOT NULL, enable_sig number(1) DEFAULT '1' NOT NULL, @@ -854,7 +857,6 @@ CREATE TABLE phpbb_privmsgs ( message_time number(11) DEFAULT '0' NOT NULL, message_reported number(1) DEFAULT '0' NOT NULL, enable_bbcode number(1) DEFAULT '1' NOT NULL, - enable_html number(1) DEFAULT '0' NOT NULL, enable_smilies number(1) DEFAULT '1' NOT NULL, enable_magic_url number(1) DEFAULT '1' NOT NULL, enable_sig number(1) DEFAULT '1' NOT NULL, diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 640bde0d52..3ab8c4a711 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -130,6 +130,7 @@ SELECT SETVAL('phpbb_banlist_ban_id_seq',(select case when max(ban_id)>0 then ma CREATE TABLE phpbb_bbcodes ( bbcode_id INT2 DEFAULT '0' NOT NULL, bbcode_tag varchar(16) DEFAULT '' NOT NULL, + display_on_posting INT2 DEFAULT '0' NOT NULL, bbcode_match varchar(255) DEFAULT '' NOT NULL, bbcode_tpl text DEFAULT '' NOT NULL, first_pass_match varchar(255) DEFAULT '' NOT NULL, @@ -140,6 +141,8 @@ CREATE TABLE phpbb_bbcodes ( CHECK (bbcode_id>=0) ); +CREATE INDEX display_on_posting_phpbb_bbcodes_index ON phpbb_bbcodes (display_on_posting); + /* Table: phpbb_bookmarks */ CREATE TABLE phpbb_bookmarks ( topic_id INT4 DEFAULT '0' NOT NULL, @@ -521,7 +524,6 @@ CREATE TABLE phpbb_posts ( post_approved INT2 DEFAULT '1' NOT NULL, post_reported INT2 DEFAULT '0' NOT NULL, enable_bbcode INT2 DEFAULT '1' NOT NULL, - enable_html INT2 DEFAULT '0' NOT NULL, enable_smilies INT2 DEFAULT '1' NOT NULL, enable_magic_url INT2 DEFAULT '1' NOT NULL, enable_sig INT2 DEFAULT '1' NOT NULL, @@ -571,7 +573,6 @@ CREATE TABLE phpbb_privmsgs ( message_time INT4 DEFAULT '0' NOT NULL, message_reported INT2 DEFAULT '0' NOT NULL, enable_bbcode INT2 DEFAULT '1' NOT NULL, - enable_html INT2 DEFAULT '0' NOT NULL, enable_smilies INT2 DEFAULT '1' NOT NULL, enable_magic_url INT2 DEFAULT '1' NOT NULL, enable_sig INT2 DEFAULT '1' NOT NULL, diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 591a254f78..099c13497d 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -17,8 +17,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bbcode', '1' INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bookmarks', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_emailreuse', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_forum_notify', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_html', '0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_html_tags', 'b,i,u,pre'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_mass_pm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_name_chars', '.*'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_namechange', '0'); @@ -28,7 +26,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_privmsg', '1 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_bbcode', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_flash', '0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_html', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_img', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_pm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_smilies', '1'); @@ -38,7 +35,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('attachment_quota', INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_bbcode_pm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_download_pm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_flash_pm', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_html_pm', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_img_pm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_method', 'db'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_quote_pm', '1'); @@ -231,7 +227,6 @@ INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_sticky', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_attach', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_download', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_icons', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_html', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_bbcode', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_smilies', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_img', 1); @@ -321,7 +316,6 @@ INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_attach', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_sig', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_attach', 1); -INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_html', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_bbcode', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_smilies', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_download', 1); @@ -621,8 +615,8 @@ INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_nam # Default user - admin rights INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_setting) SELECT 2, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'u_%'; INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_setting) SELECT 2, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'a_%'; -INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_setting) SELECT 2, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_poll', 'f_announce', 'f_sticky', 'f_attach', 'f_html'); -INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_setting) SELECT 2, 2, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_poll', 'f_announce', 'f_sticky', 'f_attach', 'f_html'); +INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_setting) SELECT 2, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_poll', 'f_announce', 'f_sticky', 'f_attach'); +INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_setting) SELECT 2, 2, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_poll', 'f_announce', 'f_sticky', 'f_attach'); # Default user - moderation rights INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_setting) SELECT 2, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'm_%'; @@ -631,8 +625,8 @@ INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_setting) S # ADMINISTRATOR group - admin and forum rights INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 7, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'u_%'; INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 7, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'a_%'; -INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 7, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_poll', 'f_announce', 'f_sticky', 'f_attach', 'f_html'); -INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 7, 2, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_poll', 'f_announce', 'f_sticky', 'f_attach', 'f_html'); +INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 7, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_poll', 'f_announce', 'f_sticky', 'f_attach'); +INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 7, 2, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_poll', 'f_announce', 'f_sticky', 'f_attach'); # SUPER MODERATOR group - moderator rights INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 6, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'u_%' AND auth_option NOT IN ('u_chggrp', 'u_chgname'); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index b9fe4091b2..355ee9623d 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -101,6 +101,7 @@ CREATE TABLE phpbb_banlist ( CREATE TABLE phpbb_bbcodes ( bbcode_id INTEGER PRIMARY KEY NOT NULL DEFAULT '0', bbcode_tag varchar(16) NOT NULL DEFAULT '', + display_on_posting tinyint(1) NOT NULL DEFAULT '0', bbcode_match varchar(255) NOT NULL DEFAULT '', bbcode_tpl text(65535) NOT NULL DEFAULT '', first_pass_match varchar(255) NOT NULL DEFAULT '', @@ -109,6 +110,8 @@ CREATE TABLE phpbb_bbcodes ( second_pass_replace text(65535) NOT NULL DEFAULT '' ); +CREATE INDEX display_on_posting_phpbb_bbcodes on phpbb_bbcodes (display_on_posting); + # Table: phpbb_bookmarks CREATE TABLE phpbb_bookmarks ( topic_id mediumint(8) NOT NULL DEFAULT '0', @@ -393,7 +396,6 @@ CREATE TABLE phpbb_posts ( post_approved tinyint(1) NOT NULL DEFAULT '1', post_reported tinyint(1) NOT NULL DEFAULT '0', enable_bbcode tinyint(1) NOT NULL DEFAULT '1', - enable_html tinyint(1) NOT NULL DEFAULT '0', enable_smilies tinyint(1) NOT NULL DEFAULT '1', enable_magic_url tinyint(1) NOT NULL DEFAULT '1', enable_sig tinyint(1) NOT NULL DEFAULT '1', @@ -429,7 +431,6 @@ CREATE TABLE phpbb_privmsgs ( message_time int(11) NOT NULL DEFAULT '0', message_reported tinyint(1) NOT NULL DEFAULT '0', enable_bbcode tinyint(1) NOT NULL DEFAULT '1', - enable_html tinyint(1) NOT NULL DEFAULT '0', enable_smilies tinyint(1) NOT NULL DEFAULT '1', enable_magic_url tinyint(1) NOT NULL DEFAULT '1', enable_sig tinyint(1) NOT NULL DEFAULT '1', diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index b28827a0c9..ab1a6a9e98 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -71,7 +71,6 @@ $lang = array_merge($lang, array( 'PM_EDIT_TIME_EXPLAIN' => 'Limits the time available to edit a private message not already delivered, zero equals infinity', 'ALLOW_MASS_PM' => 'Allow Mass PM\'s', - 'ALLOW_HTML_PM' => 'Allow HTML in private messages', 'ALLOW_BBCODE_PM' => 'Allow BBCode in private messages', 'ALLOW_SMILIES_PM' => 'Allow smilies in private messages', 'ALLOW_DOWNLOAD_PM' => 'Allow downloading of attachments in private messages', @@ -330,7 +329,7 @@ $lang = array_merge($lang, array( // Board defaults $lang = array_merge($lang, array( - 'ACP_BOARD_DEFAULTS_EXPLAIN' => 'These settings allow you to define a number of default or global settings used by the board. For example, to disable the use of HTML across the entire board alter the relevant setting below. This data is also used for new user registrations and (where relevant) guest users. Please note that registered users can override some of these options with their own settings.', + 'ACP_BOARD_DEFAULTS_EXPLAIN' => 'These settings allow you to define a number of default or global settings used by the board. This data is also used for new user registrations and (where relevant) guest users. Please note that registered users can override some of these options with their own settings.', 'DEFAULT_STYLE' => 'Default Style', 'OVERRIDE_STYLE' => 'Override user style', 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces users style with the default.', @@ -359,16 +358,12 @@ $lang = array_merge($lang, array( 'MIN_RATINGS_EXPLAIN' => 'Number of distinct ratings before users karma is calculated.', 'ALLOW_ATTACHMENTS' => 'Allow Attachments', 'ALLOW_PM_ATTACHMENTS' => 'Allow Attachments in Private Messages', - 'ALLOW_HTML' => 'Allow HTML', - 'ALLOWED_TAGS' => 'Allowed HTML tags', - 'ALLOWED_TAGS_EXPLAIN' => 'Separate tags with commas.', 'ALLOW_BBCODE' => 'Allow BBCode', 'ALLOW_SMILIES' => 'Allow Smilies', 'ALLOW_SIG' => 'Allow Signatures', 'ALLOW_SIG_IMG' => 'Allow use of IMG BBCode Tag in user signatures', 'ALLOW_SIG_BBCODE' => 'Allow BBCode in user signatures', 'ALLOW_SIG_SMILIES' => 'Allow use of smilies in user signatures', - 'ALLOW_SIG_HTML' => 'Allow use of HTML in user signatures', 'ALLOW_SIG_FLASH' => 'Allow use of FLASH BBCode Tag in user signatures', 'ALLOW_NO_CENSORS' => 'Allow Disable of Censors', 'ALLOW_NO_CENSORS_EXPLAIN' => 'User can disable word censoring.', diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 93f42b58ec..32a7bed741 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -110,7 +110,7 @@ $lang = array_merge($lang, array( 'ACP_MESSAGE_SETTINGS' => 'Message Settings', 'ACP_MODULE_MANAGEMENT' => 'Module Management', 'ACP_MOD_LOGS' => 'Moderator Log', - 'ACP_MOD_ROLES' => 'Mod Roles', + 'ACP_MOD_ROLES' => 'Moderator Roles', 'ACP_ORPHAN_ATTACHMENTS' => 'Orphan Attachments', @@ -377,18 +377,19 @@ $lang = array_merge($lang, array( 'LOG_ERROR_EMAIL' => '<b>Email Error</b><br />» %s', 'LOG_FORUM_ADD' => '<b>Created new forum</b><br />» %s', + 'LOG_FORUM_DEL_FORUM' => '<b>Deleted forum</b><br />» %s', + 'LOG_FORUM_DEL_FORUMS' => '<b>Deleted forum and its subforums</b><br />» %s', + 'LOG_FORUM_DEL_MOVE_FORUMS' => '<b>Deleted forum and moved subforums</b> to %s<br />» %s', + 'LOG_FORUM_DEL_MOVE_POSTS' => '<b>Deleted forum and moved posts </b> to %s<br />» %s', + 'LOG_FORUM_DEL_MOVE_POSTS_FORUMS' => '<b>Deleted forum and its subforums, moved messages</b> to %s<br />» %s', + 'LOG_FORUM_DEL_MOVE_POSTS_MOVE_FORUMS' => '<b>Deleted forum, moved posts</b> to %s <b>and subforums</b> to %s<br />» %s', + 'LOG_FORUM_DEL_POSTS' => '<b>Deleted forum and its messages</b><br />» %s', + 'LOG_FORUM_DEL_POSTS_FORUMS' => '<b>Deleted forum, its messages and subforums</b><br />» %s', + 'LOG_FORUM_DEL_POSTS_MOVE_FORUMS' => '<b>Deleted forum and its messages, moved subforums</b> to %s<br />» %s', 'LOG_FORUM_EDIT' => '<b>Edited forum details</b><br />» %s', 'LOG_FORUM_MOVE_DOWN' => '<b>Moved forum</b> %s <b>below</b> %s', 'LOG_FORUM_MOVE_UP' => '<b>Moved forum</b> %s <b>above</b> %s', 'LOG_FORUM_SYNC' => '<b>Re-synchronised forum</b><br />» %s', - 'LOG_FORUM_DEL_POSTS' => '<b>Deleted forum and its messages</b><br />» %s', - 'LOG_FORUM_DEL_FORUMS' => '<b>Deleted forum and its subforums</b><br />» %s', - 'LOG_FORUM_DEL_POSTS_MOVE_FORUMS' => '<b>Deleted forum and its messages, moved subforums</b> to %s<br />» %s', - 'LOG_FORUM_DEL_MOVE_POSTS_FORUMS' => '<b>Deleted forum and its subforums, moved messages</b> to %s<br />» %s', - 'LOG_FORUM_DEL_MOVE_POSTS' => '<b>Deleted forum and moved posts </b> to %s<br />» %s', - 'LOG_FORUM_DEL_MOVE_FORUMS' => '<b>Deleted forum and moved subforums</b> to %s<br />» %s', - 'LOG_FORUM_DEL_POSTS_FORUMS' => '<b>Deleted forum, its messages and subforums</b><br />» %s', - 'LOG_FORUM_DEL_MOVE_POSTS_MOVE_FORUMS' => '<b>Deleted forum, moved posts</b> to %s <b>and subforums</b> to %s<br />» %s', 'LOG_GROUP_CREATED' => '<b>New usergroup created</b><br />» %s', 'LOG_GROUP_DEFAULTS' => '<b>Group made default for members</b><br />» %s', @@ -438,9 +439,9 @@ $lang = array_merge($lang, array( 'LOG_F_ROLE_ADD' => '<b>Forum Role added</b><br />» %s', 'LOG_F_ROLE_EDIT' => '<b>Forum Role edited</b><br />» %s', 'LOG_F_ROLE_REMOVED' => '<b>Forum Role removed</b><br />» %s', - 'LOG_M_ROLE_ADD' => '<b>Mod Role added</b><br />» %s', - 'LOG_M_ROLE_EDIT' => '<b>Mod Role edited</b><br />» %s', - 'LOG_M_ROLE_REMOVED' => '<b>Mod Role removed</b><br />» %s', + 'LOG_M_ROLE_ADD' => '<b>Moderator Role added</b><br />» %s', + 'LOG_M_ROLE_EDIT' => '<b>Moderator Role edited</b><br />» %s', + 'LOG_M_ROLE_REMOVED' => '<b>Moderator Role removed</b><br />» %s', 'LOG_U_ROLE_ADD' => '<b>User Role added</b><br />» %s', 'LOG_U_ROLE_EDIT' => '<b>User Role edited</b><br />» %s', 'LOG_U_ROLE_REMOVED' => '<b>User Role removed</b><br />» %s', diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php index 20f1cebe84..bbbb52d390 100644 --- a/phpBB/language/en/acp/permissions_phpbb.php +++ b/phpBB/language/en/acp/permissions_phpbb.php @@ -103,7 +103,6 @@ $lang = array_merge($lang, array( 'acl_u_pm_attach' => array('lang' => 'Can attach files in private messages', 'cat' => 'pm'), 'acl_u_pm_download' => array('lang' => 'Can download files in private messages', 'cat' => 'pm'), 'acl_u_pm_bbcode' => array('lang' => 'Can post BBCode in private messages', 'cat' => 'pm'), - 'acl_u_pm_html' => array('lang' => 'Can post HTML in private messages', 'cat' => 'pm'), 'acl_u_pm_smilies' => array('lang' => 'Can post smilies in private messages', 'cat' => 'pm'), 'acl_u_pm_img' => array('lang' => 'Can post images in private messages', 'cat' => 'pm'), 'acl_u_pm_flash' => array('lang' => 'Can post Flash in private messages', 'cat' => 'pm'), @@ -134,7 +133,6 @@ $lang = array_merge($lang, array( 'acl_f_attach' => array('lang' => 'Can attach files', 'cat' => 'content'), 'acl_f_download' => array('lang' => 'Can download files', 'cat' => 'content'), 'acl_f_sigs' => array('lang' => 'Can use signatures', 'cat' => 'content'), - 'acl_f_html' => array('lang' => 'Can post HTML', 'cat' => 'content'), 'acl_f_bbcode' => array('lang' => 'Can post BBCode', 'cat' => 'content'), 'acl_f_smilies' => array('lang' => 'Can post smilies', 'cat' => 'content'), 'acl_f_img' => array('lang' => 'Can post images', 'cat' => 'content'), diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php index 5ac25650d2..3a25caeb3b 100644 --- a/phpBB/language/en/help_faq.php +++ b/phpBB/language/en/help_faq.php @@ -130,7 +130,7 @@ $help = array( ), array( 0 => 'Can I use HTML?', - 1 => 'That depends on whether the administrator allows you too, they have complete control over it. If you are allowed to use it you will probably find only certain tags work. This is a <i>safety</i> feature to prevent people abusing the board by using tags which may destroy the layout or cause other problems. If HTML is enabled you can disable it on a per post basis from the posting form.' + 1 => '...' ), array( 0 => 'What are Smileys?', diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index e76831cef1..d1d507a94b 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -74,7 +74,6 @@ $lang = array_merge($lang, array( 'DELETE_POST_CONFIRM' => 'Are you sure you want to delete this message?', 'DELETE_POST_WARN' => 'Once deleted the post cannot be recovered', 'DISABLE_BBCODE' => 'Disable BBCode', - 'DISABLE_HTML' => 'Disable HTML', 'DISABLE_MAGIC_URL' => 'Do not automatically parse URLs', 'DISABLE_SMILIES' => 'Disable Smilies', 'DISALLOWED_EXTENSION' => 'The Extension %s is not allowed', @@ -100,9 +99,6 @@ $lang = array_merge($lang, array( 'GENERAL_UPLOAD_ERROR' => 'Could not upload Attachment to %s', - 'HTML_IS_OFF' => 'HTML is <u>OFF</u>', - 'HTML_IS_ON' => 'HTML is <u>ON</u>', - 'IMAGES_ARE_OFF' => '[img] is <u>OFF</u>', 'IMAGES_ARE_ON' => '[img] is <u>ON</u>', 'INVALID_FILENAME' => '%s is an invalid filename', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 235ade1d58..bab24a78a6 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -102,7 +102,6 @@ $lang = array_merge($lang, array( 'DEFAULT_ACTION_EXPLAIN' => 'This Action will be triggered if none of the above is applicable', 'DEFAULT_ADD_SIG' => 'Attach my signature by default', 'DEFAULT_BBCODE' => 'Enable BBCode by default', - 'DEFAULT_HTML' => 'Enable HTML by default', 'DEFAULT_NOTIFY' => 'Notify me upon replies by default', 'DEFAULT_SMILIES' => 'Enable smilies by default', 'DEFINED_RULES' => 'Defined Rules', diff --git a/phpBB/posting.php b/phpBB/posting.php index 4aa20b2d64..5f3b062d1c 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -232,8 +232,6 @@ if ($sql) $enable_urls = $enable_magic_url; - $enable_html = (isset($enable_html)) ? $enable_html : $config['allow_html']; - if (!in_array($mode, array('quote', 'edit', 'delete'))) { $enable_sig = ($config['allow_sig'] && $user->optionget('attachsig')); @@ -261,7 +259,7 @@ if ($sql) $db->sql_freeresult($result); } - $check_value = (($enable_html+1) << 16) + (($enable_bbcode+1) << 8) + (($enable_smilies+1) << 4) + (($enable_urls+1) << 2) + (($enable_sig+1) << 1); + $check_value = (($enable_bbcode+1) << 8) + (($enable_smilies+1) << 4) + (($enable_urls+1) << 2) + (($enable_sig+1) << 1); } // Notify user checkbox @@ -393,7 +391,6 @@ if ($mode == 'delete') // HTML, BBCode, Smilies, Images and Flash status -$html_status = ($config['allow_html'] && $auth->acl_get('f_html', $forum_id)); $bbcode_status = ($config['allow_bbcode'] && $auth->acl_get('f_bbcode', $forum_id)); $smilies_status = ($config['allow_smilies'] && $auth->acl_get('f_smilies', $forum_id)); $img_status = ($auth->acl_get('f_img', $forum_id)); @@ -519,7 +516,6 @@ if ($submit || $preview || $refresh) $topic_time_limit = (isset($_POST['topic_time_limit'])) ? (int) $_POST['topic_time_limit'] : (($mode != 'post') ? $topic_time_limit : 0); $icon_id = request_var('icon', 0); - $enable_html = (!$html_status || isset($_POST['disable_html'])) ? false : true; $enable_bbcode = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true; $enable_smilies = (!$smilies_status || isset($_POST['disable_smilies'])) ? false : true; $enable_urls = (isset($_POST['disable_magic_url'])) ? 0 : 1; @@ -533,7 +529,7 @@ if ($submit || $preview || $refresh) if ($submit) { - $status_switch = (($enable_html+1) << 16) + (($enable_bbcode+1) << 8) + (($enable_smilies+1) << 4) + (($enable_urls+1) << 2) + (($enable_sig+1) << 1); + $status_switch = (($enable_bbcode+1) << 8) + (($enable_smilies+1) << 4) + (($enable_urls+1) << 2) + (($enable_sig+1) << 1); $status_switch = ($status_switch != $check_value); } else @@ -615,7 +611,7 @@ if ($submit || $preview || $refresh) // Parse message if ($update_message) { - $message_parser->parse($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, $img_status, $flash_status, $quote_status); + $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $img_status, $flash_status, $quote_status); } else { @@ -685,7 +681,6 @@ if ($submit || $preview || $refresh) 'poll_start' => $poll_start, 'poll_last_vote' => $poll_last_vote, 'poll_vote_change' => $poll_vote_change, - 'enable_html' => $enable_html, 'enable_bbcode' => $enable_bbcode, 'enable_urls' => $enable_urls, 'enable_smilies' => $enable_smilies, @@ -820,7 +815,6 @@ if ($submit || $preview || $refresh) 'poster_id' => (int) $poster_id, 'enable_sig' => (bool) $enable_sig, 'enable_bbcode' => (bool) $enable_bbcode, - 'enable_html' => (bool) $enable_html, 'enable_smilies' => (bool) $enable_smilies, 'enable_urls' => (bool) $enable_urls, 'enable_indexing' => (bool) $enable_indexing, @@ -855,7 +849,7 @@ if (!sizeof($error) && $preview) { $post_time = ($mode == 'edit') ? $post_time : $current_time; - $preview_message = $message_parser->format_display($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, false); + $preview_message = $message_parser->format_display($enable_bbcode, $enable_urls, $enable_smilies, false); $preview_signature = ($mode == 'edit') ? $user_sig : $user->data['user_sig']; $preview_signature_uid = ($mode == 'edit') ? $user_sig_bbcode_uid : $user->data['user_sig_bbcode_uid']; @@ -869,7 +863,7 @@ if (!sizeof($error) && $preview) $parse_sig->bbcode_bitfield = $preview_signature_bitfield; // Not sure about parameters for bbcode/smilies/urls... in signatures - $parse_sig->format_display($config['allow_html'], $config['allow_bbcode'], true, $config['allow_smilies']); + $parse_sig->format_display($config['allow_bbcode'], true, $config['allow_smilies']); $preview_signature = $parse_sig->message; unset($parse_sig); } @@ -888,7 +882,7 @@ if (!sizeof($error) && $preview) $parse_poll->bbcode_uid = $message_parser->bbcode_uid; $parse_poll->bbcode_bitfield = $message_parser->bbcode_bitfield; - $parse_poll->format_display($enable_html, $enable_bbcode, $enable_urls, $enable_smilies); + $parse_poll->format_display($enable_bbcode, $enable_urls, $enable_smilies); $template->assign_vars(array( 'S_HAS_POLL_OPTIONS'=> (sizeof($poll_options)), @@ -901,7 +895,7 @@ if (!sizeof($error) && $preview) ); $parse_poll->message = implode("\n", $poll_options); - $parse_poll->format_display($enable_html, $enable_bbcode, $enable_urls, $enable_smilies); + $parse_poll->format_display($enable_bbcode, $enable_urls, $enable_smilies); $preview_poll_options = explode('<br />', $parse_poll->message); unset($parse_poll); @@ -1008,7 +1002,6 @@ if ($enable_icons) $s_topic_icons = posting_gen_topic_icons($mode, $icon_id); } -$html_checked = (isset($enable_html)) ? !$enable_html : (($config['allow_html']) ? !$user->optionget('html') : 1); $bbcode_checked = (isset($enable_bbcode)) ? !$enable_bbcode : (($config['allow_bbcode']) ? !$user->optionget('bbcode') : 1); $smilies_checked = (isset($enable_smilies)) ? !$enable_smilies : (($config['allow_smilies']) ? !$user->optionget('smilies') : 1); $urls_checked = (isset($enable_urls)) ? !$enable_urls : 0; @@ -1079,7 +1072,6 @@ $template->assign_vars(array( 'USERNAME' => ((!$preview && $mode != 'quote') || $preview) ? stripslashes($username) : '', 'SUBJECT' => $post_subject, 'MESSAGE' => $post_text, - 'HTML_STATUS' => ($html_status) ? $user->lang['HTML_IS_ON'] : $user->lang['HTML_IS_OFF'], 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . "faq.$phpEx$SID&mode=bbcode" . '" onclick="target=\'_phpbbcode\';">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . "faq.$phpEx$SID&mode=bbcode" . '" onclick="target=\'_phpbbcode\';">', '</a>'), 'IMG_STATUS' => ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], 'FLASH_STATUS' => ($flash_status) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], @@ -1101,8 +1093,6 @@ $template->assign_vars(array( 'S_DISPLAY_USERNAME' => (!$user->data['is_registered'] || ($mode == 'edit' && $post_username)), 'S_SHOW_TOPIC_ICONS' => $s_topic_icons, 'S_DELETE_ALLOWED' => ($mode == 'edit' && (($post_id == $topic_last_post_id && $poster_id == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))), - 'S_HTML_ALLOWED' => $html_status, - 'S_HTML_CHECKED' => ($html_checked) ? ' checked="checked"' : '', 'S_BBCODE_ALLOWED' => $bbcode_status, 'S_BBCODE_CHECKED' => ($bbcode_checked) ? ' checked="checked"' : '', 'S_SMILIES_ALLOWED' => $smilies_status, @@ -1121,10 +1111,33 @@ $template->assign_vars(array( 'S_HAS_DRAFTS' => ($auth->acl_get('u_savedrafts') && $user->data['is_registered'] && $drafts), 'S_FORM_ENCTYPE' => $form_enctype, + 'S_BBCODE_IMG' => $img_status, + 'S_BBCODE_FLASH' => $flash_status, + 'S_BBCODE_QUOTE' => $quote_status, + 'S_POST_ACTION' => $s_action, 'S_HIDDEN_FIELDS' => $s_hidden_fields) ); +// 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); + // Poll entry if (($mode == 'post' || ($mode == 'edit' && $post_id == $topic_first_post_id && (!$poll_last_vote || $auth->acl_get('m_edit', $forum_id)))) && $auth->acl_get('f_poll', $forum_id)) @@ -1371,7 +1384,6 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'post_time' => $current_time, 'post_approved' => ($auth->acl_get('f_moderate', $data['forum_id']) && !$auth->acl_get('m_approve')) ? 0 : 1, 'enable_bbcode' => $data['enable_bbcode'], - 'enable_html' => $data['enable_html'], 'enable_smilies' => $data['enable_smilies'], 'enable_magic_url' => $data['enable_urls'], 'enable_sig' => $data['enable_sig'], @@ -1422,7 +1434,6 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'icon_id' => $data['icon_id'], 'post_approved' => ($auth->acl_get('f_moderate', $data['forum_id']) && !$auth->acl_get('m_approve')) ? 0 : 1, 'enable_bbcode' => $data['enable_bbcode'], - 'enable_html' => $data['enable_html'], 'enable_smilies' => $data['enable_smilies'], 'enable_magic_url' => $data['enable_urls'], 'enable_sig' => $data['enable_sig'], diff --git a/phpBB/report.php b/phpBB/report.php index ddc7cfc5e5..850c6158e1 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -33,7 +33,7 @@ if (!$id) trigger_error('INVALID_MODE'); } -$redirect_url = ($report_post) ? "{$phpbb_root_path}viewtopic.$phpEx$SID&p=$id#$id" : "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&p=$id"; +$redirect_url = ($report_post) ? "{$phpbb_root_path}viewtopic.$phpEx$SID&p=$id#p$id" : "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&p=$id"; // Has the report been cancelled? if (isset($_POST['cancel'])) @@ -387,7 +387,6 @@ function report_notification($notify_user, $report_post, $report_data) 'from_username' => $user->data['username'], 'icon_id' => 0, 'enable_bbcode' => 0, - 'enable_html' => 0, 'enable_smilies' => 0, 'enable_magic_url' => 1, 'enable_sig' => 0, diff --git a/phpBB/search.php b/phpBB/search.php index e6ff66ff7e..a27c479eae 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -471,6 +471,7 @@ if ($keywords || $author || $search_id) AND t.topic_id = tp.topic_id)'; $sql_select .= ', tp.topic_posted'; } + if ($config['load_db_lastread']) { $sql_from .= ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.user_id = ' . $user->data['user_id'] . ' @@ -611,11 +612,6 @@ if ($keywords || $author || $search_id) continue; } - if ($row['enable_html']) - { - $row['post_text'] = preg_replace('#(<!\-\- h \-\-><)([\/]?.*?)(><!\-\- h \-\->)#is', "<\\2>", $row['post_text']); - } - decode_message($row['post_text'], $row['bbcode_uid']); if ($return_chars != -1) diff --git a/phpBB/styles/subSilver/template/posting_body.html b/phpBB/styles/subSilver/template/posting_body.html index 389763231d..83162921b6 100644 --- a/phpBB/styles/subSilver/template/posting_body.html +++ b/phpBB/styles/subSilver/template/posting_body.html @@ -14,7 +14,7 @@ var text_name = 'message'; // Define the bbCode tags bbcode = new Array(); -bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]'); +bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->); imageTag = false; // Helpline messages @@ -234,21 +234,30 @@ function checkForm() <td colspan="2"><input type="button" class="btnbbcode" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" /> <input type="button" class="btnbbcode" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" /> <input type="button" class="btnbbcode" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" /> - <input type="button" class="btnbbcode" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" /> + <!-- IF S_BBCODE_QUOTE --><input type="button" class="btnbbcode" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" /><!-- ENDIF --> <input type="button" class="btnbbcode" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" /> <input type="button" class="btnbbcode" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" /> <input type="button" class="btnbbcode" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" /> - <input type="button" class="btnbbcode" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /> + <!-- IF S_BBCODE_IMG --><input type="button" class="btnbbcode" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /><!-- ENDIF --> <input type="button" class="btnbbcode" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" /> + <!-- IF S_BBCODE_FLASH --><input type="button" class="btnbbcode" accesskey="f" name="addbbcode18" value="Flash" onclick="bbstyle(18)" /><!-- ENDIF --> <span class="genmed" style="white-space: nowrap;">{L_FONT_SIZE}: <select class="gensmall" name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')"> <option value="7">{L_FONT_TINY}</option> <option value="9">{L_FONT_SMALL}</option> <option value="12" selected="selected">{L_FONT_NORMAL}</option> <option value="18">{L_FONT_LARGE}</option> <option value="24">{L_FONT_HUGE}</option> - </select> | <a href="javascript:bbstyle(-1)" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a></span> + </select> | <a href="javascript:bbstyle(-1)" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a></span> </td> </tr> + <!-- IF .custom_tags --> + <tr valign="middle" align="left"> + <td colspan="2"> + <!-- BEGIN custom_tags --> + <input type="button" class="btnbbcode" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" /> + <!-- END custom_tags --> + </td> + <!-- ENDIF --> <tr> <td><input type="text" name="helpbox" style="width:100%" maxlength="100" class="helpline" value="{L_STYLES_TIP}" /></td> <td class="genmed" align="center">{L_FONT_COLOR}</td> @@ -275,9 +284,6 @@ function checkForm() <tr> <td class="row1" valign="top"><b class="genmed">{L_OPTIONS}:</b><br /><table cellspacing="2" cellpadding="0" border="0"> <tr> - <td class="gensmall">{HTML_STATUS}</td> - </tr> - <tr> <td class="gensmall">{BBCODE_STATUS}</td> </tr> <tr> @@ -291,13 +297,6 @@ function checkForm() </tr> </table></td> <td class="row2"><table cellpadding="1"> - <!-- IF S_HTML_ALLOWED --> - <tr> - <td><input type="checkbox" name="disable_html"{S_HTML_CHECKED} class="radio" /></td> - <td class="gen">{L_DISABLE_HTML}</td> - </tr> - <!-- ENDIF --> - <!-- IF S_BBCODE_ALLOWED --> <tr> <td><input type="checkbox" name="disable_bbcode"{S_BBCODE_CHECKED} class="radio" /></td> diff --git a/phpBB/styles/subSilver/template/ucp_prefs_post.html b/phpBB/styles/subSilver/template/ucp_prefs_post.html index 4b3bb1537e..8dc01174eb 100644 --- a/phpBB/styles/subSilver/template/ucp_prefs_post.html +++ b/phpBB/styles/subSilver/template/ucp_prefs_post.html @@ -16,10 +16,6 @@ <td class="row2"><input type="radio" name="bbcode" value="1"{DEFAULT_BBCODE_YES} /><span class="gen">{L_YES}</span> <input type="radio" name="bbcode" value="0"{DEFAULT_BBCODE_NO} /><span class="gen">{L_NO}</span></td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_HTML}:</b></td> - <td class="row2"><input type="radio" name="html" value="1"{DEFAULT_HTML_YES} /><span class="gen">{L_YES}</span> <input type="radio" name="html" value="0"{DEFAULT_HTML_NO} /><span class="gen">{L_NO}</span></td> - </tr> - <tr> <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_SMILIES}:</b></td> <td class="row2"><input type="radio" name="smilies" value="1"{DEFAULT_SMILIES_YES} /><span class="gen">{L_YES}</span> <input type="radio" name="smilies" value="0"{DEFAULT_SMILIES_NO} /><span class="gen">{L_NO}</span></td> </tr> diff --git a/phpBB/styles/subSilver/template/ucp_profile_signature.html b/phpBB/styles/subSilver/template/ucp_profile_signature.html index 05fc81526b..e121b86395 100644 --- a/phpBB/styles/subSilver/template/ucp_profile_signature.html +++ b/phpBB/styles/subSilver/template/ucp_profile_signature.html @@ -101,9 +101,6 @@ function marklist(form_name, status) <tr> <td class="row1" valign="top"><b class="genmed">{L_OPTIONS}</b><br /><table cellspacing="2" cellpadding="0" border="0"> <tr> - <td class="gensmall">{HTML_STATUS}</td> - </tr> - <tr> <td class="gensmall">{BBCODE_STATUS}</td> </tr> <tr> @@ -117,12 +114,6 @@ function marklist(form_name, status) </tr> </table></td> <td class="row2" valign="top"><table cellspacing="0" cellpadding="1" border="0"> - <!-- IF S_HTML_ALLOWED --> - <tr> - <td><input type="checkbox" name="disable_html"{S_HTML_CHECKED} /></td> - <td class="gen">{L_DISABLE_HTML}</td> - </tr> - <!-- ENDIF --> <!-- IF S_BBCODE_ALLOWED --> <tr> <td><input type="checkbox" name="disable_bbcode"{S_BBCODE_CHECKED} /></td> diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 079b4ae0fc..843b4c2c02 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -818,7 +818,6 @@ while ($row = $db->sql_fetchrow($result)) 'post_encoding' => $row['post_encoding'], 'bbcode_uid' => $row['bbcode_uid'], 'bbcode_bitfield' => $row['bbcode_bitfield'], - 'enable_html' => $row['enable_html'], 'enable_smilies' => $row['enable_smilies'], 'enable_sig' => $row['enable_sig'], 'friend' => $row['friend'], @@ -1139,12 +1138,6 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) // Parse the message and subject $message = $row['post_text']; - // If the board has HTML off but the post has HTML on then we process it, else leave it alone - if (!$auth->acl_get('f_html', $forum_id) && $row['enable_html']) - { - $message = preg_replace('#(<!\-\- h \-\-><)([\/]?.*?)(><!\-\- h \-\->)#is', "<\\2>", $message); - } - // Second parse bbcode here if ($row['bbcode_bitfield']) { @@ -1171,12 +1164,6 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) $message = preg_replace('#(?!<.*)(?<!\w)(' . $highlight_match . ')(?!\w|[^<>]*>)#i', '<span class="posthilit">\1</span>', $message); } - if ($row['enable_html'] && $auth->acl_get('f_html', $forum_id)) - { - // Remove Comments from post content - $message = preg_replace('#<!\-\-(.*?)\-\->#is', '', $message); - } - // Replace naughty words such as farty pants $row['post_subject'] = censor_text($row['post_subject']); $message = str_replace("\n", '<br />', censor_text($message)); |