aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/database_update.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2012-10-29 18:09:20 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2012-10-29 18:09:20 -0500
commite549b7663da47d7518b93074e513c7e1d034bf52 (patch)
treede8b250ab18d550e597c7d093a0633a6f2004bed /phpBB/install/database_update.php
parenteddb56f8426161923d8870ca5f8f899c342075db (diff)
downloadforums-e549b7663da47d7518b93074e513c7e1d034bf52.tar
forums-e549b7663da47d7518b93074e513c7e1d034bf52.tar.gz
forums-e549b7663da47d7518b93074e513c7e1d034bf52.tar.bz2
forums-e549b7663da47d7518b93074e513c7e1d034bf52.tar.xz
forums-e549b7663da47d7518b93074e513c7e1d034bf52.zip
[ticket/11103] Set basic notifications to be enabled by default
Now, if there is no row for the user in the user_notifications table, the user will receive basic notifications. If the user wishes to not receive notifications, a row must be added with notify = 0. For other methods besides the basic (e.g. email, jabber) a row must still be added with notify = 1 for them to receive notifications PHPBB3-11103
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r--phpBB/install/database_update.php46
1 files changed, 3 insertions, 43 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 3e4edc0b8f..94a4749313 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1154,6 +1154,7 @@ function database_update_info()
'item_id' => array('UINT', 0),
'user_id' => array('UINT', 0),
'method' => array('VCHAR:255', ''),
+ 'notify' => array('BOOL', 1),
),
'PRIMARY_KEY' => array(
'item_type',
@@ -1164,6 +1165,7 @@ function database_update_info()
'KEYS' => array(
'it' => array('INDEX', 'item_type'),
'uid' => array('INDEX', 'user_id'),
+ 'no' => array('INDEX', 'notify'),
),
),
),
@@ -2755,7 +2757,7 @@ function change_database_data(&$no_updates, $version)
$config->set('site_home_text', '');
}
- if (true)//!isset($config['load_notifications']))
+ if (!isset($config['load_notifications']))
{
$config->set('load_notifications', 1);
@@ -2819,48 +2821,6 @@ function change_database_data(&$no_updates, $version)
$db->sql_freeresult($result);
}
}
-/*
- // Add default notifications
- $default_notifications = array(
- array(
- 'check' => ($config['allow_topic_notify']),
- 'item_type' => 'phpbb_notification_type_post',
- ),
- array(
- 'check' => ($config['allow_forum_notify']),
- 'item_type' => 'phpbb_notification_type_topic',
- ),
- array(
- 'check' => ($config['allow_bookmarks']),
- 'item_type' => 'phpbb_notification_type_bookmark',
- ),
- array(
- 'check' => ($config['allow_privmsg']),
- 'item_type' => 'phpbb_notification_type_pm',
- ),
- );
-
- foreach ($default_notifications as $convert_data)
- {
- if ($convert_data['check'])
- {
- $sql = 'SELECT user_id
- FROM ' . USERS_TABLE . '
- WHERE user_id <> ' . ANONYMOUS . '
- AND user_type <> ' . USER_IGNORE;
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- _sql('INSERT INTO ' . USER_NOTIFICATIONS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
- 'item_type' => $convert_data['item_type'],
- 'item_id' => 0,
- 'user_id' => $row['user_id'],
- 'method' => '',
- )), $errored, $error_ary);
- }
- $db->sql_freeresult($result);
- }
- }*/
}
break;