- renamed the following columns:

comment -> attach_comment
new, forwarded, unread, marked, deleted -> pm_new, pm_forwarded, pm_unread, pm_marked, pm_deleted
module_name -> module_basename
value -> lang_value

- every column is now NOT NULL
- every column is now having a DEFAULT value
- hopefully mostly consistent across every db schema
- untested schemas: sqlite, oracle, firebird


git-svn-id: file:///svn/phpbb/trunk@6177 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2006-07-13 12:51:56 +00:00
parent 4cd73bf7e5
commit c4f2430645
37 changed files with 4876 additions and 5956 deletions

View file

@ -93,9 +93,9 @@
<label><input type="radio" class="radio" name="module_display" value="0"<!-- IF not MODULE_DISPLAY --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> <label><input type="radio" class="radio" name="module_display" value="0"<!-- IF not MODULE_DISPLAY --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="module_name">{L_CHOOSE_MODULE}:</label><br /> <dt><label for="module_basename">{L_CHOOSE_MODULE}:</label><br />
<span>{L_CHOOSE_MODULE_EXPLAIN}</span></dt> <span>{L_CHOOSE_MODULE_EXPLAIN}</span></dt>
<dd><select name="module_name" id="module_name" onchange="display_modes(this.value);">{S_MODULE_NAMES}</select></dd> <dd><select name="module_basename" id="module_basename" onchange="display_modes(this.value);">{S_MODULE_NAMES}</select></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="module_mode">{L_CHOOSE_MODE}:</label><br /> <dt><label for="module_mode">{L_CHOOSE_MODE}:</label><br />

View file

@ -8,6 +8,8 @@
* *
* This file creates new schema files for every database. * This file creates new schema files for every database.
* The filenames will be prefixed with an underscore to not overwrite the current schema files. * The filenames will be prefixed with an underscore to not overwrite the current schema files.
*
* If you overwrite the original schema files please make sure you save the file with UNIX linefeeds.
*/ */
die("Please read the first lines of this script for instructions on how to enable it"); die("Please read the first lines of this script for instructions on how to enable it");
@ -89,11 +91,11 @@ $dbms_type_map = array(
'oracle' => array( 'oracle' => array(
'INT:' => 'number(%d)', 'INT:' => 'number(%d)',
'BINT' => 'number(20)', 'BINT' => 'number(20)',
'UINT' => 'number(8) UNSIGNED', 'UINT' => 'number(8)',
'UINT:' => 'number(%d) UNSIGNED', 'UINT:' => 'number(%d)',
'TINT:' => 'number(%d)', 'TINT:' => 'number(%d)',
'USINT' => 'number(4) UNSIGNED', 'USINT' => 'number(4)',
'BOOL' => 'number(1) UNSIGNED', 'BOOL' => 'number(1)',
'VCHAR' => 'varchar2(255)', 'VCHAR' => 'varchar2(255)',
'VCHAR:' => 'varchar2(%d)', 'VCHAR:' => 'varchar2(%d)',
'CHAR:' => 'char(%d)', 'CHAR:' => 'char(%d)',
@ -101,7 +103,7 @@ $dbms_type_map = array(
'STEXT' => 'varchar2(3000)', 'STEXT' => 'varchar2(3000)',
'TEXT' => 'clob', 'TEXT' => 'clob',
'MTEXT' => 'clob', 'MTEXT' => 'clob',
'TIMESTAMP' => 'number(11) UNSIGNED', 'TIMESTAMP' => 'number(11)',
'DECIMAL' => 'number(5, 2)', 'DECIMAL' => 'number(5, 2)',
'VCHAR_BIN' => 'varchar2(252)', 'VCHAR_BIN' => 'varchar2(252)',
'VCHAR_CI' => 'varchar2(255)', 'VCHAR_CI' => 'varchar2(255)',
@ -131,10 +133,10 @@ $dbms_type_map = array(
'postgres' => array( 'postgres' => array(
'INT:' => 'INT4', 'INT:' => 'INT4',
'BINT' => 'INT8', 'BINT' => 'INT8',
'UINT' => 'INT4 UNSIGNED', 'UINT' => 'INT4', // unsigned
'UINT:' => 'INT4 UNSIGNED', 'UINT:' => 'INT4', // unsigned
'USINT' => 'INT2 UNSIGNED', 'USINT' => 'INT2', // unsigned
'BOOL' => 'INT2 UNSIGNED', 'BOOL' => 'INT2', // unsigned
'TINT:' => 'INT2', 'TINT:' => 'INT2',
'VCHAR' => 'varchar(255)', 'VCHAR' => 'varchar(255)',
'VCHAR:' => 'varchar(%d)', 'VCHAR:' => 'varchar(%d)',
@ -143,13 +145,16 @@ $dbms_type_map = array(
'STEXT' => 'varchar(3000)', 'STEXT' => 'varchar(3000)',
'TEXT' => 'varchar(8000)', 'TEXT' => 'varchar(8000)',
'MTEXT' => 'TEXT', 'MTEXT' => 'TEXT',
'TIMESTAMP' => 'INT4 UNSIGNED', 'TIMESTAMP' => 'INT4', // unsigned
'DECIMAL' => 'decimal(5,2)', 'DECIMAL' => 'decimal(5,2)',
'VCHAR_BIN' => 'varchar(252)', 'VCHAR_BIN' => 'varchar(252)',
'VCHAR_CI' => 'varchar_ci', 'VCHAR_CI' => 'varchar_ci',
), ),
); );
// A list of types being unsigned for better reference in some db's
$unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP');
foreach (array('firebird', 'mssql', 'mysql', 'oracle', 'postgres', 'sqlite') as $dbms) foreach (array('firebird', 'mssql', 'mysql', 'oracle', 'postgres', 'sqlite') as $dbms)
{ {
$fp = fopen($schema_path . '_' . $dbms . '_schema.sql', 'wt'); $fp = fopen($schema_path . '_' . $dbms . '_schema.sql', 'wt');
@ -234,12 +239,14 @@ foreach (array('firebird', 'mssql', 'mysql', 'oracle', 'postgres', 'sqlite') as
// Get type // Get type
if (strpos($column_data[0], ':') !== false) if (strpos($column_data[0], ':') !== false)
{ {
list($column_type, $column_length) = explode(':', $column_data[0]); list($orig_column_type, $column_length) = explode(':', $column_data[0]);
$column_type = sprintf($dbms_type_map[$dbms][$column_type . ':'], $column_length); $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'], $column_length);
$orig_column_type .= ':';
} }
else else
{ {
$orig_column_type = $column_data[0];
$column_type = $dbms_type_map[$dbms][$column_data[0]]; $column_type = $dbms_type_map[$dbms][$column_data[0]];
} }
@ -344,7 +351,15 @@ foreach (array('firebird', 'mssql', 'mysql', 'oracle', 'postgres', 'sqlite') as
else else
{ {
$line .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}' " : ''; $line .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}' " : '';
$line .= "NOT NULL,\n"; $line .= "NOT NULL";
// Unsigned? Then add a CHECK contraint
if (in_array($orig_column_type, $unsigned_types))
{
$line .= " CHECK ({$column_name} >= 0)";
}
$line .= ",\n";
} }
break; break;
} }
@ -530,7 +545,7 @@ foreach (array('firebird', 'mssql', 'mysql', 'oracle', 'postgres', 'sqlite') as
break; break;
} }
fwrite($fp, $line); fwrite($fp, $line . "\n");
} }
$line = ''; $line = '';
@ -554,6 +569,7 @@ foreach (array('firebird', 'mssql', 'mysql', 'oracle', 'postgres', 'sqlite') as
break; break;
case 'sqlite': case 'sqlite':
case 'postgres':
$line = "\nCOMMIT;"; $line = "\nCOMMIT;";
break; break;
} }
@ -606,7 +622,7 @@ function get_schema_struct()
'pysical_filename' => array('VCHAR', ''), 'pysical_filename' => array('VCHAR', ''),
'real_filename' => array('VCHAR', ''), 'real_filename' => array('VCHAR', ''),
'download_count' => array('UINT', 0), 'download_count' => array('UINT', 0),
'comment' => array('TEXT', ''), 'attach_comment' => array('TEXT', ''),
'extension' => array('VCHAR:100', ''), 'extension' => array('VCHAR:100', ''),
'mimetype' => array('VCHAR:100', ''), 'mimetype' => array('VCHAR:100', ''),
'filesize' => array('UINT:20', 0), 'filesize' => array('UINT:20', 0),
@ -828,7 +844,7 @@ function get_schema_struct()
'forum_parents' => array('MTEXT', ''), 'forum_parents' => array('MTEXT', ''),
'forum_name' => array('STEXT', ''), 'forum_name' => array('STEXT', ''),
'forum_desc' => array('TEXT', ''), 'forum_desc' => array('TEXT', ''),
'forum_desc_bitfield' => array('UINT:11', ''), 'forum_desc_bitfield' => array('UINT:11', 0),
'forum_desc_uid' => array('VCHAR:5', ''), 'forum_desc_uid' => array('VCHAR:5', ''),
'forum_link' => array('VCHAR', ''), 'forum_link' => array('VCHAR', ''),
'forum_password' => array('VCHAR:40', ''), 'forum_password' => array('VCHAR:40', ''),
@ -992,7 +1008,7 @@ function get_schema_struct()
'module_id' => array('UINT', NULL, 'auto_increment'), 'module_id' => array('UINT', NULL, 'auto_increment'),
'module_enabled' => array('BOOL', 1), 'module_enabled' => array('BOOL', 1),
'module_display' => array('BOOL', 1), 'module_display' => array('BOOL', 1),
'module_name' => array('VCHAR', ''), 'module_basename' => array('VCHAR', ''),
'module_class' => array('VCHAR:10', ''), 'module_class' => array('VCHAR:10', ''),
'parent_id' => array('UINT', 0), 'parent_id' => array('UINT', 0),
'left_id' => array('UINT', 0), 'left_id' => array('UINT', 0),
@ -1143,12 +1159,12 @@ function get_schema_struct()
'msg_id' => array('UINT', 0), 'msg_id' => array('UINT', 0),
'user_id' => array('UINT', 0), 'user_id' => array('UINT', 0),
'author_id' => array('UINT', 0), 'author_id' => array('UINT', 0),
'deleted' => array('BOOL', 0), 'pm_deleted' => array('BOOL', 0),
'new' => array('BOOL', 1), 'pm_new' => array('BOOL', 1),
'unread' => array('BOOL', 1), 'pm_unread' => array('BOOL', 1),
'replied' => array('BOOL', 0), 'pm_replied' => array('BOOL', 0),
'marked' => array('BOOL', 0), 'pm_marked' => array('BOOL', 0),
'forwarded' => array('BOOL', 0), 'pm_forwarded' => array('BOOL', 0),
'folder_id' => array('UINT', 0), 'folder_id' => array('UINT', 0),
), ),
'KEYS' => array( 'KEYS' => array(
@ -1196,7 +1212,7 @@ function get_schema_struct()
'lang_id' => array('UINT', 0), 'lang_id' => array('UINT', 0),
'option_id' => array('UINT', 0), 'option_id' => array('UINT', 0),
'field_type' => array('TINT:4', 0), 'field_type' => array('TINT:4', 0),
'value' => array('VCHAR', ''), 'lang_value' => array('VCHAR', ''),
), ),
'PRIMARY_KEY' => array('field_id', 'lang_id', 'option_id'), 'PRIMARY_KEY' => array('field_id', 'lang_id', 'option_id'),
); );
@ -1836,6 +1852,7 @@ CREATE OPERATOR =(
HASHES, HASHES,
MERGES, MERGES,
SORT1= <); SORT1= <);
EOF; EOF;
} }

View file

@ -1102,7 +1102,7 @@ class acp_attachments
'in_message' => 0, 'in_message' => 0,
'physical_filename' => $filedata['physical_filename'], 'physical_filename' => $filedata['physical_filename'],
'real_filename' => $filedata['real_filename'], 'real_filename' => $filedata['real_filename'],
'comment' => $message_parser->filename_data['filecomment'], 'attach_comment' => $message_parser->filename_data['filecomment'],
'extension' => $filedata['extension'], 'extension' => $filedata['extension'],
'mimetype' => $filedata['mimetype'], 'mimetype' => $filedata['mimetype'],
'filesize' => $filedata['filesize'], 'filesize' => $filedata['filesize'],

View file

@ -144,16 +144,16 @@ class acp_modules
break; break;
} }
list($module_name, $module_mode) = explode('::', $quick_install); list($module_basename, $module_mode) = explode('::', $quick_install);
// Check if module name and mode exist... // Check if module name and mode exist...
$fileinfo = $this->get_module_infos($module_name); $fileinfo = $this->get_module_infos($module_basename);
$fileinfo = $fileinfo[$module_name]; $fileinfo = $fileinfo[$module_basename];
if (isset($fileinfo['modes'][$module_mode])) if (isset($fileinfo['modes'][$module_mode]))
{ {
$module_data = array( $module_data = array(
'module_name' => $module_name, 'module_basename' => $module_basename,
'module_enabled' => 0, 'module_enabled' => 0,
'module_display' => (isset($fileinfo['modes'][$module_mode]['display'])) ? $fileinfo['modes'][$module_mode]['display'] : 1, 'module_display' => (isset($fileinfo['modes'][$module_mode]['display'])) ? $fileinfo['modes'][$module_mode]['display'] : 1,
'parent_id' => $parent_id, 'parent_id' => $parent_id,
@ -202,7 +202,7 @@ class acp_modules
if ($action == 'add') if ($action == 'add')
{ {
$module_row = array( $module_row = array(
'module_name' => '', 'module_basename' => '',
'module_enabled' => 0, 'module_enabled' => 0,
'module_display' => 1, 'module_display' => 1,
'parent_id' => 0, 'parent_id' => 0,
@ -214,7 +214,7 @@ class acp_modules
$module_data = array(); $module_data = array();
$module_data['module_name'] = request_var('module_name', (string) $module_row['module_name']); $module_data['module_basename'] = request_var('module_basename', (string) $module_row['module_basename']);
$module_data['module_enabled'] = request_var('module_enabled', (int) $module_row['module_enabled']); $module_data['module_enabled'] = request_var('module_enabled', (int) $module_row['module_enabled']);
$module_data['module_display'] = request_var('module_display', (int) $module_row['module_display']); $module_data['module_display'] = request_var('module_display', (int) $module_row['module_display']);
$module_data['parent_id'] = request_var('module_parent_id', (int) $module_row['parent_id']); $module_data['parent_id'] = request_var('module_parent_id', (int) $module_row['parent_id']);
@ -235,7 +235,7 @@ class acp_modules
if ($module_type == 'category') if ($module_type == 'category')
{ {
$module_data['module_name'] = $module_data['module_mode'] = $module_data['module_auth'] = ''; $module_data['module_basename'] = $module_data['module_mode'] = $module_data['module_auth'] = '';
$module_data['module_display'] = 1; $module_data['module_display'] = 1;
} }
@ -245,10 +245,10 @@ class acp_modules
} }
// Adjust auth row // Adjust auth row
if ($module_data['module_name'] && $module_data['module_mode']) if ($module_data['module_basename'] && $module_data['module_mode'])
{ {
$fileinfo = $this->get_module_infos($module_data['module_name']); $fileinfo = $this->get_module_infos($module_data['module_basename']);
$module_data['module_auth'] = $fileinfo[$module_data['module_name']]['modes'][$module_data['module_mode']]['auth']; $module_data['module_auth'] = $fileinfo[$module_data['module_basename']]['modes'][$module_data['module_mode']]['auth'];
} }
$errors = $this->update_module_data($module_data); $errors = $this->update_module_data($module_data);
@ -262,7 +262,7 @@ class acp_modules
} }
// Category/not category? // Category/not category?
$is_cat = (!$module_data['module_name']) ? true : false; $is_cat = (!$module_data['module_basename']) ? true : false;
// Get module informations // Get module informations
$module_infos = $this->get_module_infos(); $module_infos = $this->get_module_infos();
@ -271,20 +271,20 @@ class acp_modules
$s_name_options = $s_mode_options = ''; $s_name_options = $s_mode_options = '';
foreach ($module_infos as $option => $values) foreach ($module_infos as $option => $values)
{ {
if (!$module_data['module_name']) if (!$module_data['module_basename'])
{ {
$module_data['module_name'] = $option; $module_data['module_basename'] = $option;
} }
// Name options // Name options
$s_name_options .= '<option value="' . $option . '"' . (($option == $module_data['module_name']) ? ' selected="selected"' : '') . '>' . $this->lang_name($values['title']) . ' [' . $this->module_class . '_' . $option . ']</option>'; $s_name_options .= '<option value="' . $option . '"' . (($option == $module_data['module_basename']) ? ' selected="selected"' : '') . '>' . $this->lang_name($values['title']) . ' [' . $this->module_class . '_' . $option . ']</option>';
$template->assign_block_vars('m_names', array('NAME' => $option)); $template->assign_block_vars('m_names', array('NAME' => $option));
// Build module modes // Build module modes
foreach ($values['modes'] as $m_mode => $m_values) foreach ($values['modes'] as $m_mode => $m_values)
{ {
if ($option == $module_data['module_name']) if ($option == $module_data['module_basename'])
{ {
$s_mode_options .= '<option value="' . $m_mode . '"' . (($m_mode == $module_data['module_mode']) ? ' selected="selected"' : '') . '>' . $this->lang_name($m_values['title']) . '</option>'; $s_mode_options .= '<option value="' . $m_mode . '"' . (($m_mode == $module_data['module_mode']) ? ' selected="selected"' : '') . '>' . $this->lang_name($m_values['title']) . '</option>';
} }
@ -387,7 +387,7 @@ class acp_modules
} }
else else
{ {
$module_image = (!$row['module_name'] || $row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" width="46" height="25" alt="' . $user->lang['CATEGORY'] . '" />' : '<img src="images/icon_folder.gif" width="46" height="25" alt="' . $user->lang['MODULE'] . '" />'; $module_image = (!$row['module_basename'] || $row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" width="46" height="25" alt="' . $user->lang['CATEGORY'] . '" />' : '<img src="images/icon_folder.gif" width="46" height="25" alt="' . $user->lang['MODULE'] . '" />';
} }
$url = $this->u_action . '&amp;parent_id=' . $parent_id . '&amp;m=' . $row['module_id']; $url = $this->u_action . '&amp;parent_id=' . $parent_id . '&amp;m=' . $row['module_id'];
@ -551,22 +551,10 @@ class acp_modules
{ {
global $db, $user, $auth, $config; global $db, $user, $auth, $config;
switch (SQL_LAYER) $sql = 'SELECT module_id, module_enabled, module_basename, parent_id, module_langname, left_id, right_id, module_auth
{ FROM ' . MODULES_TABLE . "
case 'firebird': WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
$sql = 'SELECT module_id, module_enabled, "module_name", parent_id, module_langname, left_id, right_id, module_auth ORDER BY left_id ASC";
FROM ' . MODULES_TABLE . "
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
ORDER BY left_id ASC";
break;
default:
$sql = 'SELECT module_id, module_enabled, module_name, parent_id, module_langname, left_id, right_id, module_auth
FROM ' . MODULES_TABLE . "
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
ORDER BY left_id ASC";
break;
}
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$right = $iteration = 0; $right = $iteration = 0;
@ -607,13 +595,13 @@ class acp_modules
} }
// empty category // empty category
if (!$row['module_name'] && ($row['left_id'] + 1 == $row['right_id']) && $ignore_emptycat) if (!$row['module_basename'] && ($row['left_id'] + 1 == $row['right_id']) && $ignore_emptycat)
{ {
continue; continue;
} }
// ignore non-category? // ignore non-category?
if ($row['module_name'] && $ignore_noncat) if ($row['module_basename'] && $ignore_noncat)
{ {
continue; continue;
} }
@ -777,7 +765,7 @@ class acp_modules
{ {
$row = $this->get_module_row($module_data['module_id']); $row = $this->get_module_row($module_data['module_id']);
if ($module_data['module_name'] && !$row['module_name']) if ($module_data['module_basename'] && !$row['module_basename'])
{ {
// we're turning a category into a module // we're turning a category into a module
$branch = $this->get_module_branch($module_data['module_id'], 'children', 'descending', false); $branch = $this->get_module_branch($module_data['module_id'], 'children', 'descending', false);

View file

@ -59,8 +59,8 @@ class acp_permissions
$subforum_id = request_var('subforum_id', 0); $subforum_id = request_var('subforum_id', 0);
$forum_id = request_var('forum_id', array(0)); $forum_id = request_var('forum_id', array(0));
$username = request_var('username', array(''), true); $username = request_var('username', array(''));
$usernames = request_var('usernames', '', true); $usernames = request_var('usernames', '');
$user_id = request_var('user_id', array(0)); $user_id = request_var('user_id', array(0));
$group_id = request_var('group_id', array(0)); $group_id = request_var('group_id', array(0));

View file

@ -304,7 +304,7 @@ class acp_profile
$lang_options = array(); $lang_options = array();
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
$lang_options[$row['option_id']] = $row['value']; $lang_options[$row['option_id']] = $row['lang_value'];
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@ -486,7 +486,7 @@ class acp_profile
$l_lang_options = array(); $l_lang_options = array();
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
$l_lang_options[$row['lang_id']][$row['option_id']] = $row['value']; $l_lang_options[$row['lang_id']][$row['option_id']] = $row['lang_value'];
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@ -1203,8 +1203,8 @@ class acp_profile
} }
$sql_ary = array( $sql_ary = array(
'lang_name' => $cp->vars['lang_name'], 'lang_name' => $cp->vars['lang_name'],
'lang_explain' => $cp->vars['lang_explain'], 'lang_explain' => $cp->vars['lang_explain'],
'lang_default_value' => $cp->vars['lang_default_value'] 'lang_default_value' => $cp->vars['lang_default_value']
); );
@ -1277,7 +1277,7 @@ class acp_profile
{ {
$sql_ary = array( $sql_ary = array(
'field_type' => (int) $field_type, 'field_type' => (int) $field_type,
'value' => $value 'lang_value' => $value
); );
if ($action == 'create') if ($action == 'create')
@ -1332,7 +1332,7 @@ class acp_profile
'lang_id' => (int) $lang_id, 'lang_id' => (int) $lang_id,
'option_id' => (int) $option_id, 'option_id' => (int) $option_id,
'field_type' => (int) $field_type, 'field_type' => (int) $field_type,
'value' => $value 'lang_value' => $value
); );
} }
} }

View file

@ -214,7 +214,7 @@ class acp_prune
} }
else else
{ {
$username = request_var('username', '', true); $username = request_var('username', '');
$email = request_var('email', ''); $email = request_var('email', '');
$joined_select = request_var('joined_select', 'lt'); $joined_select = request_var('joined_select', 'lt');
@ -317,7 +317,7 @@ class acp_prune
'prune' => 1, 'prune' => 1,
'users' => request_var('users', ''), 'users' => request_var('users', ''),
'username' => request_var('username', '', true), 'username' => request_var('username', ''),
'email' => request_var('email', ''), 'email' => request_var('email', ''),
'joined_select' => request_var('joined_select', ''), 'joined_select' => request_var('joined_select', ''),
'joined' => request_var('joined', ''), 'joined' => request_var('joined', ''),

View file

@ -28,7 +28,7 @@ class acp_users
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
$error = array(); $error = array();
$username = request_var('username', '', true); $username = request_var('username', '');
$user_id = request_var('u', 0); $user_id = request_var('u', 0);
$action = request_var('action', ''); $action = request_var('action', '');
@ -1711,7 +1711,7 @@ class acp_users
$template->assign_block_vars('attach', array( $template->assign_block_vars('attach', array(
'REAL_FILENAME' => $row['real_filename'], 'REAL_FILENAME' => $row['real_filename'],
'COMMENT' => nl2br($row['comment']), 'COMMENT' => nl2br($row['attach_comment']),
'EXTENSION' => $row['extension'], 'EXTENSION' => $row['extension'],
'SIZE' => ($row['filesize'] >= 1048576) ? ($row['filesize'] >> 20) . ' ' . $user->lang['MB'] : (($row['filesize'] >= 1024) ? ($row['filesize'] >> 10) . ' ' . $user->lang['KB'] : $row['filesize'] . ' ' . $user->lang['BYTES']), 'SIZE' => ($row['filesize'] >= 1048576) ? ($row['filesize'] >> 20) . ' ' . $user->lang['MB'] : (($row['filesize'] >= 1024) ? ($row['filesize'] >> 10) . ' ' . $user->lang['KB'] : $row['filesize'] . ' ' . $user->lang['BYTES']),
'DOWNLOAD_COUNT' => $row['download_count'], 'DOWNLOAD_COUNT' => $row['download_count'],

View file

@ -177,8 +177,6 @@ class dbal
* Idea for this from Ikonboard * Idea for this from Ikonboard
* Possible query values: INSERT, INSERT_SELECT, MULTI_INSERT, UPDATE, SELECT * Possible query values: INSERT, INSERT_SELECT, MULTI_INSERT, UPDATE, SELECT
* *
* If a key is 'module_name' and firebird used it gets adjusted to '"module_name"'
* on INSERT, INSERT_SELECT, UPDATE and SELECT
*/ */
function sql_build_array($query, $assoc_ary = false) function sql_build_array($query, $assoc_ary = false)
{ {
@ -193,7 +191,7 @@ class dbal
{ {
foreach ($assoc_ary as $key => $var) foreach ($assoc_ary as $key => $var)
{ {
$fields[] = ($key == 'module_name' && SQL_LAYER == 'firebird') ? '"' . $key . '"' : $key; $fields[] = $key;
if (is_null($var)) if (is_null($var))
{ {
@ -247,8 +245,6 @@ class dbal
$values = array(); $values = array();
foreach ($assoc_ary as $key => $var) foreach ($assoc_ary as $key => $var)
{ {
$key = ($key == 'module_name' && SQL_LAYER == 'firebird') ? '"' . $key . '"' : $key;
if (is_null($var)) if (is_null($var))
{ {
$values[] = "$key = NULL"; $values[] = "$key = NULL";

View file

@ -1526,7 +1526,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
if (isset($_POST['login'])) if (isset($_POST['login']))
{ {
$username = request_var('username', '', true); $username = request_var('username', '');
$password = request_var('password', ''); $password = request_var('password', '');
$autologin = (!empty($_POST['autologin'])) ? true : false; $autologin = (!empty($_POST['autologin'])) ? true : false;
$viewonline = (!empty($_POST['viewonline'])) ? 0 : 1; $viewonline = (!empty($_POST['viewonline'])) ? 0 : 1;

View file

@ -761,7 +761,7 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_
$size_lang = ($filesize >= 1048576) ? $user->lang['MB'] : ( ($filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); $size_lang = ($filesize >= 1048576) ? $user->lang['MB'] : ( ($filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] );
$filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize);
$comment = str_replace("\n", '<br />', censor_text($attachment['comment'])); $comment = str_replace("\n", '<br />', censor_text($attachment['attach_comment']));
$block_array += array( $block_array += array(
'UPLOAD_ICON' => $upload_icon, 'UPLOAD_ICON' => $upload_icon,

View file

@ -86,7 +86,7 @@ class p_master
} }
// Category with no members, ignore // Category with no members, ignore
if (!$row['module_name'] && ($row['left_id'] + 1 == $row['right_id'])) if (!$row['module_basename'] && ($row['left_id'] + 1 == $row['right_id']))
{ {
unset($this->module_cache['modules'][$key]); unset($this->module_cache['modules'][$key]);
continue; continue;
@ -135,7 +135,7 @@ class p_master
} }
// Category with no members on their way down (we have to check every level) // Category with no members on their way down (we have to check every level)
if (!$row['module_name']) if (!$row['module_basename'])
{ {
$empty_category = true; $empty_category = true;
@ -145,7 +145,7 @@ class p_master
if ($temp_row['left_id'] > $row['left_id'] && $temp_row['left_id'] < $row['right_id']) if ($temp_row['left_id'] > $row['left_id'] && $temp_row['left_id'] < $row['right_id'])
{ {
// Module there // Module there
if ($temp_row['module_name'] && $temp_row['module_enabled']) if ($temp_row['module_basename'] && $temp_row['module_enabled'])
{ {
$empty_category = false; $empty_category = false;
break; break;
@ -168,15 +168,15 @@ class p_master
// We need to prefix the functions to not create a naming conflict // We need to prefix the functions to not create a naming conflict
// Function for building 'url_extra' // Function for building 'url_extra'
$url_func = '_module_' . $row['module_name'] . '_url'; $url_func = '_module_' . $row['module_basename'] . '_url';
// Function for building the language name // Function for building the language name
$lang_func = '_module_' . $row['module_name'] . '_lang'; $lang_func = '_module_' . $row['module_basename'] . '_lang';
// Custom function for calling parameters on module init (for example assigning template variables) // Custom function for calling parameters on module init (for example assigning template variables)
$custom_func = '_module_' . $row['module_name']; $custom_func = '_module_' . $row['module_basename'];
$names[$row['module_name'] . '_' . $row['module_mode']][] = true; $names[$row['module_basename'] . '_' . $row['module_mode']][] = true;
$module_row = array( $module_row = array(
'depth' => $depth, 'depth' => $depth,
@ -185,15 +185,15 @@ class p_master
'parent' => (int) $row['parent_id'], 'parent' => (int) $row['parent_id'],
'cat' => ($row['right_id'] > $row['left_id'] + 1) ? true : false, 'cat' => ($row['right_id'] > $row['left_id'] + 1) ? true : false,
'is_duplicate' => ($row['module_name'] && sizeof($names[$row['module_name'] . '_' . $row['module_mode']]) > 1) ? true : false, 'is_duplicate' => ($row['module_basename'] && sizeof($names[$row['module_basename'] . '_' . $row['module_mode']]) > 1) ? true : false,
'name' => (string) $row['module_name'], 'name' => (string) $row['module_basename'],
'mode' => (string) $row['module_mode'], 'mode' => (string) $row['module_mode'],
'display' => (int) $row['module_display'], 'display' => (int) $row['module_display'],
'url_extra' => (function_exists($url_func)) ? $url_func($row['module_mode']) : '', 'url_extra' => (function_exists($url_func)) ? $url_func($row['module_mode']) : '',
'lang' => ($row['module_name'] && function_exists($lang_func)) ? $lang_func($row['module_mode'], $row['module_langname']) : ((!empty($user->lang[$row['module_langname']])) ? $user->lang[$row['module_langname']] : $row['module_langname']), 'lang' => ($row['module_basename'] && function_exists($lang_func)) ? $lang_func($row['module_mode'], $row['module_langname']) : ((!empty($user->lang[$row['module_langname']])) ? $user->lang[$row['module_langname']] : $row['module_langname']),
'langname' => $row['module_langname'], 'langname' => $row['module_langname'],
'left' => $row['left_id'], 'left' => $row['left_id'],

View file

@ -676,7 +676,7 @@ function posting_gen_attachment_entry(&$attachment_data, &$filename_data)
$template->assign_block_vars('attach_row', array( $template->assign_block_vars('attach_row', array(
'FILENAME' => basename($attach_row['real_filename']), 'FILENAME' => basename($attach_row['real_filename']),
'ATTACH_FILENAME' => basename($attach_row['physical_filename']), 'ATTACH_FILENAME' => basename($attach_row['physical_filename']),
'FILE_COMMENT' => $attach_row['comment'], 'FILE_COMMENT' => $attach_row['attach_comment'],
'ATTACH_ID' => $attach_row['attach_id'], 'ATTACH_ID' => $attach_row['attach_id'],
'ASSOC_INDEX' => $count, 'ASSOC_INDEX' => $count,
@ -1705,7 +1705,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
{ {
// update entry in db if attachment already stored in db and filespace // update entry in db if attachment already stored in db and filespace
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . " $sql = 'UPDATE ' . ATTACHMENTS_TABLE . "
SET comment = '" . $db->sql_escape($attach_row['comment']) . "' SET attach_comment = '" . $db->sql_escape($attach_row['attach_comment']) . "'
WHERE attach_id = " . (int) $attach_row['attach_id']; WHERE attach_id = " . (int) $attach_row['attach_id'];
$db->sql_query($sql); $db->sql_query($sql);
} }
@ -1724,7 +1724,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
'poster_id' => $poster_id, 'poster_id' => $poster_id,
'physical_filename' => basename($attach_row['physical_filename']), 'physical_filename' => basename($attach_row['physical_filename']),
'real_filename' => basename($attach_row['real_filename']), 'real_filename' => basename($attach_row['real_filename']),
'comment' => $attach_row['comment'], 'attach_comment' => $attach_row['attach_comment'],
'extension' => $attach_row['extension'], 'extension' => $attach_row['extension'],
'mimetype' => $attach_row['mimetype'], 'mimetype' => $attach_row['mimetype'],
'filesize' => $attach_row['filesize'], 'filesize' => $attach_row['filesize'],

View file

@ -86,8 +86,8 @@ $global_privmsgs_rules = array(
), ),
CHECK_STATUS => array( CHECK_STATUS => array(
RULE_ANSWERED => array('check0' => 'replied', 'function' => '{CHECK0} == 1'), RULE_ANSWERED => array('check0' => 'pm_replied', 'function' => '{CHECK0} == 1'),
RULE_FORWARDED => array('check0' => 'forwarded', 'function' => '{CHECK0} == 1'), RULE_FORWARDED => array('check0' => 'pm_forwarded', 'function' => '{CHECK0} == 1'),
), ),
CHECK_TO => array( CHECK_TO => array(
@ -121,7 +121,7 @@ function get_folder($user_id, $folder_id = false)
$folder = array(); $folder = array();
// Get folder informations // Get folder informations
$sql = 'SELECT folder_id, COUNT(msg_id) as num_messages, SUM(unread) as num_unread $sql = 'SELECT folder_id, COUNT(msg_id) as num_messages, SUM(pm_unread) as num_unread
FROM ' . PRIVMSGS_TO_TABLE . " FROM ' . PRIVMSGS_TO_TABLE . "
WHERE user_id = $user_id WHERE user_id = $user_id
AND folder_id <> " . PRIVMSGS_NO_BOX . ' AND folder_id <> " . PRIVMSGS_NO_BOX . '
@ -280,7 +280,7 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id)
case ACTION_MARK_AS_READ: case ACTION_MARK_AS_READ:
case ACTION_MARK_AS_IMPORTANT: case ACTION_MARK_AS_IMPORTANT:
case ACTION_DELETE_MESSAGE: case ACTION_DELETE_MESSAGE:
return array('action' => $rule_row['rule_action'], 'unread' => $message_row['unread'], 'marked' => $message_row['marked']); return array('action' => $rule_row['rule_action'], 'pm_unread' => $message_row['pm_unread'], 'pm_marked' => $message_row['pm_marked']);
break; break;
default: default:
@ -454,7 +454,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
break; break;
case ACTION_MARK_AS_READ: case ACTION_MARK_AS_READ:
if ($rule_ary['unread']) if ($rule_ary['pm_unread'])
{ {
$unread_ids[] = $msg_id; $unread_ids[] = $msg_id;
} }
@ -466,7 +466,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
break; break;
case ACTION_MARK_AS_IMPORTANT: case ACTION_MARK_AS_IMPORTANT:
if (!$rule_ary['marked']) if (!$rule_ary['pm_marked'])
{ {
$important_ids[] = $msg_id; $important_ids[] = $msg_id;
} }
@ -495,7 +495,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
if (sizeof($unread_ids)) if (sizeof($unread_ids))
{ {
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . '
SET unread = 0 SET pm_unread = 0
WHERE msg_id IN (' . implode(', ', $unread_ids) . ") WHERE msg_id IN (' . implode(', ', $unread_ids) . ")
AND user_id = $user_id AND user_id = $user_id
AND folder_id = " . PRIVMSGS_NO_BOX; AND folder_id = " . PRIVMSGS_NO_BOX;
@ -506,7 +506,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
if (sizeof($important_ids)) if (sizeof($important_ids))
{ {
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . '
SET marked = !marked SET pm_marked = !pm_marked
WHERE folder_id = ' . PRIVMSGS_NO_BOX . " WHERE folder_id = ' . PRIVMSGS_NO_BOX . "
AND user_id = $user_id AND user_id = $user_id
AND msg_id IN (" . implode(', ', $important_ids) . ')'; AND msg_id IN (" . implode(', ', $important_ids) . ')';
@ -520,7 +520,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
{ {
// Determine Full Folder Action - we need the move to folder id later eventually // Determine Full Folder Action - we need the move to folder id later eventually
$full_folder_action = ($user->data['user_full_folder'] == FULL_FOLDER_NONE) ? ($config['full_folder_action'] - (FULL_FOLDER_NONE*(-1))) : $user->data['user_full_folder']; $full_folder_action = ($user->data['user_full_folder'] == FULL_FOLDER_NONE) ? ($config['full_folder_action'] - (FULL_FOLDER_NONE*(-1))) : $user->data['user_full_folder'];
$sql = 'SELECT folder_id, pm_count $sql = 'SELECT folder_id, pm_count
FROM ' . PRIVMSGS_FOLDER_TABLE . ' FROM ' . PRIVMSGS_FOLDER_TABLE . '
WHERE folder_id IN (' . implode(', ', array_keys($move_into_folder)) . (($full_folder_action >= 0) ? ', ' . $full_folder_action : '') . ") WHERE folder_id IN (' . implode(', ', array_keys($move_into_folder)) . (($full_folder_action >= 0) ? ', ' . $full_folder_action : '') . ")
@ -586,6 +586,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
$delete_ids[] = $row['msg_id']; $delete_ids[] = $row['msg_id'];
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
delete_pm($user_id, $delete_ids, $dest_folder); delete_pm($user_id, $delete_ids, $dest_folder);
} }
} }
@ -594,6 +595,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
if ($full_folder_action == FULL_FOLDER_HOLD) if ($full_folder_action == FULL_FOLDER_HOLD)
{ {
$num_not_moved += sizeof($msg_ary); $num_not_moved += sizeof($msg_ary);
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . '
SET folder_id = ' . PRIVMSGS_HOLD_BOX . ' SET folder_id = ' . PRIVMSGS_HOLD_BOX . '
WHERE folder_id = ' . PRIVMSGS_NO_BOX . " WHERE folder_id = ' . PRIVMSGS_NO_BOX . "
@ -604,10 +606,10 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
else else
{ {
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . " $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . "
SET folder_id = $dest_folder, new = 0 SET folder_id = $dest_folder, pm_new = 0
WHERE folder_id = " . PRIVMSGS_NO_BOX . " WHERE folder_id = " . PRIVMSGS_NO_BOX . "
AND user_id = $user_id AND user_id = $user_id
AND new = 1 AND pm_new = 1
AND msg_id IN (" . implode(', ', $msg_ary) . ')'; AND msg_id IN (" . implode(', ', $msg_ary) . ')';
$db->sql_query($sql); $db->sql_query($sql);
@ -761,7 +763,7 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id)
global $db; global $db;
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . " $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . "
SET unread = 0 SET pm_unread = 0
WHERE msg_id = $msg_id WHERE msg_id = $msg_id
AND user_id = $user_id AND user_id = $user_id
AND folder_id = $folder_id"; AND folder_id = $folder_id";
@ -794,7 +796,7 @@ function handle_mark_actions($user_id, $mark_action)
case 'mark_important': case 'mark_important':
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . " $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . "
SET marked = !marked SET pm_marked = !pm_marked
WHERE folder_id = $cur_folder_id WHERE folder_id = $cur_folder_id
AND user_id = $user_id AND user_id = $user_id
AND msg_id IN (" . implode(', ', $msg_ids) . ')'; AND msg_id IN (" . implode(', ', $msg_ids) . ')';
@ -865,7 +867,7 @@ function delete_pm($user_id, $msg_ids, $folder_id)
} }
// Get PM Informations for later deleting // Get PM Informations for later deleting
$sql = 'SELECT msg_id, unread, new $sql = 'SELECT msg_id, pm_unread, pm_new
FROM ' . PRIVMSGS_TO_TABLE . ' FROM ' . PRIVMSGS_TO_TABLE . '
WHERE msg_id IN (' . implode(', ', array_map('intval', $msg_ids)) . ") WHERE msg_id IN (' . implode(', ', array_map('intval', $msg_ids)) . ")
AND folder_id = $folder_id AND folder_id = $folder_id
@ -876,8 +878,8 @@ function delete_pm($user_id, $msg_ids, $folder_id)
$num_unread = $num_new = $num_deleted = 0; $num_unread = $num_new = $num_deleted = 0;
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
$num_unread += (int) $row['unread']; $num_unread += (int) $row['pm_unread'];
$num_new += (int) $row['new']; $num_new += (int) $row['pm_new'];
$delete_rows[$row['msg_id']] = 1; $delete_rows[$row['msg_id']] = 1;
} }
@ -907,7 +909,7 @@ function delete_pm($user_id, $msg_ids, $folder_id)
// Set delete flag for those intended to receive the PM // Set delete flag for those intended to receive the PM
// We do not remove the message actually, to retain some basic informations (sent time for example) // We do not remove the message actually, to retain some basic informations (sent time for example)
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . '
SET deleted = 1 SET pm_deleted = 1
WHERE msg_id IN (' . implode(', ', array_keys($delete_rows)) . ')'; WHERE msg_id IN (' . implode(', ', array_keys($delete_rows)) . ')';
$db->sql_query($sql); $db->sql_query($sql);
@ -1250,7 +1252,7 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr
// Set message_replied switch for this user // Set message_replied switch for this user
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . '
SET replied = 1 SET pm_replied = 1
WHERE user_id = ' . $data['from_user_id'] . ' WHERE user_id = ' . $data['from_user_id'] . '
AND msg_id = ' . $data['reply_from_msg_id']; AND msg_id = ' . $data['reply_from_msg_id'];
@ -1328,13 +1330,13 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr
foreach ($recipients as $user_id => $type) foreach ($recipients as $user_id => $type)
{ {
$sql_ary[] = array( $sql_ary[] = array(
'msg_id' => (int) $data['msg_id'], 'msg_id' => (int) $data['msg_id'],
'user_id' => (int) $user_id, 'user_id' => (int) $user_id,
'author_id' => (int) $data['from_user_id'], 'author_id' => (int) $data['from_user_id'],
'folder_id' => PRIVMSGS_NO_BOX, 'folder_id' => PRIVMSGS_NO_BOX,
'new' => 1, 'pm_new' => 1,
'unread' => 1, 'pm_unread' => 1,
'forwarded' => ($mode == 'forward') ? 1 : 0 'pm_forwarded' => ($mode == 'forward') ? 1 : 0
); );
} }
@ -1366,13 +1368,13 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr
if ($put_in_outbox) if ($put_in_outbox)
{ {
$db->sql_query('INSERT INTO ' . PRIVMSGS_TO_TABLE . ' ' . $db->sql_build_array('INSERT', array( $db->sql_query('INSERT INTO ' . PRIVMSGS_TO_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'msg_id' => (int) $data['msg_id'], 'msg_id' => (int) $data['msg_id'],
'user_id' => (int) $data['from_user_id'], 'user_id' => (int) $data['from_user_id'],
'author_id' => (int) $data['from_user_id'], 'author_id' => (int) $data['from_user_id'],
'folder_id' => PRIVMSGS_OUTBOX, 'folder_id' => PRIVMSGS_OUTBOX,
'new' => 0, 'pm_new' => 0,
'unread' => 0, 'pm_unread' => 0,
'forwarded' => ($mode == 'forward') ? 1 : 0)) 'pm_forwarded' => ($mode == 'forward') ? 1 : 0))
); );
} }
@ -1401,7 +1403,7 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr
{ {
// update entry in db if attachment already stored in db and filespace // update entry in db if attachment already stored in db and filespace
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . " $sql = 'UPDATE ' . ATTACHMENTS_TABLE . "
SET comment = '" . $db->sql_escape($attach_row['comment']) . "' SET attach_comment = '" . $db->sql_escape($attach_row['attach_comment']) . "'
WHERE attach_id = " . (int) $attach_row['attach_id']; WHERE attach_id = " . (int) $attach_row['attach_id'];
$db->sql_query($sql); $db->sql_query($sql);
} }
@ -1415,7 +1417,7 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr
'poster_id' => $data['from_user_id'], 'poster_id' => $data['from_user_id'],
'physical_filename' => basename($attach_row['physical_filename']), 'physical_filename' => basename($attach_row['physical_filename']),
'real_filename' => basename($attach_row['real_filename']), 'real_filename' => basename($attach_row['real_filename']),
'comment' => $attach_row['comment'], 'attach_comment' => $attach_row['attach_comment'],
'extension' => $attach_row['extension'], 'extension' => $attach_row['extension'],
'mimetype' => $attach_row['mimetype'], 'mimetype' => $attach_row['mimetype'],
'filesize' => $attach_row['filesize'], 'filesize' => $attach_row['filesize'],

View file

@ -230,7 +230,7 @@ class custom_profile
} }
else else
{ {
$sql = 'SELECT option_id, value $sql = 'SELECT option_id, lang_value
FROM ' . PROFILE_FIELDS_LANG_TABLE . " FROM ' . PROFILE_FIELDS_LANG_TABLE . "
WHERE field_id = $field_id WHERE field_id = $field_id
AND lang_id = $lang_id AND lang_id = $lang_id
@ -240,7 +240,7 @@ class custom_profile
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
$this->options_lang[$field_id][$lang_id][($row['option_id'] + 1)] = $row['value']; $this->options_lang[$field_id][$lang_id][($row['option_id'] + 1)] = $row['lang_value'];
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
} }

View file

@ -918,7 +918,7 @@ function mcp_fork_topic($topic_ids)
'physical_filename' => (string) basename($attach_row['physical_filename']), 'physical_filename' => (string) basename($attach_row['physical_filename']),
'real_filename' => (string) basename($attach_row['real_filename']), 'real_filename' => (string) basename($attach_row['real_filename']),
'download_count' => (int) $attach_row['download_count'], 'download_count' => (int) $attach_row['download_count'],
'comment' => (string) $attach_row['comment'], 'attach_comment' => (string) $attach_row['attach_comment'],
'extension' => (string) $attach_row['extension'], 'extension' => (string) $attach_row['extension'],
'mimetype' => (string) $attach_row['mimetype'], 'mimetype' => (string) $attach_row['mimetype'],
'filesize' => (int) $attach_row['filesize'], 'filesize' => (int) $attach_row['filesize'],

View file

@ -68,7 +68,7 @@ class mcp_notes
global $template, $db, $user, $auth; global $template, $db, $user, $auth;
$user_id = request_var('u', 0); $user_id = request_var('u', 0);
$username = request_var('username', '', true); $username = request_var('username', '');
$start = request_var('start', 0); $start = request_var('start', 0);
$st = request_var('st', 0); $st = request_var('st', 0);
$sk = request_var('sk', 'b'); $sk = request_var('sk', 'b');

View file

@ -59,7 +59,7 @@ function mcp_post_details($id, $mode, $action)
if ($action == 'chgposter') if ($action == 'chgposter')
{ {
$username = request_var('username', '', true); $username = request_var('username', '');
$sql_where = "username = '" . $db->sql_escape($username) . "'"; $sql_where = "username = '" . $db->sql_escape($username) . "'";
} }
else else

View file

@ -309,7 +309,7 @@ function mcp_warn_user_view($id, $mode, $action)
global $template, $db, $user, $auth; global $template, $db, $user, $auth;
$user_id = request_var('u', 0); $user_id = request_var('u', 0);
$username = request_var('username', '', true); $username = request_var('username', '');
$notify = (isset($_REQUEST['notify_user'])) ? true : false; $notify = (isset($_REQUEST['notify_user'])) ? true : false;
$warning = request_var('warning', '', true); $warning = request_var('warning', '', true);

View file

@ -1148,7 +1148,7 @@ class parse_message extends bbcode_firstpass
{ {
$new_entry = array( $new_entry = array(
'physical_filename' => $filedata['physical_filename'], 'physical_filename' => $filedata['physical_filename'],
'comment' => $this->filename_data['filecomment'], 'attach_comment' => $this->filename_data['filecomment'],
'real_filename' => $filedata['real_filename'], 'real_filename' => $filedata['real_filename'],
'extension' => $filedata['extension'], 'extension' => $filedata['extension'],
'mimetype' => $filedata['mimetype'], 'mimetype' => $filedata['mimetype'],
@ -1218,7 +1218,7 @@ class parse_message extends bbcode_firstpass
$edit_comment = request_var('edit_comment', array(0 => '')); $edit_comment = request_var('edit_comment', array(0 => ''));
$edit_comment = key($edit_comment); $edit_comment = key($edit_comment);
$this->attachment_data[$edit_comment]['comment'] = $actual_comment_list[$edit_comment]; $this->attachment_data[$edit_comment]['attach_comment'] = $actual_comment_list[$edit_comment];
} }
if (($add_file || $preview) && $upload_file) if (($add_file || $preview) && $upload_file)
@ -1232,7 +1232,7 @@ class parse_message extends bbcode_firstpass
{ {
$new_entry = array( $new_entry = array(
'physical_filename' => $filedata['physical_filename'], 'physical_filename' => $filedata['physical_filename'],
'comment' => $this->filename_data['filecomment'], 'attach_comment' => $this->filename_data['filecomment'],
'real_filename' => $filedata['real_filename'], 'real_filename' => $filedata['real_filename'],
'extension' => $filedata['extension'], 'extension' => $filedata['extension'],
'mimetype' => $filedata['mimetype'], 'mimetype' => $filedata['mimetype'],
@ -1308,7 +1308,7 @@ class parse_message extends bbcode_firstpass
{ {
$pos = $attach_ids[$row['attach_id']]; $pos = $attach_ids[$row['attach_id']];
$this->attachment_data[$pos] = $row; $this->attachment_data[$pos] = $row;
set_var($this->attachment_data[$pos]['comment'], $_POST['attachment_data'][$pos]['comment'], 'string', true); set_var($this->attachment_data[$pos]['attach_comment'], $_POST['attachment_data'][$pos]['attach_comment'], 'string', true);
unset($attach_ids[$row['attach_id']]); unset($attach_ids[$row['attach_id']]);
} }
@ -1348,7 +1348,7 @@ class parse_message extends bbcode_firstpass
'thumbnail' => (file_exists($phpbb_root_path . $config['upload_path'] . '/thumb_' . $physical_filename)) ? 1 : 0, 'thumbnail' => (file_exists($phpbb_root_path . $config['upload_path'] . '/thumb_' . $physical_filename)) ? 1 : 0,
); );
set_var($this->attachment_data[$pos]['comment'], $_POST['attachment_data'][$pos]['comment'], 'string', true); set_var($this->attachment_data[$pos]['attach_comment'], $_POST['attachment_data'][$pos]['attach_comment'], 'string', true);
set_var($this->attachment_data[$pos]['real_filename'], $_POST['attachment_data'][$pos]['real_filename'], 'string', true); set_var($this->attachment_data[$pos]['real_filename'], $_POST['attachment_data'][$pos]['real_filename'], 'string', true);
set_var($this->attachment_data[$pos]['filetime'], $_POST['attachment_data'][$pos]['filetime'], 'int'); set_var($this->attachment_data[$pos]['filetime'], $_POST['attachment_data'][$pos]['filetime'], 'int');

View file

@ -60,7 +60,7 @@ class ucp_attachments
// Select box eventually // Select box eventually
$sort_key_text = array('a' => $user->lang['SORT_FILENAME'], 'b' => $user->lang['SORT_COMMENT'], 'c' => $user->lang['SORT_EXTENSION'], 'd' => $user->lang['SORT_SIZE'], 'e' => $user->lang['SORT_DOWNLOADS'], 'f' => $user->lang['SORT_POST_TIME'], 'g' => $user->lang['SORT_TOPIC_TITLE']); $sort_key_text = array('a' => $user->lang['SORT_FILENAME'], 'b' => $user->lang['SORT_COMMENT'], 'c' => $user->lang['SORT_EXTENSION'], 'd' => $user->lang['SORT_SIZE'], 'e' => $user->lang['SORT_DOWNLOADS'], 'f' => $user->lang['SORT_POST_TIME'], 'g' => $user->lang['SORT_TOPIC_TITLE']);
$sort_key_sql = array('a' => 'a.real_filename', 'b' => 'a.comment', 'c' => 'a.extension', 'd' => 'a.filesize', 'e' => 'a.download_count', 'f' => 'a.filetime', 'g' => 't.topic_title'); $sort_key_sql = array('a' => 'a.real_filename', 'b' => 'a.attach_comment', 'c' => 'a.extension', 'd' => 'a.filesize', 'e' => 'a.download_count', 'f' => 'a.filetime', 'g' => 't.topic_title');
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
@ -114,7 +114,7 @@ class ucp_attachments
$template->assign_block_vars('attachrow', array( $template->assign_block_vars('attachrow', array(
'ROW_NUMBER' => $row_count + ($start + 1), 'ROW_NUMBER' => $row_count + ($start + 1),
'FILENAME' => $row['real_filename'], 'FILENAME' => $row['real_filename'],
'COMMENT' => str_replace("\n", '<br />', $row['comment']), 'COMMENT' => str_replace("\n", '<br />', $row['attach_comment']),
'EXTENSION' => $row['extension'], 'EXTENSION' => $row['extension'],
'SIZE' => ($row['filesize'] >= 1048576) ? ($row['filesize'] >> 20) . ' ' . $user->lang['MB'] : (($row['filesize'] >= 1024) ? ($row['filesize'] >> 10) . ' ' . $user->lang['KB'] : $row['filesize'] . ' ' . $user->lang['BYTES']), 'SIZE' => ($row['filesize'] >= 1048576) ? ($row['filesize'] >> 20) . ' ' . $user->lang['MB'] : (($row['filesize'] >= 1024) ? ($row['filesize'] >> 10) . ' ' . $user->lang['KB'] : $row['filesize'] . ' ' . $user->lang['BYTES']),
'DOWNLOAD_COUNT' => $row['download_count'], 'DOWNLOAD_COUNT' => $row['download_count'],

View file

@ -318,7 +318,7 @@ class ucp_pm
} }
// Update unread status // Update unread status
update_unread_status($message_row['unread'], $message_row['msg_id'], $user->data['user_id'], $folder_id); update_unread_status($message_row['pm_unread'], $message_row['msg_id'], $user->data['user_id'], $folder_id);
} }
$folder = get_folder($user->data['user_id'], $folder_id); $folder = get_folder($user->data['user_id'], $folder_id);

View file

@ -138,7 +138,7 @@ function compose_pm($id, $mode, $action)
trigger_error('NO_MESSAGE'); trigger_error('NO_MESSAGE');
} }
$sql = 'SELECT msg_id, unread, new, author_id, folder_id $sql = 'SELECT msg_id, pm_unread, pm_new, author_id, folder_id
FROM ' . PRIVMSGS_TO_TABLE . ' FROM ' . PRIVMSGS_TO_TABLE . '
WHERE user_id = ' . $user->data['user_id'] . " WHERE user_id = ' . $user->data['user_id'] . "
AND msg_id = $msg_id"; AND msg_id = $msg_id";
@ -311,7 +311,7 @@ function compose_pm($id, $mode, $action)
if ($message_attachment && !$submit && !$refresh && !$preview && $action == 'edit') if ($message_attachment && !$submit && !$refresh && !$preview && $action == 'edit')
{ {
$sql = 'SELECT attach_id, physical_filename, comment, real_filename, extension, mimetype, filesize, filetime, thumbnail $sql = 'SELECT attach_id, physical_filename, attach_comment, real_filename, extension, mimetype, filesize, filetime, thumbnail
FROM ' . ATTACHMENTS_TABLE . " FROM ' . ATTACHMENTS_TABLE . "
WHERE post_msg_id = $msg_id WHERE post_msg_id = $msg_id
AND in_message = 1 AND in_message = 1
@ -868,8 +868,8 @@ function handle_message_list_actions(&$address_list, $remove_u, $remove_g, $add_
$user_id_ary = array(); $user_id_ary = array();
// Build usernames to add // Build usernames to add
$usernames = (isset($_REQUEST['username'])) ? array(request_var('username', '', true)) : array(); $usernames = (isset($_REQUEST['username'])) ? array(request_var('username', '')) : array();
$username_list = request_var('username_list', '', true); $username_list = request_var('username_list', '');
if ($username_list) if ($username_list)
{ {
$usernames = array_merge($usernames, explode("\n", $username_list)); $usernames = array_merge($usernames, explode("\n", $username_list));

View file

@ -189,7 +189,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'SIGNATURE' => ($message_row['enable_sig']) ? $signature : '', 'SIGNATURE' => ($message_row['enable_sig']) ? $signature : '',
'EDITED_MESSAGE' => $l_edited_by, 'EDITED_MESSAGE' => $l_edited_by,
'U_INFO' => ($auth->acl_get('m_info') && $message_row['forwarded']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'mode=pm_details&amp;p=' . $message_row['msg_id'], true, $user->session_id) : '', 'U_INFO' => ($auth->acl_get('m_info') && $message_row['pm_forwarded']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'mode=pm_details&amp;p=' . $message_row['msg_id'], true, $user->session_id) : '',
'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&amp;mode=compose&amp;action=delete&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '', 'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&amp;mode=compose&amp;action=delete&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
'U_AUTHOR_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $author_id), 'U_AUTHOR_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $author_id),
'U_EMAIL' => $user_info['email'], 'U_EMAIL' => $user_info['email'],

View file

@ -22,7 +22,7 @@ class ucp_remind
global $config, $phpbb_root_path, $phpEx; global $config, $phpbb_root_path, $phpEx;
global $db, $user, $auth, $template; global $db, $user, $auth, $template;
$username = request_var('username', '', true); $username = request_var('username', '');
$email = request_var('email', ''); $email = request_var('email', '');
$submit = (isset($_POST['submit'])) ? true : false; $submit = (isset($_POST['submit'])) ? true : false;

View file

@ -22,7 +22,7 @@ class ucp_resend
global $config, $phpbb_root_path, $phpEx; global $config, $phpbb_root_path, $phpEx;
global $db, $user, $auth, $template; global $db, $user, $auth, $template;
$username = request_var('username', '', true); $username = request_var('username', '');
$email = request_var('email', ''); $email = request_var('email', '');
$submit = (isset($_POST['submit'])) ? true : false; $submit = (isset($_POST['submit'])) ? true : false;

View file

@ -1006,10 +1006,6 @@ class install_install extends module
case 'postgres': case 'postgres':
$sql_query = preg_replace('#\# POSTGRES (BEGIN|COMMIT) \##s', '\1; ', $sql_query); $sql_query = preg_replace('#\# POSTGRES (BEGIN|COMMIT) \##s', '\1; ', $sql_query);
break; break;
case 'firebird':
$sql_query = str_replace('module_name', '"module_name"', $sql_query);
break;
} }
$sql_query = preg_replace('#phpbb_#i', $table_prefix, $sql_query); $sql_query = preg_replace('#phpbb_#i', $table_prefix, $sql_query);
@ -1224,7 +1220,7 @@ class install_install extends module
foreach ($this->module_categories[$module_class] as $cat_name => $subs) foreach ($this->module_categories[$module_class] as $cat_name => $subs)
{ {
$module_data = array( $module_data = array(
'module_name' => '', 'module_basename' => '',
'module_enabled' => 1, 'module_enabled' => 1,
'module_display' => 1, 'module_display' => 1,
'parent_id' => 0, 'parent_id' => 0,
@ -1253,7 +1249,7 @@ class install_install extends module
foreach ($subs as $level2_name) foreach ($subs as $level2_name)
{ {
$module_data = array( $module_data = array(
'module_name' => '', 'module_basename' => '',
'module_enabled' => 1, 'module_enabled' => 1,
'module_display' => 1, 'module_display' => 1,
'parent_id' => $categories[$cat_name]['id'], 'parent_id' => $categories[$cat_name]['id'],
@ -1281,14 +1277,14 @@ class install_install extends module
// Get the modules we want to add... returned sorted by name // Get the modules we want to add... returned sorted by name
$module_info = $_module->get_module_infos('', $module_class); $module_info = $_module->get_module_infos('', $module_class);
foreach ($module_info as $module_name => $fileinfo) foreach ($module_info as $module_basename => $fileinfo)
{ {
foreach ($fileinfo['modes'] as $module_mode => $row) foreach ($fileinfo['modes'] as $module_mode => $row)
{ {
foreach ($row['cat'] as $cat_name) foreach ($row['cat'] as $cat_name)
{ {
$module_data = array( $module_data = array(
'module_name' => $module_name, 'module_basename' => $module_basename,
'module_enabled' => 1, 'module_enabled' => 1,
'module_display' => (isset($row['display'])) ? $row['display'] : 1, 'module_display' => (isset($row['display'])) ? $row['display'] : 1,
'parent_id' => $categories[$cat_name]['id'], 'parent_id' => $categories[$cat_name]['id'],
@ -1316,7 +1312,7 @@ class install_install extends module
// Move main module 4 up... // Move main module 4 up...
$sql = 'SELECT * $sql = 'SELECT *
FROM ' . MODULES_TABLE . " FROM ' . MODULES_TABLE . "
WHERE module_name = 'main' WHERE module_basename = 'main'
AND module_class = 'acp' AND module_class = 'acp'
AND module_mode = 'main'"; AND module_mode = 'main'";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@ -1328,7 +1324,7 @@ class install_install extends module
// Move permissions intro screen module 4 up... // Move permissions intro screen module 4 up...
$sql = 'SELECT * $sql = 'SELECT *
FROM ' . MODULES_TABLE . " FROM ' . MODULES_TABLE . "
WHERE module_name = 'permissions' WHERE module_basename = 'permissions'
AND module_class = 'acp' AND module_class = 'acp'
AND module_mode = 'intro'"; AND module_mode = 'intro'";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@ -1340,7 +1336,7 @@ class install_install extends module
// Move manage users screen module 4 up... // Move manage users screen module 4 up...
$sql = 'SELECT * $sql = 'SELECT *
FROM ' . MODULES_TABLE . " FROM ' . MODULES_TABLE . "
WHERE module_name = 'users' WHERE module_basename = 'users'
AND module_class = 'acp' AND module_class = 'acp'
AND module_mode = 'overview'"; AND module_mode = 'overview'";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@ -1370,7 +1366,7 @@ class install_install extends module
FROM ' . MODULES_TABLE . " FROM ' . MODULES_TABLE . "
WHERE module_langname = '" . $db->sql_escape($mod_name) . "' WHERE module_langname = '" . $db->sql_escape($mod_name) . "'
AND module_class = '" . $db->sql_escape($module_class) . "' AND module_class = '" . $db->sql_escape($module_class) . "'
AND module_name <> ''"; AND module_basename <> ''";
$result = $db->sql_query_limit($sql, 1); $result = $db->sql_query_limit($sql, 1);
$module_data = $db->sql_fetchrow($result); $module_data = $db->sql_fetchrow($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -53,7 +53,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', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('browser_check', '1');
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');

File diff suppressed because it is too large Load diff

View file

@ -72,7 +72,7 @@ $post_id = request_var('p', 0);
$topic_id = request_var('t', 0); $topic_id = request_var('t', 0);
$forum_id = request_var('f', 0); $forum_id = request_var('f', 0);
$user_id = request_var('u', 0); $user_id = request_var('u', 0);
$username = request_var('username', '', true); $username = request_var('username', '');
if ($post_id) if ($post_id)
{ {

View file

@ -778,7 +778,7 @@ switch ($mode)
if ($mode == 'searchuser' && ($config['load_search'] || $auth->acl_get('a_'))) if ($mode == 'searchuser' && ($config['load_search'] || $auth->acl_get('a_')))
{ {
$username = request_var('username', '', true); $username = request_var('username', '');
$email = request_var('email', ''); $email = request_var('email', '');
$icq = request_var('icq', ''); $icq = request_var('icq', '');
$aim = request_var('aim', ''); $aim = request_var('aim', '');
@ -948,7 +948,7 @@ switch ($mode)
} }
$rank_title = $rank_img = $rank_img_src = ''; $rank_title = $rank_img = $rank_img_src = '';
if ($group_row['group_rank'] != -1) if ($group_row['group_rank'])
{ {
if (isset($ranks['special'][$group_row['group_rank']])) if (isset($ranks['special'][$group_row['group_rank']]))
{ {
@ -957,7 +957,7 @@ switch ($mode)
$rank_img = (!empty($ranks['special'][$group_row['group_rank']]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$group_row['group_rank']]['rank_image'] . '" border="0" alt="' . $ranks['special'][$group_row['group_rank']]['rank_title'] . '" title="' . $ranks['special'][$group_row['group_rank']]['rank_title'] . '" /><br />' : ''; $rank_img = (!empty($ranks['special'][$group_row['group_rank']]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$group_row['group_rank']]['rank_image'] . '" border="0" alt="' . $ranks['special'][$group_row['group_rank']]['rank_title'] . '" title="' . $ranks['special'][$group_row['group_rank']]['rank_title'] . '" /><br />' : '';
$rank_img_src = (!empty($ranks['special'][$group_row['group_rank']]['rank_image'])) ? $config['ranks_path'] . '/' . $ranks['special'][$group_row['group_rank']]['rank_image'] : ''; $rank_img_src = (!empty($ranks['special'][$group_row['group_rank']]['rank_image'])) ? $config['ranks_path'] . '/' . $ranks['special'][$group_row['group_rank']]['rank_image'] : '';
} }
else if ($group_row['group_rank'] == -1) else
{ {
$rank_title = ''; $rank_title = '';
$rank_img = ''; $rank_img = '';

View file

@ -358,7 +358,7 @@ $message_parser->get_submitted_attachment_data($post_data['poster_id']);
if ($post_data['post_attachment'] && !$submit && !$refresh && !$preview && $mode == 'edit') if ($post_data['post_attachment'] && !$submit && !$refresh && !$preview && $mode == 'edit')
{ {
// Do not change to SELECT * // Do not change to SELECT *
$sql = 'SELECT attach_id, physical_filename, comment, real_filename, extension, mimetype, filesize, filetime, thumbnail $sql = 'SELECT attach_id, physical_filename, attach_comment, real_filename, extension, mimetype, filesize, filetime, thumbnail
FROM ' . ATTACHMENTS_TABLE . " FROM ' . ATTACHMENTS_TABLE . "
WHERE post_msg_id = $post_id WHERE post_msg_id = $post_id
AND in_message = 0 AND in_message = 0
@ -527,7 +527,7 @@ if ($submit || $preview || $refresh)
$message_parser->message = request_var('message', '', true); $message_parser->message = request_var('message', '', true);
$post_data['username'] = request_var('username', $post_data['username'], true); $post_data['username'] = request_var('username', $post_data['username']);
$post_data['post_edit_reason'] = (!empty($_POST['edit_reason']) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? request_var('edit_reason', '', true) : ''; $post_data['post_edit_reason'] = (!empty($_POST['edit_reason']) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? request_var('edit_reason', '', true) : '';
$post_data['topic_type'] = request_var('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL)); $post_data['topic_type'] = request_var('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL));