From: Meik S. <acy...@ph...> - 2009-08-30 17:22:33
|
Author: acydburn Date: Sun Aug 30 18:22:21 2009 New Revision: 10068 Log: correct mode is send_statistics, else installs will differ from updates. Modified: branches/phpBB-3_0_0/phpBB/includes/acp/info/acp_send_statistics.php branches/phpBB-3_0_0/phpBB/install/database_update.php Modified: branches/phpBB-3_0_0/phpBB/includes/acp/info/acp_send_statistics.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/acp/info/acp_send_statistics.php (original) --- branches/phpBB-3_0_0/phpBB/includes/acp/info/acp_send_statistics.php Sun Aug 30 18:22:21 2009 *************** *** 20,26 **** 'title' => 'ACP_SEND_STATISTICS', 'version' => '1.0.0', 'modes' => array( ! 'questionnaire' => array('title' => 'ACP_SEND_STATISTICS', 'auth' => 'acl_a_server', 'cat' => array('ACP_SERVER_CONFIGURATION')), ), ); } --- 20,26 ---- 'title' => 'ACP_SEND_STATISTICS', 'version' => '1.0.0', 'modes' => array( ! 'send_statistics' => array('title' => 'ACP_SEND_STATISTICS', 'auth' => 'acl_a_server', 'cat' => array('ACP_SERVER_CONFIGURATION')), ), ); } Modified: branches/phpBB-3_0_0/phpBB/install/database_update.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/install/database_update.php (original) --- branches/phpBB-3_0_0/phpBB/install/database_update.php Sun Aug 30 18:22:21 2009 *************** *** 1181,1191 **** AND module_mode = '' AND module_basename = ''"; $result = $db->sql_query($sql); ! while ($row = $db->sql_fetchrow($result)) { - $category_id = (int) $row['module_id']; - // Check if we actually need to add the module or if it is already added. ;) $sql = 'SELECT * FROM ' . MODULES_TABLE . " --- 1181,1191 ---- AND module_mode = '' AND module_basename = ''"; $result = $db->sql_query($sql); + $category_id = (int) $db->sql_fetchfield('module_id'); + $db->sql_freeresult($result); ! if ($category_id) { // Check if we actually need to add the module or if it is already added. ;) $sql = 'SELECT * FROM ' . MODULES_TABLE . " *************** *** 1194,1204 **** AND module_mode = 'warnings' AND module_auth = 'acl_a_user' AND parent_id = {$category_id}"; ! $result2 = $db->sql_query($sql); ! $row2 = $db->sql_fetchrow($result2); ! $db->sql_freeresult($result2); ! if (!$row2) { $module_data = array( 'module_basename' => 'users', --- 1194,1204 ---- AND module_mode = 'warnings' AND module_auth = 'acl_a_user' AND parent_id = {$category_id}"; ! $result = $db->sql_query($sql); ! $row = $db->sql_fetchrow($result); ! $db->sql_freeresult($result); ! if (!$row) { $module_data = array( 'module_basename' => 'users', *************** *** 1214,1221 **** $_module->update_module_data($module_data, true); } } - $db->sql_freeresult($result); - // Also install the "PM Reports" module $sql = 'SELECT module_id --- 1214,1219 ---- *************** *** 1225,1239 **** AND module_mode = '' AND module_basename = ''"; $result = $db->sql_query($sql); ! while ($row = $db->sql_fetchrow($result)) { - $category_id = (int) $row['module_id']; - $modes = array( 'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'aclf_m_report'), ! 'pm_reports_closed' => array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'aclf_m_report'), ! 'pm_report_details' => array('title' => 'MCP_PM_REPORT_DETAILS', 'auth' => 'aclf_m_report'), ); foreach ($modes as $mode => $data) --- 1223,1237 ---- AND module_mode = '' AND module_basename = ''"; $result = $db->sql_query($sql); + $category_id = (int) $db->sql_fetchfield('module_id'); + $db->sql_freeresult($result); ! if ($category_id) { $modes = array( 'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'aclf_m_report'), ! 'pm_reports_closed' => array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'aclf_m_report'), ! 'pm_report_details' => array('title' => 'MCP_PM_REPORT_DETAILS', 'auth' => 'aclf_m_report'), ); foreach ($modes as $mode => $data) *************** *** 1245,1255 **** AND module_langname = '{$data['title']}' AND module_mode = '$mode' AND parent_id = {$category_id}"; ! $result2 = $db->sql_query($sql); ! $row2 = $db->sql_fetchrow($result2); ! $db->sql_freeresult($result2); ! if (!$row2) { $module_data = array( 'module_basename' => 'pm_reports', --- 1243,1253 ---- AND module_langname = '{$data['title']}' AND module_mode = '$mode' AND parent_id = {$category_id}"; ! $result = $db->sql_query($sql); ! $row = $db->sql_fetchrow($result); ! $db->sql_freeresult($result); ! if (!$row) { $module_data = array( 'module_basename' => 'pm_reports', *************** *** 1266,1272 **** } } } - $db->sql_freeresult($result); // Also install the "Copy forum permissions" module $sql = 'SELECT module_id --- 1264,1269 ---- *************** *** 1276,1286 **** AND module_mode = '' AND module_basename = ''"; $result = $db->sql_query($sql); ! while ($row = $db->sql_fetchrow($result)) { - $category_id = (int) $row['module_id']; - // Check if we actually need to add the feed module or if it is already added. ;) $sql = 'SELECT * FROM ' . MODULES_TABLE . " --- 1273,1283 ---- AND module_mode = '' AND module_basename = ''"; $result = $db->sql_query($sql); + $category_id = (int) $db->sql_fetchfield('module_id'); + $db->sql_freeresult($result); ! if ($category_id) { // Check if we actually need to add the feed module or if it is already added. ;) $sql = 'SELECT * FROM ' . MODULES_TABLE . " *************** *** 1289,1299 **** AND module_mode = 'setting_forum_copy' AND module_auth = 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth' AND parent_id = {$category_id}"; ! $result2 = $db->sql_query($sql); ! $row2 = $db->sql_fetchrow($result2); ! $db->sql_freeresult($result2); ! if (!$row2) { $module_data = array( 'module_basename' => 'permissions', --- 1286,1296 ---- AND module_mode = 'setting_forum_copy' AND module_auth = 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth' AND parent_id = {$category_id}"; ! $result = $db->sql_query($sql); ! $row = $db->sql_fetchrow($result); ! $db->sql_freeresult($result); ! if (!$row) { $module_data = array( 'module_basename' => 'permissions', *************** *** 1309,1315 **** $_module->update_module_data($module_data, true); } } - $db->sql_freeresult($result); // Also install the "Send statistics" module $sql = 'SELECT module_id --- 1306,1311 ---- *************** *** 1319,1329 **** AND module_mode = '' AND module_basename = ''"; $result = $db->sql_query($sql); ! while ($row = $db->sql_fetchrow($result)) { - $category_id = (int) $row['module_id']; - // Check if we need to add the module or if it is already there. ;) $sql = 'SELECT * FROM ' . MODULES_TABLE . " --- 1315,1325 ---- AND module_mode = '' AND module_basename = ''"; $result = $db->sql_query($sql); + $category_id = (int) $db->sql_fetchfield('module_id'); + $db->sql_freeresult($result); ! if ($category_id) { // Check if we need to add the module or if it is already there. ;) $sql = 'SELECT * FROM ' . MODULES_TABLE . " *************** *** 1332,1342 **** AND module_mode = 'send_statistics' AND module_auth = 'acl_a_server' AND parent_id = {$category_id}"; ! $result2 = $db->sql_query($sql); ! $row2 = $db->sql_fetchrow($result2); ! $db->sql_freeresult($result2); ! if (!$row2) { $module_data = array( 'module_basename' => 'send_statistics', --- 1328,1338 ---- AND module_mode = 'send_statistics' AND module_auth = 'acl_a_server' AND parent_id = {$category_id}"; ! $result = $db->sql_query($sql); ! $row = $db->sql_fetchrow($result); ! $db->sql_freeresult($result); ! if (!$row) { $module_data = array( 'module_basename' => 'send_statistics', *************** *** 1352,1358 **** $_module->update_module_data($module_data, true); } } - $db->sql_freeresult($result); $_module->remove_cache_file(); --- 1348,1353 ---- |