From 73ac6b142375eaff4679a205a6bae537e4d019ac Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 20 Jul 2006 21:45:24 +0000 Subject: [PATCH] - some bugfixes - set ip_check to A.B.C. by default - display postings in other encodings by default and present link to force the encoding as usual. git-svn-id: file:///svn/phpbb/trunk@6198 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_users.html | 4 ++++ phpBB/includes/acp/acp_forums.php | 15 +++++++++++++- phpBB/includes/acp/acp_main.php | 1 + phpBB/includes/acp/acp_users.php | 3 ++- phpBB/includes/functions_admin.php | 9 ++------- phpBB/includes/functions_display.php | 4 ++-- phpBB/includes/functions_posting.php | 2 -- phpBB/includes/mcp/mcp_main.php | 2 +- phpBB/includes/ucp/ucp_prefs.php | 2 +- phpBB/includes/ucp/ucp_register.php | 2 +- phpBB/install/schemas/schema_data.sql | 2 +- phpBB/language/en/acp/common.php | 2 +- phpBB/language/en/common.php | 3 ++- phpBB/language/en/viewtopic.php | 2 +- phpBB/memberlist.php | 10 +++++++--- .../template/posting_attach_body.html | 2 +- .../subSilver/template/viewtopic_body.html | 9 ++++++++- .../subSilver/template/viewtopic_print.html | 4 ++-- phpBB/viewtopic.php | 20 +++++-------------- 19 files changed, 56 insertions(+), 42 deletions(-) diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html index 5ce4e6e00b..43fb940c39 100644 --- a/phpBB/adm/style/acp_users.html +++ b/phpBB/adm/style/acp_users.html @@ -101,6 +101,10 @@
{USER_LASTACTIVE}
+
+
+
{USER_POSTS}
+

{L_FOUNDER_EXPLAIN}
id="user_founder" checked="checked" disabled="disabled" /> {L_YES}  id="user_founder" checked="checked" disabled="disabled" /> {L_NO} 
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index ee87f8f5c6..21f633f4f6 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -342,7 +342,20 @@ class acp_forums $forum_data = $row; } - $parents_list = make_forum_select($forum_data['parent_id'], $forum_id, false, false, false); + // Make sure there is no forum displayed for parents_list having the current forum id as a parent... + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + WHERE parent_id = ' . $forum_id; + $result = $db->sql_query($sql); + + $exclude_forums = array($forum_id); + while ($row = $db->sql_fetchrow($result)) + { + $exclude_forums[] = $row['forum_id']; + } + $db->sql_freeresult($result); + + $parents_list = make_forum_select($forum_data['parent_id'], $exclude_forums, false, false, false); $forum_data['forum_password_confirm'] = $forum_data['forum_password']; } diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 8cde981346..5588f0dae9 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -242,6 +242,7 @@ class acp_main } add_log('admin', 'LOG_RESYNC_POSTCOUNTS'); + break; case 'date': diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 5c75c895ac..66e8a1ec70 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -809,6 +809,7 @@ class acp_users 'USER_LASTACTIVE' => ($user_row['user_lastvisit']) ? $user->format_date($user_row['user_lastvisit']) : ' - ', 'USER_EMAIL' => $user_row['user_email'], 'USER_WARNINGS' => $user_row['user_warnings'], + 'USER_POSTS' => $user_row['user_posts'], ) ); @@ -1159,7 +1160,7 @@ class acp_users $var_ary = array( 'dateformat' => array('string', false, 3, 30), - 'lang' => array('match', false, '#^[a-z_]{2,}$#i'), + 'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'), 'tz' => array('num', false, -14, 14), 'topic_sk' => array('string', false, 1, 1), diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 725bd52940..11e2623167 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -10,16 +10,10 @@ /** * Recalculate Binary Tree -*/ function recalc_btree($sql_id, $sql_table, $module_class = '') { global $db; - /* Init table, id's, etc... - $sql_id = 'module_id'; // 'forum_id' - $sql_table = MODULES_TABLE; // FORUMS_TABLE - */ - if (!$sql_id || !$sql_table) { return; @@ -103,6 +97,7 @@ function recalc_btree($sql_id, $sql_table, $module_class = '') } $db->sql_freeresult($f_result); } +*/ /** * Simple version of jumpbox, just lists authed forums @@ -498,7 +493,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true) } $return = array( - 'posts' => delete_posts($where_type, $where_ids, false, false) + 'posts' => delete_posts($where_type, $where_ids, false, true) ); $sql = 'SELECT topic_id, forum_id diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 14dfbfeb0d..720b7eb8b6 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1134,10 +1134,10 @@ function display_user_activity(&$userdata) $template->assign_vars(array( 'ACTIVE_FORUM' => $active_f_name, 'ACTIVE_FORUM_POSTS' => ($active_f_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_f_count), - 'ACTIVE_FORUM_PCT' => sprintf($user->lang['POST_PCT'], $active_f_pct), + 'ACTIVE_FORUM_PCT' => sprintf($user->lang['POST_PCT_ACTIVE'], $active_f_pct), 'ACTIVE_TOPIC' => censor_text($active_t_name), 'ACTIVE_TOPIC_POSTS' => ($active_t_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_t_count), - 'ACTIVE_TOPIC_PCT' => sprintf($user->lang['POST_PCT'], $active_t_pct), + 'ACTIVE_TOPIC_PCT' => sprintf($user->lang['POST_PCT_ACTIVE'], $active_t_pct), 'U_ACTIVE_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $active_f_id), 'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id)) ); diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 8f706905c8..d2ee32969b 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1175,7 +1175,6 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) { case 'delete_topic': delete_topics('topic_id', array($topic_id), false); - set_config('num_topics', $config['num_topics'] - 1, true); if ($data['topic_type'] != POST_GLOBAL) { @@ -1269,7 +1268,6 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) } $sql_data[USERS_TABLE] = ($auth->acl_get('f_postcount', $forum_id)) ? 'user_posts = user_posts - 1' : ''; - set_config('num_posts', $config['num_posts'] - 1, true); $db->sql_transaction('begin'); diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 00237781eb..9125ae55b1 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -583,7 +583,7 @@ function mcp_delete_topic($topic_ids) add_log('mod', $forum_id, 0, 'LOG_TOPIC_DELETED', $row['topic_title']); } - $return = delete_topics('topic_id', $topic_ids, true); + $return = delete_topics('topic_id', $topic_ids); } else { diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 527c48efa7..ff8df44148 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -61,7 +61,7 @@ class ucp_prefs $var_ary = array( 'dateformat' => array('string', false, 3, 30), - 'lang' => array('match', false, '#^[a-z_]{2,}$#i'), + 'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'), 'tz' => array('num', false, -14, 14), ); diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 693a785c8f..4379658959 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -125,7 +125,7 @@ class ucp_register 'email_confirm' => array('string', false, 6, 60), 'confirm_code' => array('string', !$config['enable_confirm'], 5, 8), 'tz' => array('num', false, -14, 14), - 'lang' => array('match', false, '#^[a-z_]{2,}$#i'), + 'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'), ); $error = validate_data($data, $var_ary); diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 25a595f663..b973a14f6f 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -97,7 +97,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_link_width', ' INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_height', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_width', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_min_thumb_filesize', '12000'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_check', '4'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_check', '3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_enable', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_host', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_password', ''); diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 2b74ccbe4f..dcefddae89 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -245,7 +245,7 @@ $lang = array_merge($lang, array( 'PARSE_BBCODE' => 'Parse BBCode', 'PARSE_SMILIES' => 'Parse Smilies', 'PARSE_URLS' => 'Parse Links', - 'PROCEED_TO_ACP' => 'Click %sHere%s to proceed to the ACP', + 'PROCEED_TO_ACP' => '%sProceed to the ACP%s', 'REMIND' => 'Remind', 'REORDER' => 'Reorder', 'RESYNC' => 'Sync', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index fdbffa7a1e..87691b38fc 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -352,11 +352,12 @@ $lang = array_merge($lang, array( 'POSTED' => 'Posted', 'POSTS' => 'Posts', 'POSTS_UNAPPROVED' => 'At least one post in this topic has not been approved', - 'POST_BY_FOE' => 'This post was made by %1$s who is currently on your ignore list. To display this post click %2$sHERE%3$s.', + 'POST_BY_FOE' => 'This post was made by %1$s who is currently on your ignore list. %2$sDisplay this post%3$s.', 'POST_DAY' => '%.2f posts per day', 'POST_DETAILS' => 'Post details', 'POST_NEW_TOPIC' => 'Post new topic', 'POST_PCT' => '%.2f%% of all posts', + 'POST_PCT_ACTIVE' => '%.2f%% of your posts', 'POST_REPORTED' => 'Click to view report', 'POST_SUBJECT' => 'Post subject', 'POST_TIME' => 'Post time', diff --git a/phpBB/language/en/viewtopic.php b/phpBB/language/en/viewtopic.php index 782b3a7292..0c50afb689 100644 --- a/phpBB/language/en/viewtopic.php +++ b/phpBB/language/en/viewtopic.php @@ -73,7 +73,7 @@ $lang = array_merge($lang, array( 'POLL_RUN_TILL' => 'Poll runs till %s', 'POLL_VOTED_OPTION' => 'You voted for this option', - 'POST_ENCODING' => 'This post by %1$s was made in a character set different to yours. To view this post in its proper encoding click %2$sHERE%3$s.', + 'POST_ENCODING' => 'This post by %1$s was made in a character set different to yours. %2$sView this post in its proper encoding%3$s.', 'PRINT_TOPIC' => 'Print view', 'QUICK_MOD' => 'Quick-mod tools', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 829997019c..d1ae94c779 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -648,10 +648,12 @@ switch ($mode) 'email_lang' => $email_lang, 'email' => $email, 'name' => $name, - 'username' => $row['username'], + 'username' => ($user_id) ? $row['username'] : '', 'to_name' => $name, - 'user_jabber' => $row['user_jabber'], - 'user_notify_type' => $row['user_notify_type'], + 'user_jabber' => ($user_id) ? $row['user_jabber'] : '', + 'user_notify_type' => ($user_id) ? $row['user_notify_type'] : NOTIFY_EMAIL, + 'topic_title' => (!$user_id) ? $row['topic_title'] : '', + 'forum_id' => (!$user_id) ? $row['forum_id'] : 0, ); // Ok, now the same email if CC specified, but without exposing the users email address @@ -665,6 +667,8 @@ switch ($mode) 'to_name' => $name, 'user_jabber' => $user->data['user_jabber'], 'user_notify_type' => ($user_id) ? $user->data['user_notify_type'] : NOTIFY_EMAIL, + 'topic_title' => (!$user_id) ? $row['topic_title'] : '', + 'forum_id' => (!$user_id) ? $row['forum_id'] : 0, ); } diff --git a/phpBB/styles/subSilver/template/posting_attach_body.html b/phpBB/styles/subSilver/template/posting_attach_body.html index f1fda47748..2a9c7b21c2 100644 --- a/phpBB/styles/subSilver/template/posting_attach_body.html +++ b/phpBB/styles/subSilver/template/posting_attach_body.html @@ -63,7 +63,7 @@ - +
   diff --git a/phpBB/styles/subSilver/template/viewtopic_body.html b/phpBB/styles/subSilver/template/viewtopic_body.html index 325ebba88a..ea674bddb9 100644 --- a/phpBB/styles/subSilver/template/viewtopic_body.html +++ b/phpBB/styles/subSilver/template/viewtopic_body.html @@ -132,6 +132,13 @@ + + + + + + + - +
{postrow.L_IGNORE_POST} {postrow.FORCE_ENCODING}
@@ -144,7 +151,7 @@
diff --git a/phpBB/styles/subSilver/template/viewtopic_print.html b/phpBB/styles/subSilver/template/viewtopic_print.html index c286fcf660..69a51f42c8 100644 --- a/phpBB/styles/subSilver/template/viewtopic_print.html +++ b/phpBB/styles/subSilver/template/viewtopic_print.html @@ -60,13 +60,13 @@ hr.sep { - + - +
{SITENAME}
{U_FORUM}
{SITENAME}
{U_FORUM}

{TOPIC_TITLE}
{U_TOPIC}
{TOPIC_TITLE}
{U_TOPIC}
{PAGE_NUMBER}
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 19a73a83f3..e7c493f112 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1204,7 +1204,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) // Two situations can prevent a post being display: // i) The poster is on the users ignore list // ii) The post was made in a codepage different from the users - if (isset($row['foe']) && $row['foe']) + if (!empty($row['foe'])) { $template->assign_block_vars('postrow', array( 'S_IGNORE_POST' => true, @@ -1213,21 +1213,9 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) continue; } - else if ($row['post_encoding'] != $user->lang['ENCODING']) + else if ($row['post_encoding'] != $user->lang['ENCODING'] && $view == 'encoding' && $post_id == $row['post_id']) { - if ($view == 'encoding' && $post_id == $row['post_id']) - { - $force_encoding = $row['post_encoding']; - } - else - { - $template->assign_block_vars('postrow', array( - 'S_IGNORE_POST' => true, - 'L_IGNORE_POST' => sprintf($user->lang['POST_ENCODING'], $row['poster'], '', '')) - ); - - continue; - } + $force_encoding = $row['post_encoding']; } // End signature parsing, only if needed @@ -1383,6 +1371,8 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'ONLINE_IMG' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($user_cache[$poster_id]['online']) ? $user->img('btn_online', 'ONLINE') : $user->img('btn_offline', 'OFFLINE')), 'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false), + 'FORCE_ENCODING' => ($row['post_encoding'] != $user->lang['ENCODING']) ? sprintf($user->lang['POST_ENCODING'], $row['poster'], '', '') : '', + 'U_EDIT' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&p={$row['post_id']}") : '', 'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$row['post_id']}") : '', 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&f=$forum_id&p=" . $row['post_id'], true, $user->session_id) : '',