1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/11103] Inject table prefix to notifications system instead of constants

PHPBB3-11103
This commit is contained in:
Nathaniel Guse
2012-11-09 08:48:41 -06:00
parent 6a0f6833e6
commit 6c8c54d4d2
7 changed files with 81 additions and 38 deletions

View File

@@ -110,14 +110,6 @@ if (!defined('EXT_TABLE'))
{
define('EXT_TABLE', $table_prefix . 'ext');
}
if (!defined('NOTIFICATIONS_TABLE'))
{
define('NOTIFICATIONS_TABLE', $table_prefix . 'notifications');
}
if (!defined('USER_NOTIFICATIONS_TABLE'))
{
define('USER_NOTIFICATIONS_TABLE', $table_prefix . 'user_notifications');
}
$phpbb_container = new ContainerBuilder();
$loader = new YamlFileLoader($phpbb_container, new FileLocator(__DIR__.'/../config'));
@@ -1125,7 +1117,7 @@ function database_update_info()
'ext_name' => array('UNIQUE', 'ext_name'),
),
),
NOTIFICATIONS_TABLE => array(
$table_prefix . 'notifications' => array(
'COLUMNS' => array(
'notification_id' => array('UINT', NULL, 'auto_increment'),
'item_type' => array('VCHAR:255', ''),
@@ -1148,7 +1140,7 @@ function database_update_info()
'is_enabled' => array('INDEX', 'is_enabled'),
),
),
USER_NOTIFICATIONS_TABLE => array(
$table_prefix . 'user_notifications' => array(
'COLUMNS' => array(
'item_type' => array('VCHAR:255', ''),
'item_id' => array('UINT', 0),
@@ -2791,7 +2783,7 @@ function change_database_data(&$no_updates, $version)
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
_sql('INSERT INTO ' . USER_NOTIFICATIONS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
_sql('INSERT INTO ' . $table_prefix . 'user_notifications ' . $db->sql_build_array('INSERT', array(
'item_type' => $convert_data['item_type'],
'item_id' => 0,
'user_id' => $row['user_id'],
@@ -2800,7 +2792,7 @@ function change_database_data(&$no_updates, $version)
if ($row['user_notify_type'] == NOTIFY_EMAIL || $row['user_notify_type'] == NOTIFY_BOTH)
{
_sql('INSERT INTO ' . USER_NOTIFICATIONS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
_sql('INSERT INTO ' . $table_prefix . 'user_notifications ' . $db->sql_build_array('INSERT', array(
'item_type' => $convert_data['item_type'],
'item_id' => 0,
'user_id' => $row['user_id'],
@@ -2810,7 +2802,7 @@ function change_database_data(&$no_updates, $version)
if ($row['user_notify_type'] == NOTIFY_IM || $row['user_notify_type'] == NOTIFY_BOTH)
{
_sql('INSERT INTO ' . USER_NOTIFICATIONS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
_sql('INSERT INTO ' . $table_prefix . 'user_notifications ' . $db->sql_build_array('INSERT', array(
'item_type' => $convert_data['item_type'],
'item_id' => 0,
'user_id' => $row['user_id'],