mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-06 07:35:29 +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:
parent
0e7adebad6
commit
4306d4d083
@ -115,25 +115,9 @@
|
||||
|
||||
<fieldset class="quick" style="float: right">
|
||||
{S_HIDDEN_FIELDS}
|
||||
<input class="button1" type="submit" name="update" value="{L_UPDATE_PREVIEW}" />
|
||||
<input class="button1" type="submit" name="next" value="{L_NEXT}" />
|
||||
</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 -->
|
||||
|
||||
<!-- BEGIN options -->
|
||||
|
@ -825,12 +825,14 @@ class acp_forums
|
||||
$forum_data['forum_flags'] += ($forum_data['show_active']) ? 16 : 0;
|
||||
|
||||
// Unset data that are not database fields
|
||||
unset($forum_data['forum_link_track']);
|
||||
unset($forum_data['prune_old_polls']);
|
||||
unset($forum_data['prune_announce']);
|
||||
unset($forum_data['prune_sticky']);
|
||||
unset($forum_data['show_active']);
|
||||
unset($forum_data['forum_password_confirm']);
|
||||
$forum_data_sql = $forum_data;
|
||||
|
||||
unset($forum_data_sql['forum_link_track']);
|
||||
unset($forum_data_sql['prune_old_polls']);
|
||||
unset($forum_data_sql['prune_announce']);
|
||||
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,
|
||||
// try to take over the world ... or decide whether to continue update
|
||||
@ -840,16 +842,16 @@ class acp_forums
|
||||
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
|
||||
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
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_id = ' . $forum_data['parent_id'];
|
||||
WHERE forum_id = ' . $forum_data_sql['parent_id'];
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
@ -869,8 +871,8 @@ class acp_forums
|
||||
WHERE ' . $row['left_id'] . ' BETWEEN left_id AND right_id';
|
||||
$db->sql_query($sql);
|
||||
|
||||
$forum_data['left_id'] = $row['right_id'];
|
||||
$forum_data['right_id'] = $row['right_id'] + 1;
|
||||
$forum_data_sql['left_id'] = $row['right_id'];
|
||||
$forum_data_sql['right_id'] = $row['right_id'] + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -880,11 +882,11 @@ class acp_forums
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$forum_data['left_id'] = $row['right_id'] + 1;
|
||||
$forum_data['right_id'] = $row['right_id'] + 2;
|
||||
$forum_data_sql['left_id'] = $row['right_id'] + 1;
|
||||
$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);
|
||||
|
||||
$forum_data['forum_id'] = $db->sql_nextid();
|
||||
@ -893,34 +895,34 @@ class acp_forums
|
||||
}
|
||||
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
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
return array($user->lang['NO_FORUM_ACTION']);
|
||||
}
|
||||
|
||||
$forum_data['forum_posts'] = 0;
|
||||
$forum_data['forum_topics'] = 0;
|
||||
$forum_data['forum_topics_real'] = 0;
|
||||
$forum_data_sql['forum_posts'] = $forum_data_sql['forum_topics'] = $forum_data_sql['forum_topics_real'] = 0;
|
||||
}
|
||||
|
||||
if (sizeof($errors))
|
||||
@ -928,9 +930,9 @@ class acp_forums
|
||||
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))
|
||||
@ -938,9 +940,9 @@ class acp_forums
|
||||
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
|
||||
$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. ;)
|
||||
$forum_id = $forum_data['forum_id'];
|
||||
unset($forum_data['forum_id']);
|
||||
$forum_id = $forum_data_sql['forum_id'];
|
||||
unset($forum_data_sql['forum_id']);
|
||||
|
||||
$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;
|
||||
$db->sql_query($sql);
|
||||
|
||||
|
@ -68,8 +68,8 @@ class acp_main
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
set_config('newest_user_id', $row['user_id']);
|
||||
set_config('newest_username', $row['username']);
|
||||
set_config('newest_user_id', $row['user_id'], true);
|
||||
set_config('newest_username', $row['username'], true);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
@ -368,7 +368,7 @@ class acp_main
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
@ -223,8 +223,6 @@ class acp_profile
|
||||
$step = request_var('step', 1);
|
||||
|
||||
$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;
|
||||
|
||||
// We are editing... we need to grab basic things
|
||||
@ -264,8 +262,6 @@ class acp_profile
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$field_row['pf_preview'] = '';
|
||||
|
||||
$s_hidden_fields = '<input type="hidden" name="field_id" value="' . $field_id . '" />';
|
||||
}
|
||||
else
|
||||
@ -288,8 +284,7 @@ class acp_profile
|
||||
'field_show_on_reg' => 0,
|
||||
'lang_name' => '',
|
||||
'lang_explain' => '',
|
||||
'lang_default_value'=> '',
|
||||
'pf_preview' => '')
|
||||
'lang_default_value'=> '')
|
||||
);
|
||||
|
||||
$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 = array(
|
||||
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')
|
||||
);
|
||||
|
||||
@ -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);
|
||||
|
||||
if (sizeof($error))
|
||||
@ -524,13 +512,6 @@ class acp_profile
|
||||
$submit = false;
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['prev']) || isset($_REQUEST['next']))
|
||||
{
|
||||
$update = false;
|
||||
$pf_preview = '';
|
||||
unset($_REQUEST['pf_preview']);
|
||||
}
|
||||
|
||||
// Build up the specific hidden fields
|
||||
foreach ($exclude as $num => $key_ary)
|
||||
{
|
||||
@ -660,77 +641,6 @@ class acp_profile
|
||||
$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;
|
||||
|
||||
// Define remaining language variables
|
||||
|
@ -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 = append_sid($redirect, false, false);
|
||||
|
||||
// Add delimiter if not there...
|
||||
if (strpos($redirect, '?') === false)
|
||||
{
|
||||
$redirect .= '?';
|
||||
}
|
||||
|
||||
// Strip vars...
|
||||
if ($strip_vars !== false && strpos($redirect, '?') !== false)
|
||||
{
|
||||
|
@ -65,7 +65,8 @@ class custom_profile
|
||||
$template->assign_block_vars('profile_fields', array(
|
||||
'LANG_NAME' => $row['lang_name'],
|
||||
'LANG_EXPLAIN' => $row['lang_explain'],
|
||||
'FIELD' => $tpl_snippet)
|
||||
'FIELD' => $tpl_snippet,
|
||||
'S_REQUIRED' => ($row['field_required']) ? true : false)
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
@ -355,20 +356,25 @@ class custom_profile
|
||||
WHERE user_id IN (' . implode(', ', array_map('intval', $user_id)) . ')';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$user_fields = array();
|
||||
$field_data = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
foreach ($row as $ident => $value)
|
||||
{
|
||||
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];
|
||||
}
|
||||
}
|
||||
$field_data[$row['user_id']] = $row;
|
||||
}
|
||||
$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;
|
||||
}
|
||||
else if ($mode == 'show')
|
||||
@ -444,6 +450,7 @@ class custom_profile
|
||||
return $value;
|
||||
break;
|
||||
|
||||
// case 'datetime':
|
||||
case 'date':
|
||||
$date = explode('-', $value);
|
||||
$month = (isset($date[0])) ? (int) $date[0] : 0;
|
||||
@ -456,14 +463,12 @@ class custom_profile
|
||||
}
|
||||
else if ($day && $month && $year)
|
||||
{
|
||||
global $user;
|
||||
|
||||
return $user->format_date(mktime(0, 0, 1, $day, $month, $year));
|
||||
return sprintf('%4d-%02d-%02d', $year, $month, $day);
|
||||
}
|
||||
|
||||
return $value;
|
||||
break;
|
||||
|
||||
|
||||
case 'dropdown':
|
||||
$field_id = $ident_ary['data']['field_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];
|
||||
break;
|
||||
|
||||
|
||||
case 'bool':
|
||||
$field_id = $ident_ary['data']['field_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)];
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
trigger_error('Unknown profile type', E_USER_ERROR);
|
||||
break;
|
||||
@ -532,7 +537,7 @@ class custom_profile
|
||||
}
|
||||
else
|
||||
{
|
||||
if (is_null($user->profile_fields[$user_ident]) && !$preview)
|
||||
if (!$preview && is_null($user->profile_fields[$user_ident]))
|
||||
{
|
||||
$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']]))
|
||||
{
|
||||
$s_preview = ($preview || isset($profile_row['acp_preview'])) ? true : false;
|
||||
$this->get_option_lang($profile_row['field_id'], $profile_row['lang_id'], FIELD_BOOL, $s_preview);
|
||||
$this->get_option_lang($profile_row['field_id'], $profile_row['lang_id'], FIELD_BOOL, $preview);
|
||||
}
|
||||
|
||||
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']]))
|
||||
{
|
||||
$s_preview = ($preview || isset($profile_row['acp_preview'])) ? true : false;
|
||||
$this->get_option_lang($profile_row['field_id'], $profile_row['lang_id'], FIELD_DROPDOWN, $s_preview);
|
||||
$this->get_option_lang($profile_row['field_id'], $profile_row['lang_id'], FIELD_DROPDOWN, $preview);
|
||||
}
|
||||
|
||||
$profile_row['field_value'] = $value;
|
||||
@ -1026,7 +1029,7 @@ class custom_profile_admin extends custom_profile
|
||||
|
||||
$options = array(
|
||||
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;
|
||||
|
@ -201,8 +201,8 @@ function user_delete($mode, $user_id, $post_username = false)
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
set_config('newest_user_id', $row['user_id']);
|
||||
set_config('newest_username', $row['username']);
|
||||
set_config('newest_user_id', $row['user_id'], true);
|
||||
set_config('newest_username', $row['username'], true);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
@ -767,8 +767,8 @@ class parse_message extends bbcode_firstpass
|
||||
// Do some general 'cleanup' first before processing message,
|
||||
// e.g. remove excessive newlines(?), smilies(?)
|
||||
// Transform \r\n and \r into \n
|
||||
$match = array('#\r\n?#', '#sid=[a-z0-9]*?&?#', "#([\n][\s]+){3,}#", '#(script|about|applet|activex|chrome):#i');
|
||||
$replace = array("\n", '', "\n\n", "\\1:");
|
||||
$match = array('#\r\n?#', "#([\n][\s]+){3,}#", '#(script|about|applet|activex|chrome):#i');
|
||||
$replace = array("\n", "\n\n", "\\1:");
|
||||
$this->message = preg_replace($match, $replace, trim($this->message));
|
||||
|
||||
// Message length check. -1 disables this check completely.
|
||||
|
@ -105,8 +105,8 @@ class ucp_activate
|
||||
|
||||
if (!$update_password)
|
||||
{
|
||||
set_config('newest_user_id', $row['user_id']);
|
||||
set_config('newest_username', $row['username']);
|
||||
set_config('newest_user_id', $row['user_id'], true);
|
||||
set_config('newest_username', $row['username'], true);
|
||||
set_config('num_users', $config['num_users'] + 1, true);
|
||||
}
|
||||
|
||||
|
@ -400,8 +400,8 @@ class ucp_register
|
||||
|
||||
if ($user_type == USER_NORMAL || !$config['email_enable'])
|
||||
{
|
||||
set_config('newest_user_id', $user_id);
|
||||
set_config('newest_username', $username);
|
||||
set_config('newest_user_id', $user_id, true);
|
||||
set_config('newest_username', $username, true);
|
||||
set_config('num_users', $config['num_users'] + 1, true);
|
||||
}
|
||||
unset($data);
|
||||
|
@ -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_hide_emails', '1');
|
||||
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_type', 'd');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cache_gc', '7200');
|
||||
|
@ -408,6 +408,7 @@ $lang = array_merge($lang, array(
|
||||
'LOG_CONFIG_VISUAL' => '<b>Altered visual confirmation settings</b>',
|
||||
|
||||
'LOG_APPROVE_TOPIC' => '<b>Approved topic</b><br />» %s',
|
||||
'LOG_BUMP_TOPIC' => '<b>User bumped topic</b><br />» %s',
|
||||
'LOG_DELETE_POST' => '<b>Deleted post</b><br />» %s',
|
||||
'LOG_DELETE_TOPIC' => '<b>Deleted topic</b><br />» %s',
|
||||
'LOG_FORK' => '<b>Copied topic</b><br />» from %s',
|
||||
|
@ -248,7 +248,7 @@ if ($mode == 'bump')
|
||||
|
||||
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&t=$topic_id&p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}";
|
||||
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;
|
||||
$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";
|
||||
}
|
||||
|
||||
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']);
|
||||
}
|
||||
|
@ -54,7 +54,11 @@
|
||||
</tr>
|
||||
<!-- BEGIN profile_fields -->
|
||||
<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>
|
||||
</tr>
|
||||
<!-- END profile_fields -->
|
||||
|
Loading…
x
Reference in New Issue
Block a user