minor adjustments

git-svn-id: file:///svn/phpbb/trunk@4859 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2004-03-06 16:58:34 +00:00
parent 91811b8289
commit 635d18d279
5 changed files with 20 additions and 19 deletions

View file

@ -138,7 +138,7 @@ class parse_message
$replace = array(); $replace = array();
// relative urls for this board // relative urls for this board
$match[] = '#(^|[\n ])' . $server_protocol . trim($config['server_name']) . $server_port . preg_replace('/^\/?(.*?)(\/)?$/', '$1', trim($config['script_path'])) . '/([^ \t\n\r<"\']+)#i'; $match[] = '#(^|[\n ])' . $server_protocol . trim($config['server_name']) . $server_port . preg_replace('/^\/?(.*?)(\/)?$/', '$1', trim($config['script_path'])) . '(?:/[^ \t\n\r<"\']*)?)#i';
$replace[] = '<!-- l --><a href="$1" target="_blank">$1</a><!-- l -->'; $replace[] = '<!-- l --><a href="$1" target="_blank">$1</a><!-- l -->';
// matches a xxxx://aaaaa.bbb.cccc. ... // matches a xxxx://aaaaa.bbb.cccc. ...

View file

@ -590,6 +590,10 @@ class user extends session
{ {
foreach ($lang_set as $key => $lang_file) foreach ($lang_set as $key => $lang_file)
{ {
// Please do not delete this line.
// We have to force the type here, else [array] language inclusion will not work
$key = (string) $key;
if ($key == 'db') if ($key == 'db')
{ {
$this->add_lang($lang_file, true, $use_help); $this->add_lang($lang_file, true, $use_help);

View file

@ -179,7 +179,9 @@ $lang += array(
'LOGIN_INFO' => 'In order to login you must be registered. Registering takes only a few seconds but gives you increased capabilies. The board administrator may also grant additional permissions to registered users. Before you login 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_INFO' => 'In order to login you must be registered. Registering takes only a few seconds but gives you increased capabilies. The board administrator may also grant additional permissions to registered users. Before you login 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 administrator requires you to be registered and logged in to view this forum.', 'LOGIN_VIEWFORUM' => 'The board administrator requires you to be registered and logged in to view this forum.',
'LOGOUT_USER' => 'Logout [ %s ]', 'LOGOUT_USER' => 'Logout [ %s ]',
'LOG_DELETE_TOPIC' => '<b>Deleted topic</b><br />&#187; %s',
'LOG_ME_IN' => 'Log me on automatically each visit', 'LOG_ME_IN' => 'Log me on automatically each visit',
'LOG_USER_GENERAL' => '%s',
'MARK' => 'Mark', 'MARK' => 'Mark',
'MARK_ALL' => 'Mark all', 'MARK_ALL' => 'Mark all',
@ -519,8 +521,6 @@ $unused = array(
'Inbox_size' => 'Your Inbox is %d%% full', 'Inbox_size' => 'Your Inbox is %d%% full',
'Join_group' => 'Join Group', 'Join_group' => 'Join Group',
'LOGOUT' => 'Logout', 'LOGOUT' => 'Logout',
'LOG_DELETE_TOPIC' => '<b>Deleted topic</b><br />&#187; %s',
'LOG_USER_GENERAL' => '%s',
'Login_to_join' => 'Login to join or manage group memberships', 'Login_to_join' => 'Login to join or manage group memberships',
'Member_this_group' => 'You are a member of this group', 'Member_this_group' => 'You are a member of this group',
'Memberships_pending' => 'Memberships pending', 'Memberships_pending' => 'Memberships pending',

View file

@ -125,7 +125,7 @@ if ($sql)
$post_edit_locked = (int) $post_edit_locked; $post_edit_locked = (int) $post_edit_locked;
$user->setup('posting', $forum_style); $user->setup(array('posting', 'mcp'), $forum_style);
if ($forum_password) if ($forum_password)
{ {
@ -343,7 +343,7 @@ if ($mode == 'delete' && (($poster_id == $user->data['user_id'] && $user->data['
$template->assign_vars(array( $template->assign_vars(array(
'MESSAGE_TITLE' => $user->lang['DELETE_MESSAGE'], 'MESSAGE_TITLE' => $user->lang['DELETE_MESSAGE'],
'MESSAGE_TEXT' => $user->lang['CONFIRM_DELETE_POST'], 'MESSAGE_TEXT' => $user->lang['DELETE_POST_CONFIRM'],
'S_CONFIRM_ACTION' => "posting.$phpEx$SID", 'S_CONFIRM_ACTION' => "posting.$phpEx$SID",
'S_HIDDEN_FIELDS' => $s_hidden_fields) 'S_HIDDEN_FIELDS' => $s_hidden_fields)

View file

@ -696,7 +696,7 @@ else
// Container for user details, only process once // Container for user details, only process once
$post_list = $user_cache = $id_cache = $attachments = $attach_list = $rowset = $update_count = $post_edit_list = array(); $post_list = $user_cache = $id_cache = $attachments = $attach_list = $rowset = $update_count = $post_edit_list = array();
$has_attachments = $display_notice = FALSE; $has_attachments = $display_notice = false;
$force_encoding = ''; $force_encoding = '';
$bbcode_bitfield = $i = $i_total = 0; $bbcode_bitfield = $i = $i_total = 0;
@ -1015,7 +1015,7 @@ if (count($attach_list))
} }
else else
{ {
$display_notice = TRUE; $display_notice = true;
} }
} }
@ -1090,11 +1090,6 @@ for ($i = 0; $i < count($post_list); ++$i)
} }
$user_cache[$poster_id]['sig'] = smilie_text($user_cache[$poster_id]['sig']); $user_cache[$poster_id]['sig'] = smilie_text($user_cache[$poster_id]['sig']);
/*if (count($censors))
{
$user_cache[$poster_id]['sig'] = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$censors['match'], \$censors['replace'], '\\0')", '>' . $user_cache[$poster_id]['sig'] . '<'), 1, -1));
}*/
$user_cache[$poster_id]['sig'] = str_replace("\n", '<br />', censor_text($user_cache[$poster_id]['sig'])); $user_cache[$poster_id]['sig'] = str_replace("\n", '<br />', censor_text($user_cache[$poster_id]['sig']));
$user_cache[$poster_id]['sig_parsed'] = TRUE; $user_cache[$poster_id]['sig_parsed'] = TRUE;
} }
@ -1129,11 +1124,6 @@ for ($i = 0; $i < count($post_list); ++$i)
} }
// Replace naughty words such as farty pants // Replace naughty words such as farty pants
/* if (sizeof($censors))
{
$row['post_subject'] = preg_replace($censors['match'], $censors['replace'], $row['post_subject']);
$message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$censors['match'], \$censors['replace'], '\\0')", '>' . $message . '<'), 1, -1));
}*/
$row['post_subject'] = censor_text($row['post_subject']); $row['post_subject'] = censor_text($row['post_subject']);
$message = str_replace("\n", '<br />', censor_text($message)); $message = str_replace("\n", '<br />', censor_text($message));
@ -1192,19 +1182,26 @@ for ($i = 0; $i < count($post_list); ++$i)
$tpl = display_attachments(NULL, $tpl, $update_count, false, true); $tpl = display_attachments(NULL, $tpl, $update_count, false, true);
$tpl_size = sizeof($tpl); $tpl_size = sizeof($tpl);
$unset_tpl = array();
$message = preg_replace_callback('#<!\-\- ia([0-9]+) \-\->(.*?)<!\-\- ia\1 \-\->#', create_function('$matches', ' $message = preg_replace_callback('#<!\-\- ia([0-9]+) \-\->(.*?)<!\-\- ia\1 \-\->#', create_function('$matches', '
global $tpl, $user, $config, $tpl_size; global $tpl, $user, $config, $tpl_size, $unset_tpl;
// Flip index if we are displaying the reverse way // Flip index if we are displaying the reverse way
$index = ($config["display_order"]) ? ($tpl_size-($matches[1] + 1)) : $matches[1]; $index = ($config["display_order"]) ? ($tpl_size-($matches[1] + 1)) : $matches[1];
$return = (isset($tpl[$index])) ? $tpl[$index] : sprintf($user->lang["MISSING_INLINE_ATTACHMENT"], $matches[0]); $return = (isset($tpl[$index])) ? $tpl[$index] : sprintf($user->lang["MISSING_INLINE_ATTACHMENT"], $matches[0]);
unset($tpl[$index]); $unset_tpl[] = $index;
return $return; return $return;
'), $message); '), $message);
unset($tpl, $tpl_size); unset($tpl, $tpl_size);
foreach (array_unique($unset_tpl) as $index)
{
unset($attachments[$row['post_id']][$index]);
}
} }
// Dump vars into template // Dump vars into template