From f27fa04b8c7f6d668e9cc651afaa10334f5d7067 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 15 Jul 2007 13:47:01 +0000 Subject: [PATCH] even more fixes. :o git-svn-id: file:///svn/phpbb/trunk@7889 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_ban.html | 5 +++ phpBB/adm/style/acp_board.html | 10 ++--- phpBB/adm/style/acp_forums.html | 4 +- phpBB/adm/style/acp_reasons.html | 2 +- phpBB/adm/style/overall_header.html | 2 +- phpBB/adm/style/permission_trace.html | 2 +- phpBB/docs/CHANGELOG.html | 9 ++++- phpBB/includes/acp/acp_styles.php | 4 +- phpBB/includes/functions.php | 2 +- phpBB/includes/functions_display.php | 2 +- phpBB/includes/message_parser.php | 16 +++++++- phpBB/includes/ucp/ucp_groups.php | 12 ++++-- phpBB/includes/ucp/ucp_pm_viewfolder.php | 8 ++-- phpBB/index.php | 8 ++-- phpBB/language/en/acp/forums.php | 2 +- phpBB/language/en/acp/permissions_phpbb.php | 4 +- phpBB/language/en/common.php | 3 +- phpBB/search.php | 3 ++ phpBB/styles/prosilver/template/drafts.html | 2 +- .../styles/prosilver/template/index_body.html | 2 +- .../prosilver/template/mcp_warn_list.html | 2 +- .../prosilver/template/memberlist_body.html | 5 +++ .../prosilver/template/message_body.html | 2 +- .../prosilver/template/search_results.html | 2 +- .../prosilver/template/ucp_groups_manage.html | 4 +- .../prosilver/template/viewforum_body.html | 2 +- .../prosilver/template/viewonline_body.html | 3 +- phpBB/styles/prosilver/theme/common.css | 1 - .../subsilver2/template/index_body.html | 2 +- .../template/ucp_groups_manage.html | 4 +- .../subsilver2/template/viewonline_body.html | 3 +- phpBB/viewonline.php | 39 +++++++++++++------ 32 files changed, 111 insertions(+), 60 deletions(-) diff --git a/phpBB/adm/style/acp_ban.html b/phpBB/adm/style/acp_ban.html index cbafa554b1..334d245edf 100644 --- a/phpBB/adm/style/acp_ban.html +++ b/phpBB/adm/style/acp_ban.html @@ -71,14 +71,19 @@  

+ + +

{L_UNBAN_TITLE}

{L_UNBAN_EXPLAIN}

+
+
{L_UNBAN_TITLE} diff --git a/phpBB/adm/style/acp_board.html b/phpBB/adm/style/acp_board.html index 5ab0e079d4..c7501ce088 100644 --- a/phpBB/adm/style/acp_board.html +++ b/phpBB/adm/style/acp_board.html @@ -37,12 +37,12 @@ {auth_tpl.TPL} -
-
- {L_SUBMIT} -   - +

+   + +

+
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index eaa7d3bf7a..5b06ff2cff 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -120,8 +120,8 @@
-
-
+
+
diff --git a/phpBB/adm/style/acp_reasons.html b/phpBB/adm/style/acp_reasons.html index e10cc1d1ca..fc16d5f53c 100644 --- a/phpBB/adm/style/acp_reasons.html +++ b/phpBB/adm/style/acp_reasons.html @@ -40,7 +40,7 @@
-
+
diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index 4cc4dbd678..a6b053b543 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -193,7 +193,7 @@ function switch_menu() diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index b0c2c5465d..686ecb2a5f 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -2016,7 +2016,7 @@ parse_css_file = {PARSE_CSS_FILE} if ($update) { - $name = request_var('name', ''); + $name = request_var('name', '', true); $copyright = request_var('copyright', '', true); $template_id = request_var('template_id', 0); @@ -2635,7 +2635,7 @@ parse_css_file = {PARSE_CSS_FILE} $error = array(); $style_row = array( - $mode . '_name' => request_var('name', ''), + $mode . '_name' => request_var('name', '', true), $mode . '_copyright' => request_var('copyright', '', true), 'template_id' => 0, 'theme_id' => 0, diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index f894c2750d..661641a2e3 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4124,7 +4124,7 @@ function page_header($page_title = '', $display_online_list = true) 'UA_POPUP_PM' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=popup', false), 'U_MEMBERLIST' => append_sid("{$phpbb_root_path}memberlist.$phpEx"), 'U_MEMBERSLIST' => append_sid("{$phpbb_root_path}memberlist.$phpEx"), - 'U_VIEWONLINE' => append_sid("{$phpbb_root_path}viewonline.$phpEx"), + 'U_VIEWONLINE' => ($auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid("{$phpbb_root_path}viewonline.$phpEx") : '', 'U_LOGIN_LOGOUT' => $u_login_logout, 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"), 'U_SEARCH' => append_sid("{$phpbb_root_path}search.$phpEx"), diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index f01377b2ab..7af5c0417c 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -665,7 +665,7 @@ function get_moderators(&$forum_moderators, $forum_id = false) } else { - $forum_moderators[$row['forum_id']][] = '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; + $forum_moderators[$row['forum_id']][] = '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; } } $db->sql_freeresult($result); diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index e7b7edc169..c5349efabe 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -116,7 +116,7 @@ class bbcode_firstpass extends bbcode 'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#ise' => "\$this->bbcode_strong('\$1')")), 'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#ise' => "\$this->bbcode_italic('\$1')")), 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#iUe' => "\$this->validate_url('\$2', '\$3')")), - 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](https?://)([a-z0-9\-\.,\?!%\*_:;~\\&$@/=\+]+)\[/img\]#ie' => "\$this->bbcode_img('\$1\$2')")), + 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](.*)\[/img\]#iUe' => "\$this->bbcode_img('\$1')")), 'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?\d+)\](.*?)\[/size\]#ise' => "\$this->bbcode_size('\$1', '\$2')")), 'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!ise' => "\$this->bbcode_color('\$1', '\$2')")), 'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#ise' => "\$this->bbcode_underline('\$1')")), @@ -278,6 +278,20 @@ class bbcode_firstpass extends bbcode $in = trim($in); $error = false; + $in = str_replace(' ', '%20', $in); + + // Checking urls + if (!preg_match('#^' . get_preg_expression('url') . '$#i', $in) && !preg_match('#^' . get_preg_expression('www_url') . '$#i', $in)) + { + return '[img]' . $in . '[/img]'; + } + + // Try to cope with a common user error... not specifying a protocol but only a subdomain + if (!preg_match('#^[a-z0-9]+://#i', $in)) + { + $in = 'http://' . $in; + } + if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width']) { $stats = @getimagesize($in); diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index d517ca2d1b..1e8bd23af9 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -707,7 +707,7 @@ class ucp_groups $start = request_var('start', 0); // Grab the leaders - always, on every page... - $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending + $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_colour, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug WHERE ug.group_id = $group_id AND u.user_id = ug.user_id @@ -719,7 +719,9 @@ class ucp_groups { $template->assign_block_vars('leader', array( 'USERNAME' => $row['username'], - 'U_USER_VIEW' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), + 'USERNAME_COLOUR' => $row['user_colour'], + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'U_USER_VIEW' => get_username_string('profile', $row['user_id'], $row['username']), 'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false, 'JOINED' => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ', 'USER_POSTS' => $row['user_posts'], @@ -738,7 +740,7 @@ class ucp_groups $db->sql_freeresult($result); // Grab the members - $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending + $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_colour, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug WHERE ug.group_id = $group_id AND u.user_id = ug.user_id @@ -761,7 +763,9 @@ class ucp_groups $template->assign_block_vars('member', array( 'USERNAME' => $row['username'], - 'U_USER_VIEW' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), + 'USERNAME_COLOUR' => $row['user_colour'], + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'U_USER_VIEW' => get_username_string('profile', $row['user_id'], $row['username']), 'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false, 'JOINED' => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ', 'USER_POSTS' => $row['user_posts'], diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index 3c11a3ae8a..be79b522ef 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -163,18 +163,16 @@ function view_folder($id, $mode, $folder_id, $folder) { foreach ($id_ary as $ug_id => $_id) { - $user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="font-weight: bold; color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : ''; - if ($type == 'u') { - $link = ($ug_id != ANONYMOUS) ? '' : ''; + $address_list[$message_id][] = get_username_string('full', $ug_id, $recipient_list[$type][$ug_id]['name'], $recipient_list[$type][$ug_id]['colour']); } else { + $user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="font-weight: bold; color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : ''; $link = ''; + $address_list[$message_id][] = $link . $recipient_list[$type][$ug_id]['name'] . (($link) ? '' : ''); } - - $address_list[$message_id][] = $link . $recipient_list[$type][$ug_id]['name'] . (($link) ? '' : ''); } } } diff --git a/phpBB/index.php b/phpBB/index.php index 56840df70f..d0c6bc0418 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -28,8 +28,6 @@ display_forums('', $config['load_moderators']); $total_posts = $config['num_posts']; $total_topics = $config['num_topics']; $total_users = $config['num_users']; -$newest_user = $config['newest_username']; -$newest_uid = $config['newest_user_id']; $l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER'; $l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER'; @@ -88,8 +86,7 @@ if ($config['load_birthdays']) while ($row = $db->sql_fetchrow($result)) { - $user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] .'"' : ''; - $birthday_list .= (($birthday_list != '') ? ', ' : '') . '' . $row['username'] . ''; + $birthday_list .= (($birthday_list != '') ? ', ' : '') . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']); if ($age = (int) substr($row['user_birthday'], -4)) { @@ -104,7 +101,8 @@ $template->assign_vars(array( 'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts), 'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics), 'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users), - 'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], '', $newest_user, ''), + 'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])), + 'LEGEND' => $legend, 'BIRTHDAY_LIST' => $birthday_list, diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php index 5281651bad..2235772bf4 100644 --- a/phpBB/language/en/acp/forums.php +++ b/phpBB/language/en/acp/forums.php @@ -62,7 +62,7 @@ $lang = array_merge($lang, array( 'ENABLE_TOPIC_ICONS' => 'Enable topic icons', 'FORUM_ADMIN' => 'Forum administration', - 'FORUM_ADMIN_EXPLAIN' => 'In phpBB3 there are no categories, everything is forum based. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category). Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum.', + 'FORUM_ADMIN_EXPLAIN' => 'In phpBB3 there are no categories, everything is forum based. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category). Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum. You need to copy or set appropriate permissions for newly created forums to have them displayed.', 'FORUM_AUTO_PRUNE' => 'Enable auto-pruning', 'FORUM_AUTO_PRUNE_EXPLAIN' => 'Prunes the forum of topics, set the frequency/age parameters below.', 'FORUM_CREATED' => 'Forum created successfully.', diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php index 00c53257ad..7db7426672 100644 --- a/phpBB/language/en/acp/permissions_phpbb.php +++ b/phpBB/language/en/acp/permissions_phpbb.php @@ -88,7 +88,7 @@ $lang = array_merge($lang, array( // User Permissions $lang = array_merge($lang, array( - 'acl_u_viewprofile' => array('lang' => 'Can view profiles', 'cat' => 'profile'), + 'acl_u_viewprofile' => array('lang' => 'Can view profiles, memberlist and online list', 'cat' => 'profile'), 'acl_u_chgname' => array('lang' => 'Can change username', 'cat' => 'profile'), 'acl_u_chgpasswd' => array('lang' => 'Can change password', 'cat' => 'profile'), 'acl_u_chgemail' => array('lang' => 'Can change e-mail address', 'cat' => 'profile'), @@ -196,7 +196,7 @@ $lang = array_merge($lang, array( 'acl_a_bbcode' => array('lang' => 'Can define BBCode tags', 'cat' => 'posting'), 'acl_a_attach' => array('lang' => 'Can alter attachment related settings', 'cat' => 'posting'), - 'acl_a_user' => array('lang' => 'Can manage users', 'cat' => 'user_group'), + 'acl_a_user' => array('lang' => 'Can manage users
This also includes seeing the users browser agent within the viewonline list.', 'cat' => 'user_group'), 'acl_a_userdel' => array('lang' => 'Can delete/prune users', 'cat' => 'user_group'), 'acl_a_group' => array('lang' => 'Can manage groups', 'cat' => 'user_group'), 'acl_a_groupadd' => array('lang' => 'Can add new groups', 'cat' => 'user_group'), diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index e6fd409073..92637d37be 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -294,6 +294,7 @@ $lang = array_merge($lang, array( 'LOGIN_INFO' => 'In order to login you must be registered. Registering takes only a few moments but gives you increased capabilities. The board administrator may also grant additional permissions to registered users. Before you register please ensure you are familiar with our terms of use and related policies. Please ensure you read any forum rules as you navigate around the board.', 'LOGIN_VIEWFORUM' => 'The board requires you to be registered and logged in to view this forum.', 'LOGIN_EXPLAIN_EDIT' => 'In order to edit posts in this forum you have to be registered and logged in.', + 'LOGIN_EXPLAIN_VIEWONLINE' => 'In order to view the online list you have to be registered and logged in.', 'LOGOUT' => 'Logout', 'LOGOUT_USER' => 'Logout [ %s ]', 'LOG_ME_IN' => 'Log me on automatically each visit', @@ -320,7 +321,7 @@ $lang = array_merge($lang, array( 'MSNM' => 'MSNM/WLM', 'NA' => 'N/A', - 'NEWEST_USER' => 'Our newest member %s%s%s', + 'NEWEST_USER' => 'Our newest member %s', 'NEW_MESSAGE' => 'New message', 'NEW_MESSAGES' => 'New messages', 'NEW_PM' => '%d new message', diff --git a/phpBB/search.php b/phpBB/search.php index 2d70690a1e..49e4357ee8 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -50,12 +50,14 @@ $search_forum = request_var('fid', array(0)); // Is user able to search? Has search been disabled? if (!$auth->acl_get('u_search') || !$auth->acl_getf_global('f_search') || !$config['load_search']) { + $template->assign_var('S_NO_SEARCH', true); trigger_error($user->lang['NO_SEARCH']); } // Check search load limit if ($user->load && $config['limit_search_load'] && ($user->load > doubleval($config['limit_search_load']))) { + $template->assign_var('S_NO_SEARCH', true); trigger_error($user->lang['NO_SEARCH_TIME']); } @@ -65,6 +67,7 @@ if ($interval && !$auth->acl_get('u_ignoreflood')) { if ($user->data['user_last_search'] > time() - $interval) { + $template->assign_var('S_NO_SEARCH', true); trigger_error($user->lang['NO_SEARCH_TIME']); } } diff --git a/phpBB/styles/prosilver/template/drafts.html b/phpBB/styles/prosilver/template/drafts.html index 2b48785e32..25a5681b70 100644 --- a/phpBB/styles/prosilver/template/drafts.html +++ b/phpBB/styles/prosilver/template/drafts.html @@ -21,7 +21,7 @@
-