aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/database_update.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r--phpBB/install/database_update.php66
1 files changed, 65 insertions, 1 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 47d261dc46..83bbbf4577 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -685,7 +685,6 @@ function _add_modules($modules_to_install)
WHERE module_class = '" . $db->sql_escape($module_data['class']) . "'
AND parent_id = {$parent_id}
AND left_id BETWEEN {$first_left_id} AND {$module_row['left_id']}
- GROUP BY left_id
ORDER BY left_id";
$result = $db->sql_query($sql);
$steps = (int) $db->sql_fetchfield('num_modules');
@@ -1684,6 +1683,71 @@ function change_database_data(&$no_updates, $version)
}
$db->sql_freeresult($result);
+ // Install modules
+ $modules_to_install = array(
+ 'post' => array(
+ 'base' => 'board',
+ 'class' => 'acp',
+ 'title' => 'ACP_POST_SETTINGS',
+ 'auth' => 'acl_a_board',
+ 'cat' => 'ACP_MESSAGES',
+ 'after' => array('message', 'ACP_MESSAGE_SETTINGS')
+ ),
+ );
+
+ _add_modules($modules_to_install);
+
+ // add Bing Bot
+ $sql = 'SELECT group_id, group_colour
+ FROM ' . GROUPS_TABLE . "
+ WHERE group_name = 'BOTS'";
+ $result = $db->sql_query($sql);
+ $group_row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if (!$group_row)
+ {
+ // default fallback, should never get here
+ $group_row['group_id'] = 6;
+ $group_row['group_colour'] = '9E8DA7';
+ }
+
+ if (!function_exists('user_add'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
+
+ $bot_name = 'Bing [Bot]';
+ $bot_agent = 'bingbot/';
+ $bot_ip = '';
+
+ $user_row = array(
+ 'user_type' => USER_IGNORE,
+ 'group_id' => $group_row['group_id'],
+ 'username' => $bot_name,
+ 'user_regdate' => time(),
+ 'user_password' => '',
+ 'user_colour' => $group_row['group_colour'],
+ 'user_email' => '',
+ 'user_lang' => $config['default_lang'],
+ 'user_style' => $config['default_style'],
+ 'user_timezone' => 0,
+ 'user_dateformat' => $config['default_dateformat'],
+ 'user_allow_massemail' => 0,
+ );
+
+ $user_id = user_add($user_row);
+
+ $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ 'bot_active' => 1,
+ 'bot_name' => (string) $bot_name,
+ 'user_id' => (int) $user_id,
+ 'bot_agent' => (string) $bot_agent,
+ 'bot_ip' => (string) $bot_ip,
+ ));
+
+ _sql($sql, $errored, $error_ary);
+ // end Bing Bot addition
$no_updates = false;
break;