diff options
Diffstat (limited to 'phpBB')
28 files changed, 426 insertions, 224 deletions
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 8bb1954a5c..3bb5aab2fc 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -87,6 +87,7 @@ <dl> <dt><label for="forum_desc">{L_FORUM_DESC}:</label><br /><span>{L_FORUM_DESC_EXPLAIN}</span></dt> <dd><textarea id="forum_desc" name="forum_desc" rows="5" cols="45">{FORUM_DESC}</textarea></dd> + <dd><input type="checkbox" name="desc_parse_bbcode"<!-- IF S_DESC_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE} <input type="checkbox" name="desc_parse_smilies"<!-- IF S_DESC_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES} <input type="checkbox" name="desc_parse_urls"<!-- IF S_DESC_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}</dd> </dl> <dl> <dt><label for="forum_image">{L_FORUM_IMAGE}:</label><br /><span>{L_FORUM_IMAGE_EXPLAIN}</span></dt> @@ -215,7 +216,7 @@ <dl> <dt><label for="forum_rules">{L_FORUM_RULES}:</label><br /><span>{L_FORUM_RULES_EXPLAIN}</span></dt> <dd><textarea id="forum_rules" name="forum_rules" rows="4" cols="70">{FORUM_RULES_PLAIN}</textarea></dd> - <dd><input type="checkbox" name="parse_bbcode"<!-- IF S_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE} <input type="checkbox" name="parse_smilies"<!-- IF S_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES} <input type="checkbox" name="parse_urls"<!-- IF S_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}</dd> + <dd><input type="checkbox" name="rules_parse_bbcode"<!-- IF S_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE} <input type="checkbox" name="rules_parse_smilies"<!-- IF S_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES} <input type="checkbox" name="rules_parse_urls"<!-- IF S_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}</dd> </dl> </fieldset> </div> diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html index bf95ee1e9e..21fdb02251 100644 --- a/phpBB/adm/style/acp_groups.html +++ b/phpBB/adm/style/acp_groups.html @@ -26,8 +26,9 @@ <dd><!-- IF S_SPECIAL_GROUP --><b>{GROUP_NAME}</b><!-- ENDIF --><input name="group_name" type="<!-- IF S_SPECIAL_GROUP -->hidden<!-- ELSE -->text<!-- ENDIF -->" id="group_name" value="{GROUP_INTERNAL_NAME}" /></dd> </dl> <dl> - <dt><label for="group_description">{L_GROUP_DESC}:</label></dt> - <dd><input name="group_description" type="text" id="group_description" value="{GROUP_DESCRIPTION}" /></dd> + <dt><label for="group_desc">{L_GROUP_DESC}:</label></dt> + <dd><textarea id="group_desc" name="group_desc" rows="5" cols="45">{GROUP_DESC}</textarea></dd> + <dd><input type="checkbox" name="desc_parse_bbcode"<!-- IF S_DESC_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE} <input type="checkbox" name="desc_parse_smilies"<!-- IF S_DESC_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES} <input type="checkbox" name="desc_parse_urls"<!-- IF S_DESC_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}</dd> </dl> <!-- IF not S_SPECIAL_GROUP --> <dl> diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 478d041873..b59ab50c34 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -22,7 +22,6 @@ class acp_forums global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx, $SID; $user->add_lang('acp/forums'); - $this->tpl_name = 'acp_forums'; $this->page_title = 'ACP_MANAGE_FORUMS'; @@ -97,11 +96,15 @@ class acp_forums 'forum_type' => request_var('forum_type', FORUM_POST), 'type_action' => request_var('type_action', ''), 'forum_status' => request_var('forum_status', ITEM_UNLOCKED), - 'forum_name' => request_var('forum_name', ''), + 'forum_name' => request_var('forum_name', '', true), 'forum_link' => request_var('forum_link', ''), 'forum_link_track' => request_var('forum_link_track', false), - 'forum_desc' => request_var('forum_desc', ''), - 'forum_rules' => request_var('forum_rules', ''), + 'forum_desc' => request_var('forum_desc', '', true), + 'forum_desc_uid' => '', + 'forum_desc_bitfield' => 0, + 'forum_rules' => request_var('forum_rules', '', true), + 'forum_rules_uid' => '', + 'forum_rules_bitfield' => 0, 'forum_rules_link' => request_var('forum_rules_link', ''), 'forum_image' => request_var('forum_image', ''), 'forum_style' => request_var('forum_style', 0), @@ -118,28 +121,20 @@ class acp_forums 'prune_sticky' => request_var('prune_sticky', false), 'forum_password' => request_var('forum_password', ''), 'forum_password_confirm'=> request_var('forum_password_confirm', ''), - 'forum_rules_flags' => 0, ); $forum_data['show_active'] = ($forum_data['forum_type'] == FORUM_POST) ? request_var('display_recent', false) : request_var('display_active', false); + // Get data for forum rules if specified... if ($forum_data['forum_rules']) { - include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx); - - $allow_bbcode = request_var('parse_bbcode', false); - $allow_smilies = request_var('parse_smilies', false); - $allow_urls = request_var('parse_urls', false); - - $forum_data['forum_rules_flags'] = (($allow_bbcode) ? 1 : 0) + (($allow_smilies) ? 2 : 0) + (($allow_urls) ? 4 : 0); + generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], request_var('rules_parse_bbcode', false), request_var('rules_parse_urls', false), request_var('rules_parse_smilies', false)); + } - $message_parser = new parse_message($forum_data['forum_rules']); - $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; - $forum_data['forum_rules_bbcode_bitfield'] = $message_parser->bbcode_bitfield; - unset($message_parser); + // Get data for forum description if specified + if ($forum_data['forum_desc']) + { + generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], request_var('desc_parse_bbcode', false), request_var('desc_parse_urls', false), request_var('desc_parse_smilies', false)); } $errors = $this->update_forum_data($forum_data); @@ -152,26 +147,26 @@ class acp_forums if ($forum_perm_from && $action == 'add') { $sql_ary = array( - 'user_id' => array('user_id'), - 'forum_id' => (int) $forum_data['forum_id'], - 'auth_option_id' => array('auth_option_id'), - 'auth_role_id' => array('auth_role_id'), - 'auth_setting' => array('auth_setting') + 'a.user_id' => array('user_id'), + 'a.forum_id' => (int) $forum_data['forum_id'], + 'a.auth_option_id' => array('auth_option_id'), + 'a.auth_role_id' => array('auth_role_id'), + 'a.auth_setting' => array('auth_setting') ); // We copy the permissions the manual way. ;) - $sql = 'INSERT INTO ' . ACL_USERS_TABLE . ' ' . $db->sql_build_array('INSERT_SELECT', $sql_ary) . ' - FROM ' . ACL_USERS_TABLE . ' - WHERE forum_id = ' . $forum_perm_from; + $sql = 'INSERT INTO ' . ACL_USERS_TABLE . ' a ' . $db->sql_build_array('INSERT_SELECT', $sql_ary) . ' + FROM ' . ACL_USERS_TABLE . ' b + WHERE b.forum_id = ' . $forum_perm_from; $db->sql_query($sql); // Change array for copying settings from the acl groups table unset($sql_ary['user_id']); $sql_ary['group_id'] = array('group_id'); - $sql = 'INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT_SELECT', $sql_ary) . ' - FROM ' . ACL_GROUPS_TABLE . ' - WHERE forum_id = ' . $forum_perm_from; + $sql = 'INSERT INTO ' . ACL_GROUPS_TABLE . ' a ' . $db->sql_build_array('INSERT_SELECT', $sql_ary) . ' + FROM ' . ACL_GROUPS_TABLE . ' b + WHERE b.forum_id = ' . $forum_perm_from; $db->sql_query($sql); } @@ -198,6 +193,12 @@ class acp_forums $message = ($action == 'add') ? $user->lang['FORUM_CREATED'] : $user->lang['FORUM_UPDATED']; $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . $phpbb_admin_path . "index.$phpEx$SID&i=permissions" . $acl_url . '">', '</a>'); + // redirect directly to permission settings screen + if ($action == 'add' && !$forum_perm_from) + { + meta_refresh(4, $phpbb_admin_path . "index.$phpEx$SID&i=permissions" . $acl_url); + } + trigger_error($message . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); } @@ -345,11 +346,6 @@ class acp_forums if ($update) { - $forum_data['forum_rules_flags'] = 0; - $forum_data['forum_rules_flags'] += (request_var('parse_bbcode', false)) ? 1 : 0; - $forum_data['forum_rules_flags'] += (request_var('parse_smilies', false)) ? 2 : 0; - $forum_data['forum_rules_flags'] += (request_var('parse_urls', false)) ? 4 : 0; - $forum_data['forum_flags'] = 0; $forum_data['forum_flags'] += (request_var('forum_link_track', false)) ? 1 : 0; $forum_data['forum_flags'] += (request_var('prune_old_polls', false)) ? 2 : 0; @@ -388,7 +384,7 @@ class acp_forums 'parent_id' => $this->parent_id, 'forum_type' => FORUM_CAT, 'forum_status' => ITEM_UNLOCKED, - 'forum_name' => request_var('forum_name', ''), + 'forum_name' => request_var('forum_name', '', true), 'forum_link' => '', 'forum_link_track' => false, 'forum_desc' => '', @@ -407,32 +403,59 @@ class acp_forums 'forum_flags' => 0, 'forum_password' => '', 'forum_password_confirm'=> '', - 'forum_rules_flags' => 7, ); } } - $forum_rules_preview = $forum_rules_plain = ''; + $forum_rules_data = array( + 'text' => $forum_data['forum_rules'], + 'allow_bbcode' => true, + 'allow_smilies' => true, + 'allow_urls' => true + ); + + $forum_desc_data = array( + 'text' => $forum_data['forum_desc'], + 'allow_bbcode' => true, + 'allow_smilies' => true, + 'allow_urls' => true + ); + $forum_rules_preview = ''; + + // Parse rules if specified if ($forum_data['forum_rules']) { - include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); - include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx); - - $message_parser = new parse_message($forum_data['forum_rules']); - - if (isset($forum_data['forum_rules_bbcode_uid'])) + if (!isset($forum_data['forum_rules_uid'])) { - $message_parser->bbcode_uid = $forum_data['forum_rules_bbcode_uid']; - $message_parser->bbcode_bitfield = $forum_data['forum_rules_bbcode_bitfield']; + // Before we are able to display the preview and plane text, we need to parse our request_var()'d value... + $forum_data['forum_rules_uid'] = ''; + $forum_data['forum_rules_bitfield'] = 0; + + generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], request_var('rules_allow_bbcode', false), request_var('rules_allow_urls', false), request_var('rules_allow_smiliess', false)); } - else + + // Generate preview content + $forum_rules_preview = generate_text_for_display($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield']); + + // decode... + $forum_rules_data = generate_text_for_edit($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield']); + } + + // Parse desciption if specified + if ($forum_data['forum_desc']) + { + if (!isset($forum_data['forum_desc_uid'])) { - $message_parser->parse(($forum_data['forum_rules_flags'] & 1), ($forum_data['forum_rules_flags'] & 4), ($forum_data['forum_rules_flags'] & 2)); + // Before we are able to display the preview and plane text, we need to parse our request_var()'d value... + $forum_data['forum_desc_uid'] = ''; + $forum_data['forum_desc_bitfield'] = 0; + + generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], request_var('desc_allow_bbcode', false), request_var('desc_allow_urls', false), request_var('desc_allow_smiliess', 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); + // decode... + $forum_desc_data = generate_text_for_edit($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield']); } $forum_type_options = ''; @@ -490,7 +513,6 @@ class acp_forums 'FORUM_NAME' => $forum_data['forum_name'], 'FORUM_DATA_LINK' => $forum_data['forum_link'], - 'FORUM_DESC' => $forum_data['forum_desc'], 'FORUM_IMAGE' => $forum_data['forum_image'], 'FORUM_IMAGE_SRC' => ($forum_data['forum_image']) ? $phpbb_root_path . $forum_data['forum_image'] : '', 'FORUM_POST' => FORUM_POST, @@ -505,10 +527,15 @@ class acp_forums 'FORUM_RULES_LINK' => $forum_data['forum_rules_link'], 'FORUM_RULES' => $forum_data['forum_rules'], 'FORUM_RULES_PREVIEW' => $forum_rules_preview, - 'FORUM_RULES_PLAIN' => $forum_rules_plain, - 'S_BBCODE_CHECKED' => ($forum_data['forum_rules_flags'] & 1) ? true : false, - 'S_SMILIES_CHECKED' => ($forum_data['forum_rules_flags'] & 2) ? true : false, - 'S_URLS_CHECKED' => ($forum_data['forum_rules_flags'] & 4) ? true : false, + 'FORUM_RULES_PLAIN' => $forum_rules_data['text'], + 'S_BBCODE_CHECKED' => ($forum_rules_data['allow_bbcode']) ? true : false, + 'S_SMILIES_CHECKED' => ($forum_rules_data['allow_smilies']) ? true : false, + 'S_URLS_CHECKED' => ($forum_rules_data['allow_urls']) ? true : false, + + 'FORUM_DESC' => $forum_desc_data['text'], + 'S_DESC_BBCODE_CHECKED' => ($forum_desc_data['allow_bbcode']) ? true : false, + 'S_DESC_SMILIES_CHECKED' => ($forum_desc_data['allow_smilies']) ? true : false, + 'S_DESC_URLS_CHECKED' => ($forum_desc_data['allow_urls']) ? true : false, 'S_FORUM_TYPE_OPTIONS' => $forum_type_options, 'S_STATUS_OPTIONS' => $statuslist, @@ -657,7 +684,7 @@ class acp_forums $template->assign_block_vars('forums', array( 'FOLDER_IMAGE' => $folder_image, 'FORUM_NAME' => $row['forum_name'], - 'FORUM_DESCRIPTION' => $row['forum_desc'], + 'FORUM_DESCRIPTION' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield']), 'FORUM_TOPICS' => $row['forum_topics'], 'FORUM_POSTS' => $row['forum_posts'], diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index c65866eba1..b932ca003d 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -243,10 +243,14 @@ class acp_groups // Did we submit? if ($update) { - $group_name = request_var('group_name', ''); - $group_description = request_var('group_description', ''); + $group_name = request_var('group_name', '', true); + $group_desc = request_var('group_desc', '', true); $group_type = request_var('group_type', GROUP_FREE); + $allow_desc_bbcode = request_var('desc_parse_bbcode', false); + $allow_desc_urls = request_var('desc_parse_urls', false); + $allow_desc_smilies = request_var('desc_parse_smilies', false); + $data['uploadurl'] = request_var('uploadurl', ''); $data['remotelink'] = request_var('remotelink', ''); $delete = request_var('delete', ''); @@ -324,7 +328,7 @@ class acp_groups } } - if (!($error = group_create($group_id, $group_type, $group_name, $group_description, $group_attributes))) + if (!($error = group_create($group_id, $group_type, $group_name, $group_desc, $group_attributes, $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies))) { $group_perm_from = request_var('group_perm_from', 0); @@ -351,18 +355,34 @@ class acp_groups $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED'; trigger_error($user->lang[$message] . adm_back_link($this->u_action)); } + else + { + $group_rank = $submit_ary['rank']; + + $group_desc_data = array( + 'text' => $group_desc, + 'allow_bbcode' => $allow_desc_bbcode, + 'allow_smilies' => $allow_desc_smilies, + 'allow_urls' => $allow_desc_urls + ); + } } else if (!$group_id) { - $group_name = request_var('group_name', ''); - $group_description = ''; + $group_name = request_var('group_name', '', true); + $group_desc_data = array( + 'text' => '', + 'allow_bbcode' => true, + 'allow_smilies' => true, + 'allow_urls' => true + ); $group_rank = 0; $group_type = GROUP_OPEN; } else { $group_name = $group_row['group_name']; - $group_description = $group_row['group_description']; + $group_desc_data = generate_text_for_edit($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield']); $group_type = $group_row['group_type']; $group_rank = $group_row['group_rank']; } @@ -440,11 +460,15 @@ class acp_groups 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '', 'GROUP_NAME' => ($group_type == GROUP_SPECIAL) ? $user->lang['G_' . $group_name] : $group_name, 'GROUP_INTERNAL_NAME' => $group_name, - 'GROUP_DESCRIPTION' => $group_description, + 'GROUP_DESC' => $group_desc_data['text'], 'GROUP_RECEIVE_PM' => (isset($group_row['group_receive_pm']) && $group_row['group_receive_pm']) ? ' checked="checked"' : '', 'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0, 'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '', + 'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'], + 'S_DESC_URLS_CHECKED' => $group_desc_data['allow_urls'], + 'S_DESC_SMILIES_CHECKED'=> $group_desc_data['allow_smilies'], + 'S_RANK_OPTIONS' => $rank_options, 'S_GROUP_OPTIONS' => group_select_options(0), 'AVATAR_IMAGE' => $avatar_img, diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 098699e8da..c273a4de14 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1051,7 +1051,7 @@ class acp_users } $var_ary = array( - 'dateformat' => array('string', false, 3, 15), + 'dateformat' => array('string', false, 3, 30), 'lang' => array('match', false, '#^[a-z_]{2,}$#i'), 'tz' => array('num', false, -13, 13), diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index c61e6a5bda..254e868873 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -8,6 +8,7 @@ * */ + /** * set_var * @@ -1581,6 +1582,156 @@ function bump_topic_allowed($forum_id, $topic_bumped, $last_post_time, $topic_po } /** +* Decode text whereby text is coming from the db and expected to be pre-parsed content +* We are placing this outside of the message parser because we are often in need of it... +*/ +function decode_message(&$message, $bbcode_uid = '') +{ + global $config; + + if ($bbcode_uid) + { + $match = array('<br />', "[/*:m:$bbcode_uid]", ":u:$bbcode_uid", ":o:$bbcode_uid", ":$bbcode_uid"); + $replace = array("\n", '', '', '', ''); + } + else + { + $match = array('<br />'); + $replace = array("\n"); + } + + $message = str_replace($match, $replace, $message); + + $match = array( + '#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#', + '#<!\-\- m \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- m \-\->#', + '#<!\-\- w \-\-><a href="http:\/\/(.*?)" target="_blank">.*?</a><!\-\- w \-\->#', + '#<!\-\- l \-\-><a href="(.*?)">.*?</a><!\-\- l \-\->#', + '#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#', + '#<.*?>#s' + ); + + $replace = array('\1', '\1', '\1', '\1', '\1', '<\1>'); + + $message = preg_replace($match, $replace, $message); + + return; +} + +/** +* For display of custom parsed text on user-facing pages +* Expects $text to be the value directly from the database (stored value) +*/ +function generate_text_for_display($text, $uid, $bitfield) +{ + global $__bbcode; + + if (!$text) + { + return ''; + } + + // Get flags... they are always allow_bbcode, allow_smilies and allow_urls + $flags = $bitfield; + if ($flags >> 3) + { + $flags = bindec(substr(decbin($flags), strlen(decbin($flags >> 3)))); + } + + // Parse bbcode if bbcode uid stored and bbcode enabled + if ($uid && ($flags & 1)) + { + if (!class_exists('bbcode')) + { + global $phpbb_root_path, $phpEx; + include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); + } + + if (empty($__bbcode)) + { + $__bbcode = new bbcode($bitfield >> 3); + } + else + { + $__bbcode->bbcode($bitfield >> 3); + } + + $__bbcode->bbcode_second_pass($text, $uid); + } + + $text = smiley_text($text, !($flags & 2)); + $text = str_replace("\n", '<br />', censor_text($text)); + + return $text; +} + +/** +* For parsing custom parsed text to be stored within the database. +* This function additionally returns the uid and bitfield that needs to be stored. +* Expects $text to be the value directly from request_var() and in it's non-parsed form +*/ +function generate_text_for_storage(&$text, &$uid, &$bitfield, $allow_bbcode = false, $allow_urls = false, $allow_smilies = false) +{ + global $phpbb_root_path, $phpEx; + + $uid = ''; + $bitfield = 0; + + if (!$text) + { + return; + } + + if (!class_exists('parse_message')) + { + include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx); + } + + $message_parser = new parse_message($text); + $message_parser->parse($allow_bbcode, $allow_urls, $allow_smilies); + + $text = $message_parser->message; + $uid = $message_parser->bbcode_uid; + + // If the bbcode_bitfield is empty, there is no need for the uid to be stored. + if (!$message_parser->bbcode_bitfield) + { + $uid = ''; + } + + $flags = (($allow_bbcode) ? 1 : 0) + (($allow_smilies) ? 2 : 0) + (($allow_urls) ? 4 : 0); + $bitfield = $flags + ($message_parser->bbcode_bitfield << 3); + + return; +} + +/** +* For decoding custom parsed text for edits as well as extracting the flags +* Expects $text to be the value directly from the database (pre-parsed content) +*/ +function generate_text_for_edit($text, $uid, $bitfield) +{ + global $phpbb_root_path, $phpEx; + + // Get forum flags... + $flags = $bitfield; + if ($flags >> 3) + { + $flags = bindec(substr(decbin($flags), strlen(decbin($flags >> 3)))); + } + + decode_message($text, $uid); + + return array( + 'allow_bbcode' => ($flags & 1) ? 1 : 0, + 'allow_smilies' => ($flags & 2) ? 1 : 0, + 'allow_urls' => ($flags & 4) ? 1 : 0, + 'text' => $text + ); +} + + +/** * Censoring */ function censor_text($text) @@ -1591,7 +1742,9 @@ function censor_text($text) { $censors = array(); - // TODO: For ANONYMOUS, this option should be enabled by default + /** + * @todo For ANONYMOUS censoring should be enabled by default + */ if ($user->optionget('viewcensors')) { $cache->obtain_word_list($censors); diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 78dba728cf..398639034f 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -223,7 +223,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'S_IS_CAT' => true, 'FORUM_ID' => $row['forum_id'], 'FORUM_NAME' => $row['forum_name'], - 'FORUM_DESC' => $row['forum_desc'], + 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield']), 'U_VIEWFORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $row['forum_id']) ); @@ -319,7 +319,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'FORUM_ID' => $row['forum_id'], 'FORUM_NAME' => $row['forum_name'], - 'FORUM_DESC' => $row['forum_desc'], + 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield']), 'TOPICS' => $row['forum_topics'], $l_post_click_count => $post_click_count, 'FORUM_FOLDER_IMG' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang['folder_alt'] . '" />' : $user->img($folder_image, $folder_alt), @@ -370,14 +370,7 @@ function generate_forum_rules(&$forum_data) if ($forum_data['forum_rules']) { - include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); - $bbcode = new bbcode($forum_data['forum_rules_bbcode_bitfield']); - - $bbcode->bbcode_second_pass($forum_data['forum_rules'], $forum_data['forum_rules_bbcode_uid']); - - $forum_data['forum_rules'] = smiley_text($forum_data['forum_rules'], !($forum_data['forum_rules_flags'] & 2)); - $forum_data['forum_rules'] = str_replace("\n", '<br />', censor_text($forum_data['forum_rules'])); - unset($bbcode); + $forum_data['forum_rules'] = generate_text_for_display($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield']); } $template->assign_vars(array( @@ -425,7 +418,7 @@ function generate_forum_nav(&$forum_data) $template->assign_vars(array( 'FORUM_ID' => $forum_data['forum_id'], 'FORUM_NAME' => $forum_data['forum_name'], - 'FORUM_DESC' => strip_tags($forum_data['forum_desc'])) + 'FORUM_DESC' => generate_text_for_display($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'])) ); return; diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 28f2ef40fd..ec4ef3bf72 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -473,34 +473,6 @@ function create_thumbnail($source, $destination, $mimetype) } /** -* DECODE TEXT -> This will/should be handled by bbcode.php eventually -*/ -function decode_message(&$message, $bbcode_uid = '') -{ - global $config; - - $match = array('<br />', "[/*:m:$bbcode_uid]", ":u:$bbcode_uid", ":o:$bbcode_uid", ":$bbcode_uid"); - $replace = array("\n", '', '', '', ''); - - $message = ($bbcode_uid) ? str_replace($match, $replace, $message) : str_replace('<br />', "\n", $message); - - $match = array( - '#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#', - '#<!\-\- m \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- m \-\->#', - '#<!\-\- w \-\-><a href="http:\/\/(.*?)" target="_blank">.*?</a><!\-\- w \-\->#', - '#<!\-\- l \-\-><a href="(.*?)">.*?</a><!\-\- l \-\->#', - '#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#', - '#<.*?>#s' - ); - - $replace = array('\1', '\1', '\1', '\1', '\1', '<\1>', ''); - - $message = preg_replace($match, $replace, $message); - - return; -} - -/** * Generate Topic Icons for display */ function posting_gen_topic_icons($mode, $icon_id) diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index aabf0a8236..94390b9f7f 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -569,12 +569,7 @@ class custom_profile if ($preview == false) { - include_once($phpbb_root_path . "includes/message_parser.$phpEx"); - include_once($phpbb_root_path . 'includes/functions_posting.'.$phpEx); - $message_parser = new parse_message(); - $message_parser->message = $value; - $message_parser->decode_message($user->profile_fields[str_replace('pf_', '', $profile_row['field_ident']) . '_bbcode_uid']); - $value = $message_parser->message; + decode_message($value, $user->profile_fields[str_replace('pf_', '', $profile_row['field_ident']) . '_bbcode_uid']); } $field_length = explode('|', $profile_row['field_length']); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index cd37808e36..4cb8a7b863 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1142,7 +1142,7 @@ function avatar_gallery($category, $avatar_select, $items_per_column, $block_var * Add or edit a group. If we're editing a group we only update user * parameters such as rank, etc. if they are changed */ -function group_create(&$group_id, $type, $name, $desc, $group_attributes) +function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow_desc_bbcode = false, $allow_desc_urls = false, $allow_desc_smilies = false) { global $phpbb_root_path, $config, $db, $user, $file_upload; @@ -1182,10 +1182,18 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes) { $sql_ary = array( 'group_name' => (string) $name, - 'group_description' => (string) $desc, + 'group_desc' => (string) $desc, + 'group_desc_uid' => '', + 'group_desc_bitfield' => 0, 'group_type' => (int) $type, ); + // Parse description + if ($desc) + { + generate_text_for_storage($sql_ary['group_desc'], $sql_ary['group_desc_uid'], $sql_ary['group_desc_bitfield'], $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies); + } + if (sizeof($group_attributes)) { foreach ($attribute_ary as $attribute => $type) diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 4c02830bcb..0d07f3f0f6 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -61,7 +61,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $template->assign_vars(array( 'FORUM_NAME' => $forum_info['forum_name'], - 'FORUM_DESCRIPTION' => $forum_info['forum_desc'], + 'FORUM_DESCRIPTION' => generate_text_for_display($forum_info['forum_desc'], $forum_info['forum_desc_uid'], $forum_info['forum_desc_bitfield']), 'REPORTED_IMG' => $user->img('icon_reported', 'TOPIC_REPORTED'), 'UNAPPROVED_IMG' => $user->img('icon_unapproved', 'TOPIC_UNAPPROVED'), diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 87169bacfc..25829d5186 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -183,7 +183,7 @@ class session if ($this->time_now - $this->data['session_time'] > 60 || $this->data['session_page'] != $this->page['page']) { $sql = 'UPDATE ' . SESSIONS_TABLE . " - SET session_time = $this->time_now, session_page = '" . $db->sql_escape($this->page['page']) . "' + SET session_time = $this->time_now, session_page = '" . $db->sql_escape(substr($this->page['page'], 0, 199)) . "' WHERE session_id = '" . $db->sql_escape($this->session_id) . "'"; $db->sql_query($sql); } @@ -380,7 +380,7 @@ class session 'session_last_visit' => (int) $this->data['session_last_visit'], 'session_time' => (int) $this->time_now, 'session_browser' => (string) $this->browser, - 'session_page' => (string) $this->page['page'], + 'session_page' => (string) substr($this->page['page'], 0, 199), 'session_ip' => (string) $this->ip, 'session_admin' => ($set_admin) ? 1 : 0, 'session_viewonline' => ($viewonline) ? 1 : 0, diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 3cd898e772..c6e0c3040e 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -248,7 +248,7 @@ class ucp_groups } } - $sql = 'SELECT g.group_id, g.group_name, g.group_description, g.group_type, ug.group_leader, ug.user_pending + $sql = 'SELECT g.group_id, g.group_name, g.group_desc, g.group_desc_uid, g.group_desc_bitfield, g.group_type, ug.group_leader, ug.user_pending FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . ' ug WHERE ug.user_id = ' . $user->data['user_id'] . ' AND g.group_id = ug.group_id @@ -287,7 +287,7 @@ class ucp_groups $template->assign_block_vars($block, array( 'GROUP_ID' => $row['group_id'], 'GROUP_NAME' => ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'], - 'GROUP_DESC' => ($row['group_type'] <> GROUP_SPECIAL) ? $row['group_description'] : $user->lang['GROUP_IS_SPECIAL'], + 'GROUP_DESC' => ($row['group_type'] <> GROUP_SPECIAL) ? generate_text_for_display($row['group_desc'], $row['group_desc_uid'], $row['group_desc_bitfield']) : $user->lang['GROUP_IS_SPECIAL'], 'GROUP_SPECIAL' => ($row['group_type'] <> GROUP_SPECIAL) ? false : true, 'GROUP_STATUS' => $user->lang['GROUP_IS_' . $group_status], @@ -303,7 +303,7 @@ class ucp_groups // Hide hidden groups unless user is an admin with group privileges $sql_and = ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? '<> ' . GROUP_SPECIAL : 'NOT IN (' . GROUP_SPECIAL . ', ' . GROUP_HIDDEN . ')'; - $sql = 'SELECT group_id, group_name, group_description, group_type + $sql = 'SELECT group_id, group_name, group_desc, group_desc_uid, group_desc_bitfield, group_type FROM ' . GROUPS_TABLE . ' WHERE group_id NOT IN (' . implode(', ', $group_id_ary) . ") AND group_type $sql_and @@ -339,7 +339,7 @@ class ucp_groups $template->assign_block_vars('nonmember', array( 'GROUP_ID' => $row['group_id'], 'GROUP_NAME' => ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'], - 'GROUP_DESC' => ($row['group_type'] <> GROUP_SPECIAL) ? $row['group_description'] : $user->lang['GROUP_IS_SPECIAL'], + 'GROUP_DESC' => ($row['group_type'] <> GROUP_SPECIAL) ? generate_text_for_display($row['group_desc'], $row['group_desc_uid'], $row['group_desc_bitfield']) : $user->lang['GROUP_IS_SPECIAL'], 'GROUP_SPECIAL' => ($row['group_type'] <> GROUP_SPECIAL) ? false : true, 'GROUP_CLOSED' => ($row['group_type'] <> GROUP_CLOSED || $auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? false : true, 'GROUP_STATUS' => $user->lang['GROUP_IS_' . $group_status], @@ -415,10 +415,14 @@ class ucp_groups // Did we submit? if ($update) { - $group_name = request_var('group_name', ''); - $group_description = request_var('group_description', ''); + $group_name = request_var('group_name', '', true); + $group_desc = request_var('group_desc', '', true); $group_type = request_var('group_type', GROUP_FREE); + $allow_desc_bbcode = request_var('desc_parse_bbcode', false); + $allow_desc_urls = request_var('desc_parse_urls', false); + $allow_desc_smilies = request_var('desc_parse_smilies', false); + $data['uploadurl'] = request_var('uploadurl', ''); $data['remotelink'] = request_var('remotelink', ''); $delete = request_var('delete', ''); @@ -496,23 +500,39 @@ class ucp_groups } } - if (!($error = group_create($group_id, $group_type, $group_name, $group_description, $group_attributes))) + if (!($error = group_create($group_id, $group_type, $group_name, $group_desc, $group_attributes, $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies))) { $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED'; trigger_error($user->lang[$message] . $return_page); } + else + { + $group_rank = $submit_ary['rank']; + + $group_desc_data = array( + 'text' => $group_desc, + 'allow_bbcode' => $allow_desc_bbcode, + 'allow_smilies' => $allow_desc_smilies, + 'allow_urls' => $allow_desc_urls + ); + } } else if (!$group_id) { - $group_name = request_var('group_name', ''); - $group_description = ''; + $group_name = request_var('group_name', '', true); + $group_desc_data = array( + 'text' => '', + 'allow_bbcode' => true, + 'allow_smilies' => true, + 'allow_urls' => true + ); $group_rank = 0; $group_type = GROUP_OPEN; } else { $group_name = $group_row['group_name']; - $group_description = $group_row['group_description']; + $group_desc_data = generate_text_for_edit($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield']); $group_type = $group_row['group_type']; $group_rank = $group_row['group_rank']; } @@ -576,11 +596,15 @@ class ucp_groups 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '', 'GROUP_NAME' => ($group_type == GROUP_SPECIAL) ? $user->lang['G_' . $group_name] : $group_name, 'GROUP_INTERNAL_NAME' => $group_name, - 'GROUP_DESCRIPTION' => $group_description, + 'GROUP_DESC' => $group_desc_data['text'], 'GROUP_RECEIVE_PM' => (isset($group_row['group_receive_pm']) && $group_row['group_receive_pm']) ? ' checked="checked"' : '', 'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0, 'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '', + 'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'], + 'S_DESC_URLS_CHECKED' => $group_desc_data['allow_urls'], + 'S_DESC_SMILIES_CHECKED'=> $group_desc_data['allow_smilies'], + 'S_RANK_OPTIONS' => $rank_options, 'AVATAR_IMAGE' => $avatar_img, 'AVATAR_MAX_FILESIZE' => $config['avatar_filesize'], @@ -848,7 +872,7 @@ class ucp_groups default: $user->add_lang('acp/common'); - $sql = 'SELECT g.group_id, g.group_name, g.group_description, g.group_type, ug.group_leader + $sql = 'SELECT g.group_id, g.group_name, g.group_desc, g.group_desc_uid, g.group_desc_bitfield, g.group_type, ug.group_leader FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . ' ug WHERE ug.user_id = ' . $user->data['user_id'] . ' AND g.group_id = ug.group_id @@ -860,7 +884,7 @@ class ucp_groups { $template->assign_block_vars('leader', array( 'GROUP_NAME' => ($value['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $value['group_name']] : $value['group_name'], - 'GROUP_DESC' => $value['group_description'], + 'GROUP_DESC' => generate_text_for_display($value['group_desc'], $value['group_desc_uid'], $value['group_desc_bitfield']), 'GROUP_TYPE' => $value['group_type'], 'GROUP_ID' => $value['group_id'], diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 5b61f430b0..948aa3999c 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -50,7 +50,7 @@ class ucp_prefs } $var_ary = array( - 'dateformat' => array('string', false, 3, 15), + 'dateformat' => array('string', false, 3, 30), 'lang' => array('match', false, '#^[a-z_]{2,}$#i'), 'tz' => array('num', false, -13, 13), ); diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 1232ae37f8..09d4f37d64 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -223,10 +223,7 @@ class ucp_profile case 'profile_info': include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); - include($phpbb_root_path . 'includes/message_parser.'.$phpEx); - // TODO: The posting file is included because $message_parser->decode_message() relies on decode_message() in the posting functions. - include($phpbb_root_path . 'includes/functions_posting.'.$phpEx); - + $cp = new custom_profile(); $cp_data = $cp_error = array(); diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index dfa2495282..54ec5f5ced 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -181,15 +181,16 @@ CREATE TABLE phpbb_forums ( forum_parents BLOB SUB_TYPE TEXT, forum_name VARCHAR(150) NOT NULL, forum_desc BLOB SUB_TYPE TEXT, + forum_desc_bitfield INTEGER DEFAULT 0 NOT NULL, + forum_desc_uid VARCHAR(5) NOT NULL, forum_link VARCHAR(200) NOT NULL, forum_password VARCHAR(32) NOT NULL, forum_style INTEGER, forum_image VARCHAR(50) NOT NULL, forum_rules BLOB SUB_TYPE TEXT NOT NULL, forum_rules_link VARCHAR(200) NOT NULL, - forum_rules_flags INTEGER DEFAULT 0 NOT NULL, - forum_rules_bbcode_bitfield INTEGER DEFAULT 0 NOT NULL, - forum_rules_bbcode_uid VARCHAR(5) NOT NULL, + forum_rules_bitfield INTEGER DEFAULT 0 NOT NULL, + forum_rules_uid VARCHAR(5) NOT NULL, forum_topics_per_page INTEGER DEFAULT 0 NOT NULL, forum_type INTEGER DEFAULT 0 NOT NULL, forum_status INTEGER DEFAULT 0 NOT NULL, @@ -230,6 +231,9 @@ CREATE TABLE phpbb_groups ( group_id INTEGER NOT NULL, group_type INTEGER DEFAULT 1 NOT NULL, group_name VARCHAR(40) NOT NULL, + group_desc BLOB SUB_TYPE TEXT, + group_desc_bitfield INTEGER DEFAULT 0 NOT NULL, + group_desc_uid VARCHAR(5) NOT NULL, group_display INTEGER DEFAULT 0 NOT NULL, group_avatar VARCHAR(100) NOT NULL, group_avatar_type INTEGER DEFAULT 0 NOT NULL, @@ -241,7 +245,6 @@ CREATE TABLE phpbb_groups ( group_receive_pm INTEGER DEFAULT 0 NOT NULL, group_message_limit INTEGER DEFAULT 0 NOT NULL, group_chgpass INTEGER DEFAULT 0 NOT NULL, - group_description VARCHAR(255) NOT NULL, group_legend INTEGER DEFAULT 1 NOT NULL );; @@ -515,7 +518,7 @@ CREATE TABLE phpbb_sessions ( session_time INTEGER DEFAULT 0 NOT NULL, session_ip VARCHAR(40) DEFAULT '0' NOT NULL, session_browser VARCHAR(150), - session_page VARCHAR(100) NOT NULL, + session_page VARCHAR(200) NOT NULL, session_viewonline INTEGER DEFAULT 1 NOT NULL, session_admin INTEGER DEFAULT 0 NOT NULL );; @@ -756,7 +759,7 @@ CREATE TABLE phpbb_users ( user_lastvisit INTEGER DEFAULT 0 NOT NULL, user_lastmark INTEGER DEFAULT 0 NOT NULL, user_lastpost_time INTEGER DEFAULT 0 NOT NULL, - user_lastpage VARCHAR(100) NOT NULL, + user_lastpage VARCHAR(200) NOT NULL, user_last_confirm_key VARCHAR(10) NOT NULL, user_warnings INTEGER DEFAULT 0 NOT NULL, user_last_warning INTEGER DEFAULT 0 NOT NULL, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index bd6e6b59af..95afdc50e7 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -187,15 +187,16 @@ CREATE TABLE [phpbb_forums] ( [forum_parents] [text] NULL , [forum_name] [varchar] (150) NOT NULL , [forum_desc] [text] NULL , + [forum_desc_bitfield] [int] NOT NULL , + [forum_desc_uid] [varchar] (5) NOT NULL , [forum_link] [varchar] (200) NOT NULL , [forum_password] [varchar] (32) NOT NULL , [forum_style] [int] NULL , [forum_image] [varchar] (50) NOT NULL , [forum_rules] [text] NOT NULL , [forum_rules_link] [varchar] (200) NOT NULL , - [forum_rules_flags] [int] NOT NULL , - [forum_rules_bbcode_bitfield] [int] NOT NULL , - [forum_rules_bbcode_uid] [varchar] (5) NOT NULL , + [forum_rules_bitfield] [int] NOT NULL , + [forum_rules_uid] [varchar] (5) NOT NULL , [forum_topics_per_page] [int] NOT NULL , [forum_type] [int] NOT NULL , [forum_status] [int] NOT NULL , @@ -236,6 +237,9 @@ CREATE TABLE [phpbb_groups] ( [group_id] [int] IDENTITY (1, 1) NOT NULL , [group_type] [int] NOT NULL , [group_name] [varchar] (40) NOT NULL , + [group_desc] [text] NULL , + [group_desc_bitfield] [int] NOT NULL , + [group_desc_uid] [varchar] (5) NOT NULL , [group_display] [int] NOT NULL , [group_avatar] [varchar] (100) NOT NULL , [group_avatar_type] [int] NOT NULL , @@ -247,7 +251,6 @@ CREATE TABLE [phpbb_groups] ( [group_receive_pm] [int] NOT NULL , [group_message_limit] [int] NOT NULL , [group_chgpass] [int] NOT NULL , - [group_description] [varchar] (255) NOT NULL , [group_legend] [int] NOT NULL ) ON [PRIMARY] GO @@ -521,7 +524,7 @@ CREATE TABLE [phpbb_sessions] ( [session_time] [int] NOT NULL , [session_ip] [varchar] (40) NOT NULL , [session_browser] [varchar] (150) NULL , - [session_page] [varchar] (100) NOT NULL , + [session_page] [varchar] (200) NOT NULL , [session_viewonline] [int] NOT NULL , [session_admin] [int] NOT NULL ) ON [PRIMARY] @@ -762,7 +765,7 @@ CREATE TABLE [phpbb_users] ( [user_lastvisit] [int] NOT NULL , [user_lastmark] [int] NOT NULL , [user_lastpost_time] [int] NOT NULL , - [user_lastpage] [varchar] (100) NOT NULL , + [user_lastpage] [varchar] (200) NOT NULL , [user_last_confirm_key] [varchar] (10) NOT NULL , [user_warnings] [int] NOT NULL , [user_last_warning] [int] NOT NULL , @@ -1299,8 +1302,8 @@ ALTER TABLE [phpbb_forums] WITH NOCHECK ADD CONSTRAINT [DF_forums_parent_id] DEFAULT (0) FOR [parent_id], CONSTRAINT [DF_forums_left_id] DEFAULT (0) FOR [left_id], CONSTRAINT [DF_forums_right_id] DEFAULT (0) FOR [right_id], - CONSTRAINT [DF_forums_rules_flags] DEFAULT (0) FOR [forum_rules_flags], - CONSTRAINT [DF_forums_rules_bbcode_bitfiel] DEFAULT (0) FOR [forum_rules_bbcode_bitfield], + CONSTRAINT [DF_forums_desc_bitfield] DEFAULT (0) FOR [forum_desc_bitfield], + CONSTRAINT [DF_forums_rules_bitfield] DEFAULT (0) FOR [forum_rules_bitfield], CONSTRAINT [DF_forums_topics_per_page] DEFAULT (0) FOR [forum_topics_per_page], CONSTRAINT [DF_forums_forum_type] DEFAULT (0) FOR [forum_type], CONSTRAINT [DF_forums_forum_status] DEFAULT (0) FOR [forum_status], @@ -1335,6 +1338,7 @@ GO ALTER TABLE [phpbb_groups] WITH NOCHECK ADD CONSTRAINT [DF_groups_group_type] DEFAULT (1) FOR [group_type], CONSTRAINT [DF_groups_group_display] DEFAULT (0) FOR [group_display], + CONSTRAINT [DF_groups_group_desc_bitfield] DEFAULT (0) FOR [group_desc_bitfield], CONSTRAINT [DF_groups_group_avatar_type] DEFAULT (0) FOR [group_avatar_type], CONSTRAINT [DF_groups_group_avatar_width] DEFAULT (0) FOR [group_avatar_width], CONSTRAINT [DF_groups_group_avatar_height] DEFAULT (0) FOR [group_avatar_height], diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index be12faa9ab..54776af947 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -207,15 +207,16 @@ CREATE TABLE phpbb_forums ( forum_parents text, forum_name varchar(150) NOT NULL, forum_desc text, + forum_desc_bitfield int(11) UNSIGNED DEFAULT '0' NOT NULL, + forum_desc_uid varchar(5) DEFAULT '' NOT NULL, forum_link varchar(200) DEFAULT '' NOT NULL, forum_password varchar(32) DEFAULT '' NOT NULL, forum_style tinyint(4) UNSIGNED, forum_image varchar(50) DEFAULT '' NOT NULL, forum_rules text DEFAULT '' NOT NULL, forum_rules_link varchar(200) DEFAULT '' NOT NULL, - forum_rules_flags tinyint(4) UNSIGNED DEFAULT '0' NOT NULL, - forum_rules_bbcode_bitfield int(11) UNSIGNED DEFAULT '0' NOT NULL, - forum_rules_bbcode_uid varchar(5) DEFAULT '' NOT NULL, + forum_rules_bitfield int(11) UNSIGNED DEFAULT '0' NOT NULL, + forum_rules_uid varchar(5) DEFAULT '' NOT NULL, forum_topics_per_page tinyint(4) UNSIGNED DEFAULT '0' NOT NULL, forum_type tinyint(4) DEFAULT '0' NOT NULL, forum_status tinyint(4) DEFAULT '0' NOT NULL, @@ -271,6 +272,9 @@ CREATE TABLE phpbb_groups ( group_id mediumint(8) NOT NULL auto_increment, group_type tinyint(4) DEFAULT '1' NOT NULL, group_name varchar(40) DEFAULT '' NOT NULL, + group_desc text, + group_desc_bitfield int(11) UNSIGNED DEFAULT '0' NOT NULL, + group_desc_uid varchar(5) DEFAULT '' NOT NULL, group_display tinyint(1) DEFAULT '0' NOT NULL, group_avatar varchar(100) DEFAULT '' NOT NULL, group_avatar_type tinyint(4) DEFAULT '0' NOT NULL, @@ -282,7 +286,6 @@ CREATE TABLE phpbb_groups ( group_receive_pm tinyint(1) DEFAULT '0' NOT NULL, group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, group_chgpass smallint(6) DEFAULT '0' NOT NULL, - group_description varchar(255) DEFAULT '' NOT NULL, group_legend tinyint(1) DEFAULT '1' NOT NULL, PRIMARY KEY (group_id), KEY group_legend (group_legend) @@ -606,7 +609,7 @@ CREATE TABLE phpbb_sessions ( session_time int(11) DEFAULT '0' NOT NULL, session_ip varchar(40) DEFAULT '0' NOT NULL, session_browser varchar(150) DEFAULT '' NOT NULL, - session_page varchar(100) DEFAULT '' NOT NULL, + session_page varchar(200) DEFAULT '' NOT NULL, session_viewonline tinyint(1) DEFAULT '1' NOT NULL, session_admin tinyint(1) DEFAULT '0' NOT NULL, PRIMARY KEY (session_id), @@ -880,7 +883,7 @@ CREATE TABLE phpbb_users ( user_lastvisit int(11) DEFAULT '0' NOT NULL, user_lastmark int(11) DEFAULT '0' NOT NULL, user_lastpost_time int(11) DEFAULT '0' NOT NULL, - user_lastpage varchar(100) DEFAULT '' NOT NULL, + user_lastpage varchar(200) DEFAULT '' NOT NULL, user_last_confirm_key varchar(10) DEFAULT '' NOT NULL, user_warnings tinyint(4) DEFAULT '0' NOT NULL, user_last_warning int(11) DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index a181532783..928c22c0aa 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -458,15 +458,16 @@ CREATE TABLE phpbb_forums ( forum_parents clob, forum_name varchar2(150), forum_desc clob, + forum_desc_bitfield number(11) DEFAULT '0' NOT NULL, + forum_desc_uid varchar2(5) DEFAULT '', forum_link varchar2(200) DEFAULT '', forum_password varchar2(32) DEFAULT '', forum_style number(4), forum_image varchar2(50) DEFAULT '', forum_rules clob DEFAULT '', forum_rules_link varchar2(200) DEFAULT '', - forum_rules_flags number(4) DEFAULT '0' NOT NULL, - forum_rules_bbcode_bitfield number(11) DEFAULT '0' NOT NULL, - forum_rules_bbcode_uid varchar2(5) DEFAULT '', + forum_rules_bitfield number(11) DEFAULT '0' NOT NULL, + forum_rules_uid varchar2(5) DEFAULT '', forum_topics_per_page number(4) DEFAULT '0' NOT NULL, forum_type number(4) DEFAULT '0' NOT NULL, forum_status number(4) DEFAULT '0' NOT NULL, @@ -556,6 +557,9 @@ CREATE TABLE phpbb_groups ( group_id number(8) NOT NULL, group_type number(4) DEFAULT '1' NOT NULL, group_name varchar2(40) DEFAULT '', + group_desc clob, + group_desc_bitfield number(11) DEFAULT '0' NOT NULL, + group_desc_uid varchar2(5) DEFAULT '', group_display number(1) DEFAULT '0' NOT NULL, group_avatar varchar2(100) DEFAULT '', group_avatar_type number(4) DEFAULT '0' NOT NULL, @@ -567,7 +571,6 @@ CREATE TABLE phpbb_groups ( group_receive_pm number(1) DEFAULT '0' NOT NULL, group_message_limit number(8) DEFAULT '0' NOT NULL, group_chgpass number(6) DEFAULT '0' NOT NULL, - group_description varchar2(255) DEFAULT '', group_legend number(1) DEFAULT '1' NOT NULL, CONSTRAINT pk_phpbb_groups PRIMARY KEY (group_id) ) @@ -1215,7 +1218,7 @@ CREATE TABLE phpbb_sessions ( session_time number(11) DEFAULT '0' NOT NULL, session_ip varchar2(40) DEFAULT '0', session_browser varchar2(150) DEFAULT '', - session_page varchar2(100) DEFAULT '', + session_page varchar2(200) DEFAULT '', session_viewonline number(1) DEFAULT '1' NOT NULL, session_admin number(1) DEFAULT '0' NOT NULL, CONSTRAINT pk_phpbb_sessions PRIMARY KEY (session_id) @@ -1662,7 +1665,7 @@ CREATE TABLE phpbb_users ( user_lastvisit number(11) DEFAULT '0' NOT NULL, user_lastmark number(11) DEFAULT '0' NOT NULL, user_lastpost_time number(11) DEFAULT '0' NOT NULL, - user_lastpage varchar2(100) DEFAULT '', + user_lastpage varchar2(200) DEFAULT '', user_last_confirm_key varchar2(10) DEFAULT '', user_warnings number(4) DEFAULT '0' NOT NULL, user_last_warning number(11) DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index f695ab8be6..4d956b5df0 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -275,15 +275,16 @@ CREATE TABLE phpbb_forums ( forum_parents text, forum_name varchar(150) NOT NULL, forum_desc text, + forum_desc_bitfield INT4 DEFAULT '0' NOT NULL, + forum_desc_uid varchar(5) DEFAULT '' NOT NULL, forum_link varchar(200) DEFAULT '' NOT NULL, forum_password varchar(32) DEFAULT '' NOT NULL, forum_style INT2 , forum_image varchar(50) DEFAULT '' NOT NULL, forum_rules text DEFAULT '' NOT NULL, forum_rules_link varchar(200) DEFAULT '' NOT NULL, - forum_rules_flags INT2 DEFAULT '0' NOT NULL, - forum_rules_bbcode_bitfield INT4 DEFAULT '0' NOT NULL, - forum_rules_bbcode_uid varchar(5) DEFAULT '' NOT NULL, + forum_rules_bitfield INT4 DEFAULT '0' NOT NULL, + forum_rules_uid varchar(5) DEFAULT '' NOT NULL, forum_topics_per_page INT2 DEFAULT '0' NOT NULL, forum_type INT2 DEFAULT '0' NOT NULL, forum_status INT2 DEFAULT '0' NOT NULL, @@ -308,8 +309,8 @@ CREATE TABLE phpbb_forums ( CHECK (left_id>=0), CHECK (right_id>=0), CHECK (forum_style>=0), - CHECK (forum_rules_flags>=0), - CHECK (forum_rules_bbcode_bitfield>=0), + CHECK (forum_desc_bitfield>=0), + CHECK (forum_rules_bitfield>=0), CHECK (forum_topics_per_page>=0), CHECK (forum_posts>=0), CHECK (forum_topics>=0), @@ -364,6 +365,9 @@ CREATE TABLE phpbb_groups ( group_id INT4 DEFAULT nextval('phpbb_groups_group_id_seq'), group_type INT2 DEFAULT '1' NOT NULL, group_name varchar(40) DEFAULT '' NOT NULL, + group_desc text, + group_desc_bitfield INT4 DEFAULT '0' NOT NULL, + group_desc_uid varchar(5) DEFAULT '' NOT NULL, group_display INT2 DEFAULT '0' NOT NULL, group_avatar varchar(100) DEFAULT '' NOT NULL, group_avatar_type INT2 DEFAULT '0' NOT NULL, @@ -375,11 +379,11 @@ CREATE TABLE phpbb_groups ( group_receive_pm INT2 DEFAULT '0' NOT NULL, group_message_limit INT4 DEFAULT '0' NOT NULL, group_chgpass INT2 DEFAULT '0' NOT NULL, - group_description varchar(255) DEFAULT '' NOT NULL, group_legend INT2 DEFAULT '1' NOT NULL, PRIMARY KEY (group_id), CHECK (group_avatar_width>=0), CHECK (group_avatar_height>=0), + CHECK (group_desc_bitfield>=0), CHECK (group_sig_chars>=0), CHECK (group_message_limit>=0) ); @@ -822,7 +826,7 @@ CREATE TABLE phpbb_sessions ( session_time INT4 DEFAULT '0' NOT NULL, session_ip varchar(40) DEFAULT '0' NOT NULL, session_browser varchar(150) DEFAULT '' NULL, - session_page varchar(100) DEFAULT '' NOT NULL, + session_page varchar(200) DEFAULT '' NOT NULL, session_viewonline INT2 DEFAULT '1' NOT NULL, session_admin INT2 DEFAULT '0' NOT NULL, PRIMARY KEY (session_id), @@ -1165,7 +1169,7 @@ CREATE TABLE phpbb_users ( user_lastvisit INT4 DEFAULT '0' NOT NULL, user_lastmark INT4 DEFAULT '0' NOT NULL, user_lastpost_time INT4 DEFAULT '0' NOT NULL, - user_lastpage varchar(100) DEFAULT '' NOT NULL, + user_lastpage varchar(200) DEFAULT '' NOT NULL, user_last_confirm_key varchar(10) DEFAULT '' NOT NULL, user_warnings INT2 DEFAULT '0' NOT NULL, user_last_warning INT4 DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 00db91bd2e..4416e73907 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -379,9 +379,9 @@ INSERT INTO phpbb_lang (lang_id, lang_iso, lang_dir, lang_english_name, lang_loc # MSSQL IDENTITY phpbb_forums ON # # -- Forums -INSERT INTO phpbb_forums (forum_id, forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_bbcode_uid, prune_days, prune_viewed) VALUES (1, 'My first Category', '', 1, 4, 0, 0, 1, 1, 1, 1, 2, 'Admin', 972086460, '', '', '', '', '', '', 0, 0); +INSERT INTO phpbb_forums (forum_id, forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed) VALUES (1, 'My first Category', '', 1, 4, 0, 0, 1, 1, 1, 1, 2, 'Admin', 972086460, '', '', '', '', '', '', '', 0, 0); -INSERT INTO phpbb_forums (forum_id, forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_bbcode_uid, prune_days, prune_viewed) VALUES (2, 'Test Forum 1', 'This is just a test forum.', 2, 3, 1, 1, 1, 1, 1, 1, 2, 'Admin', 972086460, '', '', '', '', '', '', 0, 0); +INSERT INTO phpbb_forums (forum_id, forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed) VALUES (2, 'Test Forum 1', 'This is just a test forum.', 2, 3, 1, 1, 1, 1, 1, 1, 2, 'Admin', 972086460, '', '', '', '', '', '', '', 0, 0); # MSSQL IDENTITY phpbb_forums OFF # @@ -406,14 +406,14 @@ INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, u # MSSQL IDENTITY phpbb_groups ON # # -- Groups -INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_description) VALUES (1, 'GUESTS', 3, '', 0, '', ''); -INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_description) VALUES (2, 'INACTIVE', 3, '', 0, '', ''); -INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_description) VALUES (3, 'INACTIVE_COPPA', 3, '', 0, '', ''); -INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_description) VALUES (4, 'REGISTERED', 3, '', 0, '', ''); -INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_description) VALUES (5, 'REGISTERED_COPPA', 3, '', 0, '', ''); -INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_description) VALUES (6, 'SUPER_MODERATORS', 3, '00AA00', 0, '', ''); -INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_description) VALUES (7, 'ADMINISTRATORS', 3, 'AA0000', 1, '', ''); -INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_description) VALUES (8, 'BOTS', 3, '9E8DA7', 1, '', ''); +INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES (1, 'GUESTS', 3, '', 0, '', '', ''); +INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES (2, 'INACTIVE', 3, '', 0, '', '', ''); +INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES (3, 'INACTIVE_COPPA', 3, '', 0, '', '', ''); +INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES (4, 'REGISTERED', 3, '', 0, '', '', ''); +INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES (5, 'REGISTERED_COPPA', 3, '', 0, '', '', ''); +INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES (6, 'SUPER_MODERATORS', 3, '00AA00', 0, '', '', ''); +INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES (7, 'ADMINISTRATORS', 3, 'AA0000', 1, '', '', ''); +INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES (8, 'BOTS', 3, '9E8DA7', 1, '', '', ''); # MSSQL IDENTITY phpbb_groups OFF # diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 39f12d16a7..366e42305c 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -209,15 +209,16 @@ CREATE TABLE phpbb_forums ( forum_parents text(65535), forum_name varchar(150) NOT NULL, forum_desc text(65535), + forum_desc_bitfield int(11) NOT NULL DEFAULT '0', + forum_desc_uid varchar(5) NOT NULL DEFAULT '', forum_link varchar(200) NOT NULL DEFAULT '', forum_password varchar(32) NOT NULL DEFAULT '', forum_style tinyint(4), forum_image varchar(50) NOT NULL DEFAULT '', forum_rules text(65535) NOT NULL DEFAULT '', forum_rules_link varchar(200) NOT NULL DEFAULT '', - forum_rules_flags tinyint(4) NOT NULL DEFAULT '0', - forum_rules_bbcode_bitfield int(11) NOT NULL DEFAULT '0', - forum_rules_bbcode_uid varchar(5) NOT NULL DEFAULT '', + forum_rules_bitfield int(11) NOT NULL DEFAULT '0', + forum_rules_uid varchar(5) NOT NULL DEFAULT '', forum_topics_per_page tinyint(4) NOT NULL DEFAULT '0', forum_type tinyint(4) NOT NULL DEFAULT '0', forum_status tinyint(4) NOT NULL DEFAULT '0', @@ -274,6 +275,9 @@ CREATE TABLE phpbb_groups ( group_id INTEGER PRIMARY KEY NOT NULL, group_type tinyint(4) NOT NULL DEFAULT '1', group_name varchar(40) NOT NULL DEFAULT '', + group_desc text(65535), + group_desc_bitfield int(11) NOT NULL DEFAULT '0', + group_desc_uid varchar(5) NOT NULL DEFAULT '', group_display tinyint(1) NOT NULL DEFAULT '0', group_avatar varchar(100) NOT NULL DEFAULT '', group_avatar_type tinyint(4) NOT NULL DEFAULT '0', @@ -285,7 +289,6 @@ CREATE TABLE phpbb_groups ( group_receive_pm tinyint(1) NOT NULL DEFAULT '0', group_message_limit mediumint(8) NOT NULL DEFAULT '0', group_chgpass smallint(6) NOT NULL DEFAULT '0', - group_description varchar(255) NOT NULL DEFAULT '', group_legend tinyint(1) NOT NULL DEFAULT '1' ); @@ -608,7 +611,7 @@ CREATE TABLE phpbb_sessions ( session_time int(11) NOT NULL DEFAULT '0', session_ip varchar(40) NOT NULL DEFAULT '0', session_browser varchar(150) NOT NULL DEFAULT '', - session_page varchar(100) NOT NULL DEFAULT '', + session_page varchar(200) NOT NULL DEFAULT '', session_viewonline tinyint(1) NOT NULL DEFAULT '1', session_admin tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (session_id) @@ -884,7 +887,7 @@ CREATE TABLE phpbb_users ( user_lastvisit int(11) NOT NULL DEFAULT '0', user_lastmark int(11) NOT NULL DEFAULT '0', user_lastpost_time int(11) NOT NULL DEFAULT '0', - user_lastpage varchar(100) NOT NULL DEFAULT '', + user_lastpage varchar(200) NOT NULL DEFAULT '', user_last_confirm_key varchar(10) NOT NULL DEFAULT '', user_warnings tinyint(4) NOT NULL DEFAULT '0', user_last_warning int(11) NOT NULL DEFAULT '0', diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 308fdd0ede..c5c78d6c1a 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -226,6 +226,9 @@ $lang = array_merge($lang, array( 'OFF' => 'OFF', 'ON' => 'ON', + 'PARSE_BBCODE' => 'Parse BBCode', + 'PARSE_SMILIES' => 'Parse Smilies', + 'PARSE_URLS' => 'Parse Links', 'PROCEED_TO_ACP' => 'Click %sHere%s to proceed to the ACP', 'REMIND' => 'Remind', 'REORDER' => 'Reorder', diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php index 4e32b313ee..367c693cec 100644 --- a/phpBB/language/en/acp/forums.php +++ b/phpBB/language/en/acp/forums.php @@ -114,9 +114,6 @@ $lang = array_merge($lang, array( 'NO_PERMISSION_FORUM_DELETE' => 'You do not have the neccessary permissions to add forums', 'PARENT_NOT_EXIST' => 'Parent does not exist', - 'PARSE_BBCODE' => 'Parse BBCode', - 'PARSE_SMILIES' => 'Parse Smilies', - 'PARSE_URLS' => 'Parse Links', 'PRUNE_ANNOUNCEMENTS' => 'Prune Announcements', 'PRUNE_STICKY' => 'Prune Stickies', 'PRUNE_OLD_POLLS' => 'Prune Old Polls', @@ -132,22 +129,6 @@ $lang = array_merge($lang, array( 'TYPE_LINK' => 'Link', 'UNLOCKED' => 'Unlocked', - -/* - 'REMOVE' => 'Remove', - 'EDIT' => 'Edit', - 'MOVE_UP' => 'Move up', - 'MOVE_DOWN' => 'Move down', - 'UPDATE' => 'Update', - - - 'ENABLE_NEWS' => 'Set as news forum', - 'ENABLE_NEWS_EXPLAIN' => 'If set to yes posts in this forum will be displayed as news items.', - 'PRUNE_FINISHED_POLLS' => 'Prune Closed Polls', - 'PRUNE_FINISHED_POLLS_EXPLAIN'=> 'Removes topics with polls which have ended.', - 'ACTIVE_TOPICS_PAGE' => 'Number of active topics', - 'ACTIVE_TOPICS_PAGE_EXPLAIN' => 'If non-zero this value will override the default topics per page setting.', -*/ )); ?>
\ No newline at end of file diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index ce788c1230..6889858299 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -821,7 +821,7 @@ switch ($mode) } $template->assign_vars(array( - 'GROUP_DESC' => $group_row['group_description'], + 'GROUP_DESC' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield']), 'GROUP_NAME' => ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'], 'GROUP_COLOR' => $group_row['group_colour'], 'GROUP_TYPE' => $user->lang['GROUP_IS_' . $group_row['l_group_type']], diff --git a/phpBB/posting.php b/phpBB/posting.php index 371ce55e29..d6ab653763 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1042,19 +1042,20 @@ switch ($mode) } $forum_data = array( - 'parent_id' => $parent_id, - 'left_id' => $left_id, - 'right_id' => $right_id, - 'forum_parents' => $forum_parents, - 'forum_name' => $forum_name, - 'forum_id' => $forum_id, - 'forum_type' => $forum_type, - 'forum_desc' => $forum_desc, - 'forum_rules' => $forum_rules, - 'forum_rules_flags' => $forum_rules_flags, - 'forum_rules_bbcode_uid' => $forum_rules_bbcode_uid, - 'forum_rules_bbcode_bitfield' => $forum_rules_bbcode_bitfield, - 'forum_rules_link' => $forum_rules_link + 'parent_id' => $parent_id, + 'left_id' => $left_id, + 'right_id' => $right_id, + 'forum_parents' => $forum_parents, + 'forum_name' => $forum_name, + 'forum_id' => $forum_id, + 'forum_type' => $forum_type, + 'forum_desc' => $forum_desc, + 'forum_desc_uid' => $forum_desc_uid, + 'forum_desc_bitfield' => $forum_desc_bitfield, + 'forum_rules' => $forum_rules, + 'forum_rules_uid' => $forum_rules_uid, + 'forum_rules_bitfield' => $forum_rules_bitfield, + 'forum_rules_link' => $forum_rules_link ); // Build Navigation Links @@ -1076,7 +1077,7 @@ $template->assign_vars(array( 'L_MESSAGE_BODY_EXPLAIN'=> (intval($config['max_post_chars'])) ? sprintf($user->lang['MESSAGE_BODY_EXPLAIN'], intval($config['max_post_chars'])) : '', 'FORUM_NAME' => $forum_name, - 'FORUM_DESC' => ($forum_desc) ? strip_tags($forum_desc) : '', + 'FORUM_DESC' => ($forum_desc) ? generate_text_for_display($forum_desc, $forum_desc_uid, $forum_desc_bitfield) : '', 'TOPIC_TITLE' => $topic_title, 'MODERATORS' => (sizeof($moderators)) ? implode(', ', $moderators[$forum_id]) : '', 'USERNAME' => ((!$preview && $mode != 'quote') || $preview) ? stripslashes($username) : '', diff --git a/phpBB/styles/subSilver/template/ucp_groups_manage.html b/phpBB/styles/subSilver/template/ucp_groups_manage.html index 2d9e5b5900..ac798d7925 100644 --- a/phpBB/styles/subSilver/template/ucp_groups_manage.html +++ b/phpBB/styles/subSilver/template/ucp_groups_manage.html @@ -35,8 +35,10 @@ <td class="row2"><!-- IF S_SPECIAL_GROUP --><b>{GROUP_NAME}</b><!-- ENDIF --><input name="group_name" type="<!-- IF S_SPECIAL_GROUP -->hidden<!-- ELSE -->text<!-- ENDIF -->" id="group_name" value="{GROUP_INTERNAL_NAME}" /></td> </tr> <tr> - <td class="row1" width="35%"><label for="group_description">{L_GROUP_DESC}:</label></td> - <td class="row2"><input name="group_description" type="text" id="group_description" value="{GROUP_DESCRIPTION}" /></td> + <td class="row1" width="35%"><label for="group_desc">{L_GROUP_DESC}:</label></td> + <td class="row2"><textarea id="group_desc" name="group_desc" rows="5" cols="45">{GROUP_DESC}</textarea></dd> + <br /><input type="checkbox" name="desc_parse_bbcode"<!-- IF S_DESC_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE} <input type="checkbox" name="desc_parse_smilies"<!-- IF S_DESC_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES} <input type="checkbox" name="desc_parse_urls"<!-- IF S_DESC_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}</dd> + </td> </tr> <!-- IF not S_SPECIAL_GROUP --> <tr> diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 8b6464cccf..54d379475e 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -146,7 +146,7 @@ if ($view && !$post_id) // also allows for direct linking to a post (and the calculation of which // page the post is on and the correct display of viewtopic) $join_sql_table = ''; -$select_sql = 't.topic_id, t.forum_id, t.topic_title, t.topic_attachment, t.topic_status, t.topic_approved, t.topic_replies_real, t.topic_replies, t.topic_first_post_id, t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_post_time, t.topic_poster, t.topic_time, t.topic_time_limit, t.topic_type, t.topic_bumped, t.topic_bumper, t.poll_max_options, t.poll_start, t.poll_length, t.poll_title, t.poll_vote_change, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_type, f.forum_id, f.forum_style, f.forum_password, f.forum_rules, f.forum_rules_link, f.forum_rules_flags, f.forum_rules_bbcode_uid, f.forum_rules_bbcode_bitfield'; +$select_sql = 't.topic_id, t.forum_id, t.topic_title, t.topic_attachment, t.topic_status, t.topic_approved, t.topic_replies_real, t.topic_replies, t.topic_first_post_id, t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_post_time, t.topic_poster, t.topic_time, t.topic_time_limit, t.topic_type, t.topic_bumped, t.topic_bumper, t.poll_max_options, t.poll_start, t.poll_length, t.poll_title, t.poll_vote_change, f.forum_name, f.forum_desc, f.forum_desc_uid, f.forum_desc_bitfield, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_type, f.forum_id, f.forum_style, f.forum_password, f.forum_rules, f.forum_rules_link, f.forum_rules_uid, f.forum_rules_bitfield'; if (!$post_id) { @@ -453,7 +453,7 @@ $topic_data['topic_title'] = censor_text($topic_data['topic_title']); $template->assign_vars(array( 'FORUM_ID' => $forum_id, 'FORUM_NAME' => $topic_data['forum_name'], - 'FORUM_DESC' => $topic_data['forum_desc'], + 'FORUM_DESC' => generate_text_for_display($topic_data['forum_desc'], $topic_data['forum_desc_uid'], $topic_data['forum_desc_bitfield']), 'TOPIC_ID' => $topic_id, 'TOPIC_TITLE' => $topic_data['topic_title'], 'PAGINATION' => $pagination, |