From 9707e5e74e83d1c9a4ab217ff09a92aa34274213 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 26 Nov 2010 15:35:34 +0000 Subject: [PATCH] Added function that redirects user to index if no modules are enabled; Added message that the user should disable the portal if all modules are disabled --- root/language/en/mods/info_acp_portal.php | 2 +- root/portal.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/root/language/en/mods/info_acp_portal.php b/root/language/en/mods/info_acp_portal.php index 4698898b..c50710ba 100644 --- a/root/language/en/mods/info_acp_portal.php +++ b/root/language/en/mods/info_acp_portal.php @@ -40,7 +40,7 @@ if (empty($lang) || !is_array($lang)) $lang = array_merge($lang, array( // Portal Modules 'ACP_PORTAL_MODULES' => 'Portal Modules', - 'ACP_PORTAL_MODULES_EXP' => 'You can manage your portal modules here', + 'ACP_PORTAL_MODULES_EXP' => 'You can manage your portal modules here. If you turn off all modules, please also disable the Portal.', 'MODULE_POS_TOP' => 'Top', 'MODULE_POS_LEFT' => 'Left column', diff --git a/root/portal.php b/root/portal.php index 9f66d30b..d45e9697 100644 --- a/root/portal.php +++ b/root/portal.php @@ -113,8 +113,15 @@ while ($row = $db->sql_fetchrow($result)) } unset($template_module); } +$module_count = $db->sql_affectedrows(); $db->sql_freeresult($result); +// Redirect to index if there are currently no active modules +if($module_count < 1) +{ + redirect(reapply_sid($phpbb_root_path . 'index.' . $phpEx)); +} + // Assign specific vars $template->assign_vars(array( 'S_SMALL_BLOCK' => true,