mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
fix some bugs... again. :)
git-svn-id: file:///svn/phpbb/trunk@6165 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
0fa9103a0c
commit
4f7c52e9e3
14 changed files with 168 additions and 69 deletions
|
@ -134,11 +134,13 @@
|
||||||
<dt><label for="quicktools">{L_QUICK_TOOLS}:</label></dt>
|
<dt><label for="quicktools">{L_QUICK_TOOLS}:</label></dt>
|
||||||
<dd><select id="quicktools" name="action">{S_ACTION_OPTIONS}</select></dd>
|
<dd><select id="quicktools" name="action">{S_ACTION_OPTIONS}</select></dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<!-- IF not S_OWN_ACCOUNT -->
|
||||||
<dt><label for="delete_user">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt>
|
<dl>
|
||||||
<dd><input type="checkbox" class="radio" name="delete" value="1" /></dd>
|
<dt><label for="delete_user">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt>
|
||||||
<dd><select id="delete_user" name="delete_type"><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select></dd>
|
<dd><input type="checkbox" class="radio" name="delete" value="1" /></dd>
|
||||||
</dl>
|
<dd><select id="delete_user" name="delete_type"><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select></dd>
|
||||||
|
</dl>
|
||||||
|
<!-- ENDIF -->
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
|
|
@ -631,25 +631,30 @@ class acp_attachments
|
||||||
|
|
||||||
$img_path = $config['upload_icons_path'];
|
$img_path = $config['upload_icons_path'];
|
||||||
|
|
||||||
$imglist = filelist($phpbb_root_path . $img_path);
|
|
||||||
$imglist = array_values($imglist);
|
|
||||||
$imglist = $imglist[0];
|
|
||||||
|
|
||||||
$filename_list = '';
|
$filename_list = '';
|
||||||
$no_image_select = false;
|
$no_image_select = false;
|
||||||
foreach ($imglist as $key => $img)
|
|
||||||
{
|
|
||||||
if (!$ext_group_row['upload_icon'])
|
|
||||||
{
|
|
||||||
$no_image_select = true;
|
|
||||||
$selected = '';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$selected = ($ext_group_row['upload_icon'] == $img) ? ' selected="selected"' : '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . htmlspecialchars($img) . '</option>';
|
$imglist = filelist($phpbb_root_path . $img_path);
|
||||||
|
|
||||||
|
if (sizeof($imglist))
|
||||||
|
{
|
||||||
|
$imglist = array_values($imglist);
|
||||||
|
$imglist = $imglist[0];
|
||||||
|
|
||||||
|
foreach ($imglist as $key => $img)
|
||||||
|
{
|
||||||
|
if (!$ext_group_row['upload_icon'])
|
||||||
|
{
|
||||||
|
$no_image_select = true;
|
||||||
|
$selected = '';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$selected = ($ext_group_row['upload_icon'] == $img) ? ' selected="selected"' : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . htmlspecialchars($img) . '</option>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
|
@ -127,7 +127,8 @@ class acp_language
|
||||||
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
|
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT * FROM ' . LANG_TABLE . "
|
$sql = 'SELECT *
|
||||||
|
FROM ' . LANG_TABLE . "
|
||||||
WHERE lang_id = $lang_id";
|
WHERE lang_id = $lang_id";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$row = $db->sql_fetchrow($result);
|
$row = $db->sql_fetchrow($result);
|
||||||
|
@ -162,7 +163,8 @@ class acp_language
|
||||||
trigger_error($user->lang['NO_FILE_SELECTED'] . adm_back_link($this->u_action));
|
trigger_error($user->lang['NO_FILE_SELECTED'] . adm_back_link($this->u_action));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT * FROM ' . LANG_TABLE . "
|
$sql = 'SELECT *
|
||||||
|
FROM ' . LANG_TABLE . "
|
||||||
WHERE lang_id = $lang_id";
|
WHERE lang_id = $lang_id";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$row = $db->sql_fetchrow($result);
|
$row = $db->sql_fetchrow($result);
|
||||||
|
@ -332,7 +334,8 @@ class acp_language
|
||||||
|
|
||||||
$this->page_title = 'LANGUAGE_PACK_DETAILS';
|
$this->page_title = 'LANGUAGE_PACK_DETAILS';
|
||||||
|
|
||||||
$sql = 'SELECT * FROM ' . LANG_TABLE . '
|
$sql = 'SELECT *
|
||||||
|
FROM ' . LANG_TABLE . '
|
||||||
WHERE lang_id = ' . $lang_id;
|
WHERE lang_id = ' . $lang_id;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$lang_entries = $db->sql_fetchrow($result);
|
$lang_entries = $db->sql_fetchrow($result);
|
||||||
|
@ -644,7 +647,8 @@ class acp_language
|
||||||
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
|
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT * FROM ' . LANG_TABLE . '
|
$sql = 'SELECT *
|
||||||
|
FROM ' . LANG_TABLE . '
|
||||||
WHERE lang_id = ' . $lang_id;
|
WHERE lang_id = ' . $lang_id;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$row = $db->sql_fetchrow($result);
|
$row = $db->sql_fetchrow($result);
|
||||||
|
@ -686,7 +690,8 @@ class acp_language
|
||||||
);
|
);
|
||||||
unset($file);
|
unset($file);
|
||||||
|
|
||||||
$sql = 'SELECT lang_iso FROM ' . LANG_TABLE . "
|
$sql = 'SELECT lang_iso
|
||||||
|
FROM ' . LANG_TABLE . "
|
||||||
WHERE lang_iso = '" . $db->sql_escape($lang_iso) . "'";
|
WHERE lang_iso = '" . $db->sql_escape($lang_iso) . "'";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
@ -725,7 +730,8 @@ class acp_language
|
||||||
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
|
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT * FROM ' . LANG_TABLE . '
|
$sql = 'SELECT *
|
||||||
|
FROM ' . LANG_TABLE . '
|
||||||
WHERE lang_id = ' . $lang_id;
|
WHERE lang_id = ' . $lang_id;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$row = $db->sql_fetchrow($result);
|
$row = $db->sql_fetchrow($result);
|
||||||
|
@ -841,7 +847,8 @@ class acp_language
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . LANG_TABLE;
|
FROM ' . LANG_TABLE . '
|
||||||
|
ORDER BY lang_english_name';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$installed = array();
|
$installed = array();
|
||||||
|
|
|
@ -50,7 +50,8 @@ class acp_profile
|
||||||
$lang_defs = array();
|
$lang_defs = array();
|
||||||
|
|
||||||
$sql = 'SELECT lang_id, lang_iso
|
$sql = 'SELECT lang_id, lang_iso
|
||||||
FROM ' . LANG_TABLE;
|
FROM ' . LANG_TABLE . '
|
||||||
|
ORDER BY lang_english_name';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
@ -63,7 +64,7 @@ class acp_profile
|
||||||
|
|
||||||
$sql = 'SELECT field_id, lang_id
|
$sql = 'SELECT field_id, lang_id
|
||||||
FROM ' . PROFILE_LANG_TABLE . '
|
FROM ' . PROFILE_LANG_TABLE . '
|
||||||
ORDER BY lang_id';
|
ORDER BY lang_id';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
@ -293,10 +294,11 @@ class acp_profile
|
||||||
$field_type = $field_row['field_type'];
|
$field_type = $field_row['field_type'];
|
||||||
|
|
||||||
// Get language entries
|
// Get language entries
|
||||||
$sql = 'SELECT * FROM ' . PROFILE_FIELDS_LANG_TABLE . '
|
$sql = 'SELECT *
|
||||||
|
FROM ' . PROFILE_FIELDS_LANG_TABLE . '
|
||||||
WHERE lang_id = ' . $lang_defs['iso'][$config['default_lang']] . "
|
WHERE lang_id = ' . $lang_defs['iso'][$config['default_lang']] . "
|
||||||
AND field_id = $field_id
|
AND field_id = $field_id
|
||||||
ORDER BY option_id ASC";
|
ORDER BY option_id ASC";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$lang_options = array();
|
$lang_options = array();
|
||||||
|
@ -474,7 +476,8 @@ class acp_profile
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
{
|
{
|
||||||
// Get language entries
|
// Get language entries
|
||||||
$sql = 'SELECT * FROM ' . PROFILE_FIELDS_LANG_TABLE . '
|
$sql = 'SELECT *
|
||||||
|
FROM ' . PROFILE_FIELDS_LANG_TABLE . '
|
||||||
WHERE lang_id <> ' . $lang_defs['iso'][$config['default_lang']] . "
|
WHERE lang_id <> ' . $lang_defs['iso'][$config['default_lang']] . "
|
||||||
AND field_id = $field_id
|
AND field_id = $field_id
|
||||||
ORDER BY option_id ASC";
|
ORDER BY option_id ASC";
|
||||||
|
@ -488,7 +491,8 @@ class acp_profile
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
|
||||||
$sql = 'SELECT lang_id, lang_name, lang_explain, lang_default_value FROM ' . PROFILE_LANG_TABLE . '
|
$sql = 'SELECT lang_id, lang_name, lang_explain, lang_default_value
|
||||||
|
FROM ' . PROFILE_LANG_TABLE . '
|
||||||
WHERE lang_id <> ' . $lang_defs['iso'][$config['default_lang']] . "
|
WHERE lang_id <> ' . $lang_defs['iso'][$config['default_lang']] . "
|
||||||
AND field_id = $field_id
|
AND field_id = $field_id
|
||||||
ORDER BY lang_id ASC";
|
ORDER BY lang_id ASC";
|
||||||
|
@ -769,7 +773,8 @@ class acp_profile
|
||||||
|
|
||||||
$sql = 'SELECT lang_id, lang_iso
|
$sql = 'SELECT lang_id, lang_iso
|
||||||
FROM ' . LANG_TABLE . "
|
FROM ' . LANG_TABLE . "
|
||||||
WHERE lang_iso <> '" . $config['default_lang'] . "'";
|
WHERE lang_iso <> '" . $config['default_lang'] . "'
|
||||||
|
ORDER BY lang_english_name";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$languages = array();
|
$languages = array();
|
||||||
|
|
|
@ -192,6 +192,12 @@ class acp_users
|
||||||
case 'banuser':
|
case 'banuser':
|
||||||
case 'banemail':
|
case 'banemail':
|
||||||
case 'banip':
|
case 'banip':
|
||||||
|
|
||||||
|
if ($user_id == $user->data['user_id'])
|
||||||
|
{
|
||||||
|
trigger_error($user->lang['CANNOT_BAN_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||||
|
}
|
||||||
|
|
||||||
$ban = array();
|
$ban = array();
|
||||||
|
|
||||||
switch ($action)
|
switch ($action)
|
||||||
|
@ -238,6 +244,11 @@ class acp_users
|
||||||
|
|
||||||
case 'reactivate':
|
case 'reactivate':
|
||||||
|
|
||||||
|
if ($user_id == $user->data['user_id'])
|
||||||
|
{
|
||||||
|
trigger_error($user->lang['CANNOT_FORCE_REACT_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||||
|
}
|
||||||
|
|
||||||
if ($config['email_enable'])
|
if ($config['email_enable'])
|
||||||
{
|
{
|
||||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||||
|
@ -287,6 +298,12 @@ class acp_users
|
||||||
|
|
||||||
case 'active':
|
case 'active':
|
||||||
|
|
||||||
|
if ($user_id == $user->data['user_id'])
|
||||||
|
{
|
||||||
|
// It is only deactivation since the user is already activated (else he would not have reached this page)
|
||||||
|
trigger_error($user->lang['CANNOT_DEACTIVATE_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||||
|
}
|
||||||
|
|
||||||
user_active_flip($user_id, $user_row['user_type'], false, $user_row['username']);
|
user_active_flip($user_id, $user_row['user_type'], false, $user_row['username']);
|
||||||
|
|
||||||
$message = ($user_row['user_type'] == USER_INACTIVE) ? 'USER_ADMIN_ACTIVATED' : 'USER_ADMIN_DEACTIVED';
|
$message = ($user_row['user_type'] == USER_INACTIVE) ? 'USER_ADMIN_ACTIVATED' : 'USER_ADMIN_DEACTIVED';
|
||||||
|
@ -749,11 +766,19 @@ class acp_users
|
||||||
}
|
}
|
||||||
|
|
||||||
$user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS');
|
$user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS');
|
||||||
$quick_tool_ary = array('banuser' => 'BAN_USER', 'banemail' => 'BAN_EMAIL', 'banip' => 'BAN_IP', 'active' => (($user_row['user_type'] == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE'), 'delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
|
|
||||||
|
if ($user_id == $user->data['user_id'])
|
||||||
if ($config['email_enable'])
|
|
||||||
{
|
{
|
||||||
$quick_tool_ary['reactivate'] = 'FORCE';
|
$quick_tool_ary = array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$quick_tool_ary = array('banuser' => 'BAN_USER', 'banemail' => 'BAN_EMAIL', 'banip' => 'BAN_IP', 'active' => (($user_row['user_type'] == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE'), 'delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
|
||||||
|
|
||||||
|
if ($config['email_enable'])
|
||||||
|
{
|
||||||
|
$quick_tool_ary['reactivate'] = 'FORCE';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$s_action_options = '<option class="sep" value="">' . $user->lang['SELECT_OPTION'] . '</option>';
|
$s_action_options = '<option class="sep" value="">' . $user->lang['SELECT_OPTION'] . '</option>';
|
||||||
|
@ -771,6 +796,7 @@ class acp_users
|
||||||
'S_USER_IP' => ($user_row['user_ip']) ? true : false,
|
'S_USER_IP' => ($user_row['user_ip']) ? true : false,
|
||||||
'S_USER_FOUNDER' => ($user_row['user_type'] == USER_FOUNDER) ? true : false,
|
'S_USER_FOUNDER' => ($user_row['user_type'] == USER_FOUNDER) ? true : false,
|
||||||
'S_ACTION_OPTIONS' => $s_action_options,
|
'S_ACTION_OPTIONS' => $s_action_options,
|
||||||
|
'S_OWN_ACCOUNT' => ($user_id == $user->data['user_id']) ? true : false,
|
||||||
|
|
||||||
'U_SHOW_IP' => $this->u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'),
|
'U_SHOW_IP' => $this->u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'),
|
||||||
'U_WHOIS' => $this->u_action . "&action=whois&user_ip={$user_row['user_ip']}",
|
'U_WHOIS' => $this->u_action . "&action=whois&user_ip={$user_row['user_ip']}",
|
||||||
|
|
|
@ -561,7 +561,7 @@ class bbcode
|
||||||
$code = str_replace(' ', ' ', $code);
|
$code = str_replace(' ', ' ', $code);
|
||||||
|
|
||||||
// remove newline at the beginning
|
// remove newline at the beginning
|
||||||
if ($code{0} == "\n")
|
if (!empty($code) && $code{0} == "\n")
|
||||||
{
|
{
|
||||||
$code = substr($code, 1);
|
$code = substr($code, 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -339,9 +339,18 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
|
||||||
$file->upload->set_allowed_dimensions(0, 0, $config['img_max_width'], $config['img_max_height']);
|
$file->upload->set_allowed_dimensions(0, 0, $config['img_max_width'], $config['img_max_height']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Admins and mods are allowed to exceed the allowed filesize
|
||||||
if (!$auth->acl_get('a_') && !$auth->acl_get('m_', $forum_id))
|
if (!$auth->acl_get('a_') && !$auth->acl_get('m_', $forum_id))
|
||||||
{
|
{
|
||||||
$allowed_filesize = ($extensions[$file->get('extension')]['max_filesize'] != 0) ? $extensions[$file->get('extension')]['max_filesize'] : (($is_message) ? $config['max_filesize_pm'] : $config['max_filesize']);
|
if (!empty($extensions[$file->get('extension')]['max_filesize']))
|
||||||
|
{
|
||||||
|
$allowed_filesize = $extensions[$file->get('extension')]['max_filesize'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$allowed_filesize = ($is_message) ? $config['max_filesize_pm'] : $config['max_filesize'];
|
||||||
|
}
|
||||||
|
|
||||||
$file->upload->set_max_filesize($allowed_filesize);
|
$file->upload->set_max_filesize($allowed_filesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -384,10 +384,12 @@ function user_active_flip($user_id, $user_type, $user_actkey = false, $username
|
||||||
WHERE user_id = $user_id";
|
WHERE user_id = $user_id";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
$group_name = ($user_type == USER_NORMAL) ? 'REGISTERED' : 'INACTIVE';
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
if ($group_name = array_search($row['group_id'], $group_id_ary))
|
if ($name = array_search($row['group_id'], $group_id_ary))
|
||||||
{
|
{
|
||||||
|
$group_name = $name;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,23 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||||
$icons = array();
|
$icons = array();
|
||||||
$cache->obtain_icons($icons);
|
$cache->obtain_icons($icons);
|
||||||
|
|
||||||
$color_rows = array('marked', 'replied', 'friend', 'foe');
|
$color_rows = array('marked', 'replied');
|
||||||
|
|
||||||
|
// only show the friend/foe color rows if the module is enabled
|
||||||
|
$zebra_enabled = false;
|
||||||
|
|
||||||
|
$_module = new p_master();
|
||||||
|
$_module->list_modules('ucp');
|
||||||
|
$_module->set_active('zebra');
|
||||||
|
|
||||||
|
$zebra_enabled = ($_module->active_module === false) ? false : true;
|
||||||
|
|
||||||
|
unset($_module);
|
||||||
|
|
||||||
|
if ($zebra_enabled)
|
||||||
|
{
|
||||||
|
$color_rows = array_merge($color_rows, array('friend', 'foe'));
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($color_rows as $var)
|
foreach ($color_rows as $var)
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,9 +34,12 @@ $lang = array_merge($lang, array(
|
||||||
|
|
||||||
'BAN_SUCCESSFUL' => 'Ban entered successfully',
|
'BAN_SUCCESSFUL' => 'Ban entered successfully',
|
||||||
|
|
||||||
'CANNOT_REMOVE_ANONYMOUS' => 'You are not able to remove the guest user account.',
|
'CANNOT_BAN_YOURSELF' => 'You are not allowed to ban yourself.',
|
||||||
'CANNOT_REMOVE_YOURSELF' => 'You are not allowed to remove your own user account.',
|
'CANNOT_DEACTIVATE_YOURSELF' => 'You are not allowed to deactivate your own account.',
|
||||||
'CONFIRM_EMAIL_EXPLAIN' => 'You only need to specify this if you are changing the users email address.',
|
'CANNOT_FORCE_REACT_YOURSELF' => 'You are not allowed to force reactivation of your own account.',
|
||||||
|
'CANNOT_REMOVE_ANONYMOUS' => 'You are not able to remove the guest user account.',
|
||||||
|
'CANNOT_REMOVE_YOURSELF' => 'You are not allowed to remove your own user account.',
|
||||||
|
'CONFIRM_EMAIL_EXPLAIN' => 'You only need to specify this if you are changing the users email address.',
|
||||||
|
|
||||||
'DELETE_POSTS' => 'Delete posts',
|
'DELETE_POSTS' => 'Delete posts',
|
||||||
'DELETE_USER' => 'Delete user',
|
'DELETE_USER' => 'Delete user',
|
||||||
|
|
|
@ -566,25 +566,13 @@ if ($submit || $preview || $refresh)
|
||||||
if ($poll_delete && $mode == 'edit' && sizeof($post_data['poll_options']) &&
|
if ($poll_delete && $mode == 'edit' && sizeof($post_data['poll_options']) &&
|
||||||
((!$post_data['poll_last_vote'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id)))
|
((!$post_data['poll_last_vote'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id)))
|
||||||
{
|
{
|
||||||
switch (SQL_LAYER)
|
$sql = 'DELETE FROM ' . POLL_OPTIONS_TABLE . "
|
||||||
{
|
WHERE topic_id = $topic_id";
|
||||||
case 'mysql4':
|
$db->sql_query($sql);
|
||||||
case 'mysqli':
|
|
||||||
$sql = 'DELETE FROM ' . POLL_OPTIONS_TABLE . ', ' . POLL_VOTES_TABLE . "
|
|
||||||
WHERE topic_id = $topic_id";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
$sql = 'DELETE FROM ' . POLL_VOTES_TABLE . "
|
||||||
$sql = 'DELETE FROM ' . POLL_OPTIONS_TABLE . "
|
WHERE topic_id = $topic_id";
|
||||||
WHERE topic_id = $topic_id";
|
$db->sql_query($sql);
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
$sql = 'DELETE FROM ' . POLL_VOTES_TABLE . "
|
|
||||||
WHERE topic_id = $topic_id";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$topic_sql = array(
|
$topic_sql = array(
|
||||||
'poll_title' => '',
|
'poll_title' => '',
|
||||||
|
|
|
@ -33,10 +33,10 @@
|
||||||
<param name="ShowControls" value="1">
|
<param name="ShowControls" value="1">
|
||||||
<param name="ShowDisplay" value="0">
|
<param name="ShowDisplay" value="0">
|
||||||
<param name="ShowStatusBar" value="1">
|
<param name="ShowStatusBar" value="1">
|
||||||
<param name="AutoSize" value="1">
|
<param name="AutoSize" value="1">
|
||||||
<param name="AutoStart" value="0">
|
<param name="AutoStart" value="0">
|
||||||
<param name="Visible" value="1">
|
<param name="Visible" value="1">
|
||||||
<param name="AnimationStart" value="0">
|
<param name="AnimationStart" value="0">
|
||||||
<param name="Loop" value="0">
|
<param name="Loop" value="0">
|
||||||
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows95/downloads/contents/wurecommended/s_wufeatured/mediaplayer/default.asp" src="{_file.U_DOWNLOAD_LINK}" name=MediaPlayer2 showcontrols=1 showdisplay=0 showstatusbar=1 autosize=1 autostart=0 visible=1 animationatstart=0 loop=0></embed>
|
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows95/downloads/contents/wurecommended/s_wufeatured/mediaplayer/default.asp" src="{_file.U_DOWNLOAD_LINK}" name=MediaPlayer2 showcontrols=1 showdisplay=0 showstatusbar=1 autosize=1 autostart=0 visible=1 animationatstart=0 loop=0></embed>
|
||||||
</object>
|
</object>
|
||||||
|
|
|
@ -384,13 +384,43 @@ $sql_array = array(
|
||||||
$sql = $db->sql_build_query('SELECT', $sql_array);
|
$sql = $db->sql_build_query('SELECT', $sql_array);
|
||||||
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
|
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
|
||||||
|
|
||||||
|
$shadow_topic_list = array();
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
|
if ($row['topic_status'] == ITEM_MOVED)
|
||||||
|
{
|
||||||
|
$shadow_topic_list[$row['topic_moved_id']] = $row['topic_id'];
|
||||||
|
}
|
||||||
|
|
||||||
$rowset[$row['topic_id']] = $row;
|
$rowset[$row['topic_id']] = $row;
|
||||||
$topic_list[] = $row['topic_id'];
|
$topic_list[] = $row['topic_id'];
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
// If we have some shadow topics, update the rowset to reflect their topic informations
|
||||||
|
if (sizeof($shadow_topic_list))
|
||||||
|
{
|
||||||
|
$sql = 'SELECT *
|
||||||
|
FROM ' . TOPICS_TABLE . '
|
||||||
|
WHERE topic_id IN (' . implode(', ', array_keys($shadow_topic_list)) . ')';
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$orig_topic_id = $shadow_topic_list[$row['topic_id']];
|
||||||
|
|
||||||
|
// We want to retain some values
|
||||||
|
$row = array_merge($row, array(
|
||||||
|
'topic_moved_id' => $rowset[$orig_topic_id]['topic_moved_id'],
|
||||||
|
'topic_status' => $rowset[$orig_topic_id]['topic_status'])
|
||||||
|
);
|
||||||
|
|
||||||
|
$rowset[$orig_topic_id] = $row;
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
unset($shadow_topic_list);
|
||||||
|
|
||||||
$topic_list = ($store_reverse) ? array_merge($announcement_list, array_reverse($topic_list)) : array_merge($announcement_list, $topic_list);
|
$topic_list = ($store_reverse) ? array_merge($announcement_list, array_reverse($topic_list)) : array_merge($announcement_list, $topic_list);
|
||||||
$topic_tracking_info = $tracking_topics = array();
|
$topic_tracking_info = $tracking_topics = array();
|
||||||
|
|
||||||
|
@ -406,7 +436,7 @@ if (sizeof($topic_list))
|
||||||
$topic_forum_list = array();
|
$topic_forum_list = array();
|
||||||
foreach ($rowset as $t_id => $row)
|
foreach ($rowset as $t_id => $row)
|
||||||
{
|
{
|
||||||
$topic_forum_list[$row['forum_id']]['forum_mark_time'] = ($config['load_db_lastread']) ? $row['forum_mark_time'] : 0;
|
$topic_forum_list[$row['forum_id']]['forum_mark_time'] = ($config['load_db_lastread'] && $user->data['is_registered']) ? $row['forum_mark_time'] : 0;
|
||||||
$topic_forum_list[$row['forum_id']]['topics'][] = $t_id;
|
$topic_forum_list[$row['forum_id']]['topics'][] = $t_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -390,6 +390,12 @@ if ($hilit_words)
|
||||||
$highlight = urlencode($hilit_words);
|
$highlight = urlencode($hilit_words);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure $start is set to the last page if it exceeds the amount
|
||||||
|
if ($start < 0 || $start > $total_posts)
|
||||||
|
{
|
||||||
|
$start = ($start < 0) ? 0 : floor(($total_posts - 1) / $config['posts_per_page']) * $config['posts_per_page'];
|
||||||
|
}
|
||||||
|
|
||||||
// General Viewtopic URL for return links
|
// General Viewtopic URL for return links
|
||||||
$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start&$u_sort_param" . (($highlight_match) ? "&hilit=$highlight" : ''));
|
$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start&$u_sort_param" . (($highlight_match) ? "&hilit=$highlight" : ''));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue