Последовательность действий такова:
- Переключить всех пользователей, включая себя, на стиль prosilver.
- Удалить файлы phpBB 3.0.x, КРОМЕ:
config.php - папки
/images - папки
/files - папки
/store
- Скопировать все файлы phpBB 3.1 в папку, где находится phpBB 3.0 (кроме
config.php ) - Ввести в адресной строке и запустить
/install/database_update.php (после имени домена и пути к форумам) - Удалить (или переименовать) папку
/install
Код: Выделить всё
http://адрес форума/fix.php
Код: Выделить всё
<?php define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); // Default style ID $sql = 'SELECT config_value FROM ' . CONFIG_TABLE . " WHERE config_name = 'default_style'"; $result = $db->sql_query($sql); $default_style_id = (int) $db->sql_fetchfield('config_value'); $db->sql_freeresult($result); // Default style name $sql = 'SELECT style_name FROM ' . STYLES_TABLE . ' WHERE style_id = ' . $default_style_id; $result = $db->sql_query($sql); $default_style_name = $db->sql_fetchfield('style_name'); $db->sql_freeresult($result); // Active styles $sql = 'SELECT style_id, style_name, style_active FROM ' . STYLES_TABLE; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $styles_list[] = $row; } $db->sql_freeresult($result); echo 'Default style: ' . $default_style_name . ' (' . $default_style_id . ')<br />'; $exists = file_exists('./styles/' . $default_style_name . '/style.cfg'); if ($exists) { echo 'Default style exists, no work to be done.'; exit; } if (!file_exists('./styles/prosilver/style.cfg')) { echo 'Prosilver does not exist. Please upload a copy of prosilver from the <a href="https://www.phpbb.com/downloads/">3.1.0 Full Package</a>.'; exit; } $prosilver = array(); foreach ($styles_list as $style) { if ($style['style_name'] == 'prosilver') { $prosilver = $style; break; } } // Install style if it doesn't exist if (!sizeof($prosilver)) { $sql_ary = array( 'style_name' => 'prosilver', 'style_copyright' => '© phpBB Group', 'style_active' => 1, 'style_path' => 'prosilver', 'bbcode_bitfield' => 'lNg=', 'style_parent_id' => '0', 'style_parent_tree' => '', ); $sql = 'INSERT INTO ' . STYLES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); $id = $db->sql_nextid(); $prosilver = array( 'style_name' => 'prosilver', 'style_id' => $id, 'style_active' => 1, ); echo 'Installed prosilver (' . $id . ').<br />'; } else { // Activate prosilver $sql = 'UPDATE ' . STYLES_TABLE . " SET style_active = 1 WHERE style_name = 'prosilver'"; $db->sql_query($sql); } // Set it as the default style $sql = 'UPDATE ' . CONFIG_TABLE . ' SET config_value = ' . $prosilver['style_id'] . " WHERE config_name = 'default_style'"; $db->sql_query($sql); $cache->purge(); echo 'Set prosilver as the default style.<br />'; // Set all users' styles to prosilver $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = ' . $prosilver['style_id']; $db->sql_query($sql); echo 'Updated user styles to prosilver.<br />'; echo 'Done.'; ?>