1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-08 00:25:19 +02:00

- fix some smaller bugs

- removed custom profiles preview field from acp


git-svn-id: file:///svn/phpbb/trunk@6022 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2006-06-08 10:59:36 +00:00
parent 0e7adebad6
commit 4306d4d083
14 changed files with 88 additions and 178 deletions

View File

@ -115,25 +115,9 @@
<fieldset class="quick" style="float: right"> <fieldset class="quick" style="float: right">
{S_HIDDEN_FIELDS} {S_HIDDEN_FIELDS}
<input class="button1" type="submit" name="update" value="{L_UPDATE_PREVIEW}" />&nbsp;
<input class="button1" type="submit" name="next" value="{L_NEXT}" /> <input class="button1" type="submit" name="next" value="{L_NEXT}" />
</fieldset> </fieldset>
<br /><br />
<fieldset>
<legend>{L_PREVIEW_PROFILE_FIELD}</legend>
<!-- IF USER_ERROR --><p style="color: red;">{USER_ERROR}</p><!-- ELSE --><p style="color: green;">{L_EVERYTHING_OK}</p><!-- ENDIF -->
<dl>
<dt><label>{PREVIEW_LANG_NAME}:</label><!-- IF PREVIEW_LANG_EXPLAIN --><br /><span>{PREVIEW_LANG_EXPLAIN}</span><!-- ENDIF --></dt>
<dd>{PREVIEW_FIELD}</dd>
</dl>
</fieldset>
<fieldset class="quick">
<input class="button1" type="submit" name="update_preview" value="{L_SUBMIT}" />
</fieldset>
<!-- ELSEIF S_STEP_THREE --> <!-- ELSEIF S_STEP_THREE -->
<!-- BEGIN options --> <!-- BEGIN options -->

View File

@ -825,12 +825,14 @@ class acp_forums
$forum_data['forum_flags'] += ($forum_data['show_active']) ? 16 : 0; $forum_data['forum_flags'] += ($forum_data['show_active']) ? 16 : 0;
// Unset data that are not database fields // Unset data that are not database fields
unset($forum_data['forum_link_track']); $forum_data_sql = $forum_data;
unset($forum_data['prune_old_polls']);
unset($forum_data['prune_announce']); unset($forum_data_sql['forum_link_track']);
unset($forum_data['prune_sticky']); unset($forum_data_sql['prune_old_polls']);
unset($forum_data['show_active']); unset($forum_data_sql['prune_announce']);
unset($forum_data['forum_password_confirm']); unset($forum_data_sql['prune_sticky']);
unset($forum_data_sql['show_active']);
unset($forum_data_sql['forum_password_confirm']);
// What are we going to do tonight Brain? The same thing we do everynight, // What are we going to do tonight Brain? The same thing we do everynight,
// try to take over the world ... or decide whether to continue update // try to take over the world ... or decide whether to continue update
@ -840,16 +842,16 @@ class acp_forums
return $errors; return $errors;
} }
if (!isset($forum_data['forum_id'])) if (!isset($forum_data_sql['forum_id']))
{ {
// no forum_id means we're creating a new forum // no forum_id means we're creating a new forum
unset($forum_data['type_action']); unset($forum_data_sql['type_action']);
if ($forum_data['parent_id']) if ($forum_data_sql['parent_id'])
{ {
$sql = 'SELECT left_id, right_id $sql = 'SELECT left_id, right_id
FROM ' . FORUMS_TABLE . ' FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . $forum_data['parent_id']; WHERE forum_id = ' . $forum_data_sql['parent_id'];
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result); $row = $db->sql_fetchrow($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
@ -869,8 +871,8 @@ class acp_forums
WHERE ' . $row['left_id'] . ' BETWEEN left_id AND right_id'; WHERE ' . $row['left_id'] . ' BETWEEN left_id AND right_id';
$db->sql_query($sql); $db->sql_query($sql);
$forum_data['left_id'] = $row['right_id']; $forum_data_sql['left_id'] = $row['right_id'];
$forum_data['right_id'] = $row['right_id'] + 1; $forum_data_sql['right_id'] = $row['right_id'] + 1;
} }
else else
{ {
@ -880,11 +882,11 @@ class acp_forums
$row = $db->sql_fetchrow($result); $row = $db->sql_fetchrow($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
$forum_data['left_id'] = $row['right_id'] + 1; $forum_data_sql['left_id'] = $row['right_id'] + 1;
$forum_data['right_id'] = $row['right_id'] + 2; $forum_data_sql['right_id'] = $row['right_id'] + 2;
} }
$sql = 'INSERT INTO ' . FORUMS_TABLE . ' ' . $db->sql_build_array('INSERT', $forum_data); $sql = 'INSERT INTO ' . FORUMS_TABLE . ' ' . $db->sql_build_array('INSERT', $forum_data_sql);
$db->sql_query($sql); $db->sql_query($sql);
$forum_data['forum_id'] = $db->sql_nextid(); $forum_data['forum_id'] = $db->sql_nextid();
@ -893,34 +895,34 @@ class acp_forums
} }
else else
{ {
$row = $this->get_forum_info($forum_data['forum_id']); $row = $this->get_forum_info($forum_data_sql['forum_id']);
if ($forum_data['forum_type'] != FORUM_POST && $row['forum_type'] != $forum_data['forum_type']) if ($row['forum_type'] == FORUM_POST && $row['forum_type'] != $forum_data_sql['forum_type'])
{ {
// we're turning a postable forum into a non-postable forum // we're turning a postable forum into a non-postable forum
if ($forum_data['type_action'] == 'move') if ($forum_data_sql['type_action'] == 'move')
{ {
if ($forum_data['to_forum_id']) $to_forum_id = request_var('to_forum_id', 0);
if ($to_forum_id)
{ {
$errors = $this->move_forum_content($forum_data['forum_id'], $forum_data['to_forum_id']); $errors = $this->move_forum_content($forum_data_sql['forum_id'], $to_forum_id);
} }
else else
{ {
return array($user->lang['NO_DESTINATION_FORUM']); return array($user->lang['NO_DESTINATION_FORUM']);
} }
} }
else if ($forum_data['type_action'] == 'delete') else if ($forum_data_sql['type_action'] == 'delete')
{ {
$errors = $this->delete_forum_content($forum_data['forum_id']); $errors = $this->delete_forum_content($forum_data_sql['forum_id']);
} }
else else
{ {
return array($user->lang['NO_FORUM_ACTION']); return array($user->lang['NO_FORUM_ACTION']);
} }
$forum_data['forum_posts'] = 0; $forum_data_sql['forum_posts'] = $forum_data_sql['forum_topics'] = $forum_data_sql['forum_topics_real'] = 0;
$forum_data['forum_topics'] = 0;
$forum_data['forum_topics_real'] = 0;
} }
if (sizeof($errors)) if (sizeof($errors))
@ -928,9 +930,9 @@ class acp_forums
return $errors; return $errors;
} }
if ($row['parent_id'] != $forum_data['parent_id']) if ($row['parent_id'] != $forum_data_sql['parent_id'])
{ {
$errors = $this->move_forum($forum_data['forum_id'], $forum_data['parent_id']); $errors = $this->move_forum($forum_data_sql['forum_id'], $forum_data_sql['parent_id']);
} }
if (sizeof($errors)) if (sizeof($errors))
@ -938,9 +940,9 @@ class acp_forums
return $errors; return $errors;
} }
unset($forum_data['type_action']); unset($forum_data_sql['type_action']);
if ($row['forum_name'] != $forum_data['forum_name']) if ($row['forum_name'] != $forum_data_sql['forum_name'])
{ {
// the forum name has changed, clear the parents list of child forums // the forum name has changed, clear the parents list of child forums
$sql = 'UPDATE ' . FORUMS_TABLE . " $sql = 'UPDATE ' . FORUMS_TABLE . "
@ -951,11 +953,11 @@ class acp_forums
} }
// Setting the forum id to the forum id is not really received well by some dbs. ;) // Setting the forum id to the forum id is not really received well by some dbs. ;)
$forum_id = $forum_data['forum_id']; $forum_id = $forum_data_sql['forum_id'];
unset($forum_data['forum_id']); unset($forum_data_sql['forum_id']);
$sql = 'UPDATE ' . FORUMS_TABLE . ' $sql = 'UPDATE ' . FORUMS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $forum_data) . ' SET ' . $db->sql_build_array('UPDATE', $forum_data_sql) . '
WHERE forum_id = ' . $forum_id; WHERE forum_id = ' . $forum_id;
$db->sql_query($sql); $db->sql_query($sql);

View File

@ -68,8 +68,8 @@ class acp_main
if ($row = $db->sql_fetchrow($result)) if ($row = $db->sql_fetchrow($result))
{ {
set_config('newest_user_id', $row['user_id']); set_config('newest_user_id', $row['user_id'], true);
set_config('newest_username', $row['username']); set_config('newest_username', $row['username'], true);
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
} }
@ -368,7 +368,7 @@ class acp_main
{ {
while (($file = readdir($avatar_dir)) !== false) while (($file = readdir($avatar_dir)) !== false)
{ {
if ($file{0} != '.') if ($file{0} != '.' && strpos($file, 'index.') === false)
{ {
$avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file); $avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
} }

View File

@ -223,8 +223,6 @@ class acp_profile
$step = request_var('step', 1); $step = request_var('step', 1);
$submit = (isset($_REQUEST['next']) || isset($_REQUEST['prev'])) ? true : false; $submit = (isset($_REQUEST['next']) || isset($_REQUEST['prev'])) ? true : false;
$update_preview = (isset($_REQUEST['update_preview'])) ? true : false;
$update = (isset($_REQUEST['update']) || $update_preview) ? true : false;
$save = (isset($_REQUEST['save'])) ? true : false; $save = (isset($_REQUEST['save'])) ? true : false;
// We are editing... we need to grab basic things // We are editing... we need to grab basic things
@ -264,8 +262,6 @@ class acp_profile
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$field_row['pf_preview'] = '';
$s_hidden_fields = '<input type="hidden" name="field_id" value="' . $field_id . '" />'; $s_hidden_fields = '<input type="hidden" name="field_id" value="' . $field_id . '" />';
} }
else else
@ -288,8 +284,7 @@ class acp_profile
'field_show_on_reg' => 0, 'field_show_on_reg' => 0,
'lang_name' => '', 'lang_name' => '',
'lang_explain' => '', 'lang_explain' => '',
'lang_default_value'=> '', 'lang_default_value'=> '')
'pf_preview' => '')
); );
$s_hidden_fields = '<input type="hidden" name="field_type" value="' . $field_type . '" />'; $s_hidden_fields = '<input type="hidden" name="field_type" value="' . $field_type . '" />';
@ -298,7 +293,7 @@ class acp_profile
// $exclude contains the data we gather in each step // $exclude contains the data we gather in each step
$exclude = array( $exclude = array(
1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option', 'field_no_view'), 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option', 'field_no_view'),
2 => array('field_length', 'pf_preview', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'), 2 => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'),
3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options') 3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options')
); );
@ -509,13 +504,6 @@ class acp_profile
} }
} }
$user_error = '';
if ($update && $step == 2)
{
// Validate Field
$user_error = $cp->validate_profile_field($field_type, $cp->vars['pf_preview'], $cp->vars);
}
$step = (isset($_REQUEST['next'])) ? $step + 1 : ((isset($_REQUEST['prev'])) ? $step - 1 : $step); $step = (isset($_REQUEST['next'])) ? $step + 1 : ((isset($_REQUEST['prev'])) ? $step - 1 : $step);
if (sizeof($error)) if (sizeof($error))
@ -524,13 +512,6 @@ class acp_profile
$submit = false; $submit = false;
} }
if (isset($_REQUEST['prev']) || isset($_REQUEST['next']))
{
$update = false;
$pf_preview = '';
unset($_REQUEST['pf_preview']);
}
// Build up the specific hidden fields // Build up the specific hidden fields
foreach ($exclude as $num => $key_ary) foreach ($exclude as $num => $key_ary)
{ {
@ -660,77 +641,6 @@ class acp_profile
$template->assign_block_vars('option', $option_ary); $template->assign_block_vars('option', $option_ary);
} }
if ($user_error || $update)
{
// If not and only showing common error messages, use this one
switch ($user_error)
{
case 'FIELD_INVALID_DATE':
case 'FIELD_REQUIRED':
$user_error = sprintf($user->lang[$user_error], $cp->vars['lang_name']);
break;
case 'FIELD_TOO_SHORT':
case 'FIELD_TOO_SMALL':
$user_error = sprintf($user->lang[$user_error], $cp->vars['lang_name'], $cp->vars['field_minlen']);
break;
case 'FIELD_TOO_LONG':
case 'FIELD_TOO_LARGE':
$user_error = sprintf($user->lang[$user_error], $cp->vars['lang_name'], $cp->vars['field_maxlen']);
break;
case 'FIELD_INVALID_CHARS':
switch ($cp->vars['field_validation'])
{
case '[0-9]+':
$user_error = sprintf($user->lang[$user_error . '_NUMBERS_ONLY'], $cp->vars['lang_name']);
break;
case '[\w]+':
$user_error = sprintf($user->lang[$user_error . '_ALPHA_ONLY'], $cp->vars['lang_name']);
break;
case '[\w_\+\. \-\[\]]+':
$user_error = sprintf($user->lang[$user_error . '_SPACERS_ONLY'], $cp->vars['lang_name']);
break;
}
break;
default:
$user_error = '';
}
$template->assign_var('USER_ERROR', $user_error);
}
$preview_field = array(
'lang_name' => $cp->vars['lang_name'],
'lang_explain' => $cp->vars['lang_explain'],
'lang_id' => $lang_defs['iso'][$config['default_lang']],
'field_id' => 1,
'lang_default_value' => $cp->vars['lang_default_value'],
'field_default_value' => $cp->vars['field_default_value'],
'field_ident' => 'preview',
'field_type' => $field_type,
'field_length' => $cp->vars['field_length'],
'field_maxlen' => $cp->vars['field_maxlen'],
'lang_options' => $cp->vars['lang_options'],
);
if ($update_preview)
{
$preview_field['acp_preview'] = true;
}
$template->assign_vars(array(
'PREVIEW_LANG_NAME' => $cp->vars['lang_name'],
'PREVIEW_LANG_EXPLAIN' => $cp->vars['lang_explain'],
'PREVIEW_FIELD' => $cp->process_field_row(($update_preview) ? 'change' : 'preview', $preview_field))
);
break; break;
// Define remaining language variables // Define remaining language variables

View File

@ -1237,6 +1237,12 @@ function build_url($strip_vars = false)
$redirect = (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name'] . (($user->page['query_string']) ? "?{$user->page['query_string']}" : ''); $redirect = (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name'] . (($user->page['query_string']) ? "?{$user->page['query_string']}" : '');
$redirect = append_sid($redirect, false, false); $redirect = append_sid($redirect, false, false);
// Add delimiter if not there...
if (strpos($redirect, '?') === false)
{
$redirect .= '?';
}
// Strip vars... // Strip vars...
if ($strip_vars !== false && strpos($redirect, '?') !== false) if ($strip_vars !== false && strpos($redirect, '?') !== false)
{ {

View File

@ -65,7 +65,8 @@ class custom_profile
$template->assign_block_vars('profile_fields', array( $template->assign_block_vars('profile_fields', array(
'LANG_NAME' => $row['lang_name'], 'LANG_NAME' => $row['lang_name'],
'LANG_EXPLAIN' => $row['lang_explain'], 'LANG_EXPLAIN' => $row['lang_explain'],
'FIELD' => $tpl_snippet) 'FIELD' => $tpl_snippet,
'S_REQUIRED' => ($row['field_required']) ? true : false)
); );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@ -355,20 +356,25 @@ class custom_profile
WHERE user_id IN (' . implode(', ', array_map('intval', $user_id)) . ')'; WHERE user_id IN (' . implode(', ', array_map('intval', $user_id)) . ')';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$user_fields = array(); $field_data = array();
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
foreach ($row as $ident => $value) $field_data[$row['user_id']] = $row;
{
if (isset($this->profile_cache[$ident]))
{
$user_fields[$row['user_id']][$ident]['value'] = $value;
$user_fields[$row['user_id']][$ident]['data'] = $this->profile_cache[$ident];
}
}
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$user_fields = array();
// Go through the fields in correct order
foreach (array_keys($this->profile_cache) as $used_ident)
{
foreach ($field_data as $user_id => $row)
{
$user_fields[$user_id][$used_ident]['value'] = $row[$used_ident];
$user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident];
}
}
return $user_fields; return $user_fields;
} }
else if ($mode == 'show') else if ($mode == 'show')
@ -444,6 +450,7 @@ class custom_profile
return $value; return $value;
break; break;
// case 'datetime':
case 'date': case 'date':
$date = explode('-', $value); $date = explode('-', $value);
$month = (isset($date[0])) ? (int) $date[0] : 0; $month = (isset($date[0])) ? (int) $date[0] : 0;
@ -456,14 +463,12 @@ class custom_profile
} }
else if ($day && $month && $year) else if ($day && $month && $year)
{ {
global $user; return sprintf('%4d-%02d-%02d', $year, $month, $day);
return $user->format_date(mktime(0, 0, 1, $day, $month, $year));
} }
return $value; return $value;
break; break;
case 'dropdown': case 'dropdown':
$field_id = $ident_ary['data']['field_id']; $field_id = $ident_ary['data']['field_id'];
$lang_id = $ident_ary['data']['lang_id']; $lang_id = $ident_ary['data']['lang_id'];
@ -479,7 +484,7 @@ class custom_profile
return $this->options_lang[$field_id][$lang_id][(int) $value]; return $this->options_lang[$field_id][$lang_id][(int) $value];
break; break;
case 'bool': case 'bool':
$field_id = $ident_ary['data']['field_id']; $field_id = $ident_ary['data']['field_id'];
$lang_id = $ident_ary['data']['lang_id']; $lang_id = $ident_ary['data']['lang_id'];
@ -501,7 +506,7 @@ class custom_profile
return $this->options_lang[$field_id][$lang_id][(int) ($value + 1)]; return $this->options_lang[$field_id][$lang_id][(int) ($value + 1)];
} }
break; break;
default: default:
trigger_error('Unknown profile type', E_USER_ERROR); trigger_error('Unknown profile type', E_USER_ERROR);
break; break;
@ -532,7 +537,7 @@ class custom_profile
} }
else else
{ {
if (is_null($user->profile_fields[$user_ident]) && !$preview) if (!$preview && is_null($user->profile_fields[$user_ident]))
{ {
$value = NULL; $value = NULL;
} }
@ -651,8 +656,7 @@ class custom_profile
{ {
if (!isset($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']]) || !sizeof($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']])) if (!isset($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']]) || !sizeof($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']]))
{ {
$s_preview = ($preview || isset($profile_row['acp_preview'])) ? true : false; $this->get_option_lang($profile_row['field_id'], $profile_row['lang_id'], FIELD_BOOL, $preview);
$this->get_option_lang($profile_row['field_id'], $profile_row['lang_id'], FIELD_BOOL, $s_preview);
} }
foreach ($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']] as $option_id => $option_value) foreach ($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']] as $option_id => $option_value)
@ -707,8 +711,7 @@ class custom_profile
if (!isset($this->options_lang[$profile_row['field_id']]) || !isset($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']]) || !sizeof($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']])) if (!isset($this->options_lang[$profile_row['field_id']]) || !isset($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']]) || !sizeof($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']]))
{ {
$s_preview = ($preview || isset($profile_row['acp_preview'])) ? true : false; $this->get_option_lang($profile_row['field_id'], $profile_row['lang_id'], FIELD_DROPDOWN, $preview);
$this->get_option_lang($profile_row['field_id'], $profile_row['lang_id'], FIELD_DROPDOWN, $s_preview);
} }
$profile_row['field_value'] = $value; $profile_row['field_value'] = $value;
@ -1026,7 +1029,7 @@ class custom_profile_admin extends custom_profile
$options = array( $options = array(
0 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row)), 0 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row)),
1 => array('TITLE' => $user->lang['ALWAYS_TODAY'], 'FIELD' => '<input type="radio" name="always_now" value="1"' . (($s_checked) ? ' checked="checked"' : '') . ' /> ' . $user->lang['YES'] . ' <input type="radio" name="always_now" value="0"' . ((!$s_checked) ? ' checked="checked"' : '') . ' /> ' . $user->lang['NO']), 1 => array('TITLE' => $user->lang['ALWAYS_TODAY'], 'FIELD' => '<input type="radio" name="always_now" value="1"' . (($s_checked) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $user->lang['YES'] . ' <input type="radio" name="always_now" value="0"' . ((!$s_checked) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $user->lang['NO']),
); );
return $options; return $options;

View File

@ -201,8 +201,8 @@ function user_delete($mode, $user_id, $post_username = false)
if ($row = $db->sql_fetchrow($result)) if ($row = $db->sql_fetchrow($result))
{ {
set_config('newest_user_id', $row['user_id']); set_config('newest_user_id', $row['user_id'], true);
set_config('newest_username', $row['username']); set_config('newest_username', $row['username'], true);
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
} }

View File

@ -767,8 +767,8 @@ class parse_message extends bbcode_firstpass
// Do some general 'cleanup' first before processing message, // Do some general 'cleanup' first before processing message,
// e.g. remove excessive newlines(?), smilies(?) // e.g. remove excessive newlines(?), smilies(?)
// Transform \r\n and \r into \n // Transform \r\n and \r into \n
$match = array('#\r\n?#', '#sid=[a-z0-9]*?&amp;?#', "#([\n][\s]+){3,}#", '#(script|about|applet|activex|chrome):#i'); $match = array('#\r\n?#', "#([\n][\s]+){3,}#", '#(script|about|applet|activex|chrome):#i');
$replace = array("\n", '', "\n\n", "\\1&#058;"); $replace = array("\n", "\n\n", "\\1&#058;");
$this->message = preg_replace($match, $replace, trim($this->message)); $this->message = preg_replace($match, $replace, trim($this->message));
// Message length check. -1 disables this check completely. // Message length check. -1 disables this check completely.

View File

@ -105,8 +105,8 @@ class ucp_activate
if (!$update_password) if (!$update_password)
{ {
set_config('newest_user_id', $row['user_id']); set_config('newest_user_id', $row['user_id'], true);
set_config('newest_username', $row['username']); set_config('newest_username', $row['username'], true);
set_config('num_users', $config['num_users'] + 1, true); set_config('num_users', $config['num_users'] + 1, true);
} }

View File

@ -400,8 +400,8 @@ class ucp_register
if ($user_type == USER_NORMAL || !$config['email_enable']) if ($user_type == USER_NORMAL || !$config['email_enable'])
{ {
set_config('newest_user_id', $user_id); set_config('newest_user_id', $user_id, true);
set_config('newest_username', $username); set_config('newest_username', $username, true);
set_config('num_users', $config['num_users'] + 1, true); set_config('num_users', $config['num_users'] + 1, true);
} }
unset($data); unset($data);

View File

@ -54,7 +54,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_form',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_sig', 'Thanks, The Management'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_sig', 'Thanks, The Management');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_hide_emails', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_hide_emails', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_timezone', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_timezone', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('browser_check', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('browser_check', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_interval', '10'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_interval', '10');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_type', 'd'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_type', 'd');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cache_gc', '7200'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('cache_gc', '7200');

View File

@ -408,6 +408,7 @@ $lang = array_merge($lang, array(
'LOG_CONFIG_VISUAL' => '<b>Altered visual confirmation settings</b>', 'LOG_CONFIG_VISUAL' => '<b>Altered visual confirmation settings</b>',
'LOG_APPROVE_TOPIC' => '<b>Approved topic</b><br />&#187; %s', 'LOG_APPROVE_TOPIC' => '<b>Approved topic</b><br />&#187; %s',
'LOG_BUMP_TOPIC' => '<b>User bumped topic</b><br />&#187; %s',
'LOG_DELETE_POST' => '<b>Deleted post</b><br />&#187; %s', 'LOG_DELETE_POST' => '<b>Deleted post</b><br />&#187; %s',
'LOG_DELETE_TOPIC' => '<b>Deleted topic</b><br />&#187; %s', 'LOG_DELETE_TOPIC' => '<b>Deleted topic</b><br />&#187; %s',
'LOG_FORK' => '<b>Copied topic</b><br />&#187; from %s', 'LOG_FORK' => '<b>Copied topic</b><br />&#187; from %s',

View File

@ -248,7 +248,7 @@ if ($mode == 'bump')
markread('post', $forum_id, $topic_id, $current_time); markread('post', $forum_id, $topic_id, $current_time);
add_log('mod', $forum_id, $topic_id, sprintf($user->lang['LOGM_BUMP'], $post_data['topic_title'])); add_log('mod', $forum_id, $topic_id, 'LOG_BUMP_TOPIC', $post_data['topic_title']);
$meta_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}"; $meta_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}";
meta_refresh(3, $meta_url); meta_refresh(3, $meta_url);
@ -958,12 +958,12 @@ if (!sizeof($error) && $preview)
$post_data['bbcode_uid'] = ($mode == 'quote' && !$preview && !$refresh && !sizeof($error)) ? $post_data['bbcode_uid'] : $message_parser->bbcode_uid; $post_data['bbcode_uid'] = ($mode == 'quote' && !$preview && !$refresh && !sizeof($error)) ? $post_data['bbcode_uid'] : $message_parser->bbcode_uid;
$message_parser->decode_message($post_data['bbcode_uid']); $message_parser->decode_message($post_data['bbcode_uid']);
if ($mode == 'quote' && !$preview && !$refresh) if ($mode == 'quote' && !$submit && !$preview && !$refresh)
{ {
$message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n"; $message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
} }
if (($mode == 'reply' || $mode == 'quote') && !$preview && !$refresh) if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh)
{ {
$post_data['post_subject'] = ((!preg_match('/^Re:/', $post_data['post_subject'])) ? 'Re: ' : '') . censor_text($post_data['post_subject']); $post_data['post_subject'] = ((!preg_match('/^Re:/', $post_data['post_subject'])) ? 'Re: ' : '') . censor_text($post_data['post_subject']);
} }

View File

@ -54,7 +54,11 @@
</tr> </tr>
<!-- BEGIN profile_fields --> <!-- BEGIN profile_fields -->
<tr> <tr>
<td class="row1" width="35%"><b class="genmed">{profile_fields.LANG_NAME}: </b><!-- IF profile_fields.LANG_EXPLAIN --><br /><span class="gensmall">{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF --></td> <td class="row1" width="35%">
<b class="genmed">{profile_fields.LANG_NAME}: </b>
<!-- IF profile_fields.S_REQUIRED --><b>*</b><!-- ENDIF -->
<!-- IF profile_fields.LANG_EXPLAIN --><br /><span class="gensmall">{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF -->
</td>
<td class="row2">{profile_fields.FIELD}<!-- IF profile_fields.ERROR --><br /><span class="gensmall" style="color:red">{profile_fields.ERROR}</span><!-- ENDIF --></td> <td class="row2">{profile_fields.FIELD}<!-- IF profile_fields.ERROR --><br /><span class="gensmall" style="color:red">{profile_fields.ERROR}</span><!-- ENDIF --></td>
</tr> </tr>
<!-- END profile_fields --> <!-- END profile_fields -->