mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
- 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:
@@ -1102,7 +1102,7 @@ class acp_attachments
|
||||
'in_message' => 0,
|
||||
'physical_filename' => $filedata['physical_filename'],
|
||||
'real_filename' => $filedata['real_filename'],
|
||||
'comment' => $message_parser->filename_data['filecomment'],
|
||||
'attach_comment' => $message_parser->filename_data['filecomment'],
|
||||
'extension' => $filedata['extension'],
|
||||
'mimetype' => $filedata['mimetype'],
|
||||
'filesize' => $filedata['filesize'],
|
||||
|
@@ -144,16 +144,16 @@ class acp_modules
|
||||
break;
|
||||
}
|
||||
|
||||
list($module_name, $module_mode) = explode('::', $quick_install);
|
||||
list($module_basename, $module_mode) = explode('::', $quick_install);
|
||||
|
||||
// Check if module name and mode exist...
|
||||
$fileinfo = $this->get_module_infos($module_name);
|
||||
$fileinfo = $fileinfo[$module_name];
|
||||
$fileinfo = $this->get_module_infos($module_basename);
|
||||
$fileinfo = $fileinfo[$module_basename];
|
||||
|
||||
if (isset($fileinfo['modes'][$module_mode]))
|
||||
{
|
||||
$module_data = array(
|
||||
'module_name' => $module_name,
|
||||
'module_basename' => $module_basename,
|
||||
'module_enabled' => 0,
|
||||
'module_display' => (isset($fileinfo['modes'][$module_mode]['display'])) ? $fileinfo['modes'][$module_mode]['display'] : 1,
|
||||
'parent_id' => $parent_id,
|
||||
@@ -202,7 +202,7 @@ class acp_modules
|
||||
if ($action == 'add')
|
||||
{
|
||||
$module_row = array(
|
||||
'module_name' => '',
|
||||
'module_basename' => '',
|
||||
'module_enabled' => 0,
|
||||
'module_display' => 1,
|
||||
'parent_id' => 0,
|
||||
@@ -214,7 +214,7 @@ class acp_modules
|
||||
|
||||
$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_display'] = request_var('module_display', (int) $module_row['module_display']);
|
||||
$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')
|
||||
{
|
||||
$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;
|
||||
}
|
||||
|
||||
@@ -245,10 +245,10 @@ class acp_modules
|
||||
}
|
||||
|
||||
// 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']);
|
||||
$module_data['module_auth'] = $fileinfo[$module_data['module_name']]['modes'][$module_data['module_mode']]['auth'];
|
||||
$fileinfo = $this->get_module_infos($module_data['module_basename']);
|
||||
$module_data['module_auth'] = $fileinfo[$module_data['module_basename']]['modes'][$module_data['module_mode']]['auth'];
|
||||
}
|
||||
|
||||
$errors = $this->update_module_data($module_data);
|
||||
@@ -262,7 +262,7 @@ class acp_modules
|
||||
}
|
||||
|
||||
// Category/not category?
|
||||
$is_cat = (!$module_data['module_name']) ? true : false;
|
||||
$is_cat = (!$module_data['module_basename']) ? true : false;
|
||||
|
||||
// Get module informations
|
||||
$module_infos = $this->get_module_infos();
|
||||
@@ -271,20 +271,20 @@ class acp_modules
|
||||
$s_name_options = $s_mode_options = '';
|
||||
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
|
||||
$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));
|
||||
|
||||
// Build module modes
|
||||
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>';
|
||||
}
|
||||
@@ -387,7 +387,7 @@ class acp_modules
|
||||
}
|
||||
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 . '&parent_id=' . $parent_id . '&m=' . $row['module_id'];
|
||||
@@ -551,22 +551,10 @@ class acp_modules
|
||||
{
|
||||
global $db, $user, $auth, $config;
|
||||
|
||||
switch (SQL_LAYER)
|
||||
{
|
||||
case 'firebird':
|
||||
$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;
|
||||
|
||||
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;
|
||||
}
|
||||
$sql = 'SELECT module_id, module_enabled, module_basename, 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";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$right = $iteration = 0;
|
||||
@@ -607,13 +595,13 @@ class acp_modules
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
// ignore non-category?
|
||||
if ($row['module_name'] && $ignore_noncat)
|
||||
if ($row['module_basename'] && $ignore_noncat)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -777,7 +765,7 @@ class acp_modules
|
||||
{
|
||||
$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
|
||||
$branch = $this->get_module_branch($module_data['module_id'], 'children', 'descending', false);
|
||||
|
@@ -59,8 +59,8 @@ class acp_permissions
|
||||
$subforum_id = request_var('subforum_id', 0);
|
||||
$forum_id = request_var('forum_id', array(0));
|
||||
|
||||
$username = request_var('username', array(''), true);
|
||||
$usernames = request_var('usernames', '', true);
|
||||
$username = request_var('username', array(''));
|
||||
$usernames = request_var('usernames', '');
|
||||
$user_id = request_var('user_id', array(0));
|
||||
|
||||
$group_id = request_var('group_id', array(0));
|
||||
|
@@ -304,7 +304,7 @@ class acp_profile
|
||||
$lang_options = array();
|
||||
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);
|
||||
|
||||
@@ -486,7 +486,7 @@ class acp_profile
|
||||
$l_lang_options = array();
|
||||
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);
|
||||
|
||||
@@ -1203,8 +1203,8 @@ class acp_profile
|
||||
}
|
||||
|
||||
$sql_ary = array(
|
||||
'lang_name' => $cp->vars['lang_name'],
|
||||
'lang_explain' => $cp->vars['lang_explain'],
|
||||
'lang_name' => $cp->vars['lang_name'],
|
||||
'lang_explain' => $cp->vars['lang_explain'],
|
||||
'lang_default_value' => $cp->vars['lang_default_value']
|
||||
);
|
||||
|
||||
@@ -1277,7 +1277,7 @@ class acp_profile
|
||||
{
|
||||
$sql_ary = array(
|
||||
'field_type' => (int) $field_type,
|
||||
'value' => $value
|
||||
'lang_value' => $value
|
||||
);
|
||||
|
||||
if ($action == 'create')
|
||||
@@ -1332,7 +1332,7 @@ class acp_profile
|
||||
'lang_id' => (int) $lang_id,
|
||||
'option_id' => (int) $option_id,
|
||||
'field_type' => (int) $field_type,
|
||||
'value' => $value
|
||||
'lang_value' => $value
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -214,7 +214,7 @@ class acp_prune
|
||||
}
|
||||
else
|
||||
{
|
||||
$username = request_var('username', '', true);
|
||||
$username = request_var('username', '');
|
||||
$email = request_var('email', '');
|
||||
|
||||
$joined_select = request_var('joined_select', 'lt');
|
||||
@@ -317,7 +317,7 @@ class acp_prune
|
||||
'prune' => 1,
|
||||
|
||||
'users' => request_var('users', ''),
|
||||
'username' => request_var('username', '', true),
|
||||
'username' => request_var('username', ''),
|
||||
'email' => request_var('email', ''),
|
||||
'joined_select' => request_var('joined_select', ''),
|
||||
'joined' => request_var('joined', ''),
|
||||
|
@@ -28,7 +28,7 @@ class acp_users
|
||||
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
|
||||
|
||||
$error = array();
|
||||
$username = request_var('username', '', true);
|
||||
$username = request_var('username', '');
|
||||
$user_id = request_var('u', 0);
|
||||
$action = request_var('action', '');
|
||||
|
||||
@@ -1711,7 +1711,7 @@ class acp_users
|
||||
|
||||
$template->assign_block_vars('attach', array(
|
||||
'REAL_FILENAME' => $row['real_filename'],
|
||||
'COMMENT' => nl2br($row['comment']),
|
||||
'COMMENT' => nl2br($row['attach_comment']),
|
||||
'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']),
|
||||
'DOWNLOAD_COUNT' => $row['download_count'],
|
||||
|
Reference in New Issue
Block a user