From a5dd64195a3a88db3fec38ac74dfb5d118ab5622 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sun, 22 Jul 2012 22:26:38 -0500 Subject: [PATCH 1/5] [ticket/11021] Add the option to specify a Site home URL and text PHPBB3-11021 --- phpBB/includes/acp/acp_board.php | 2 ++ phpBB/includes/functions.php | 2 ++ phpBB/install/database_update.php | 6 ++++++ phpBB/install/schemas/schema_data.sql | 2 ++ phpBB/language/en/acp/board.php | 4 ++++ phpBB/styles/prosilver/template/overall_footer.html | 2 +- phpBB/styles/prosilver/template/overall_header.html | 4 ++-- 7 files changed, 19 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 575d05933f..322e1c55d8 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -53,6 +53,8 @@ class acp_board 'legend1' => 'ACP_BOARD_SETTINGS', 'sitename' => array('lang' => 'SITE_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false), 'site_desc' => array('lang' => 'SITE_DESC', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false), + 'site_home_url' => array('lang' => 'SITE_HOME_URL', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), + 'site_home_text' => array('lang' => 'SITE_HOME_TEXT', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), 'board_disable' => array('lang' => 'DISABLE_BOARD', 'validate' => 'bool', 'type' => 'custom', 'method' => 'board_disable', 'explain' => true), 'board_disable_msg' => false, 'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'lang', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false), diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index e5b721b1f5..a8d3c25052 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4935,6 +4935,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 'L_LOGIN_LOGOUT' => $l_login_logout, 'L_INDEX' => $user->lang['FORUM_INDEX'], + 'L_HOME' => ($config['site_home_text']) ? $config['site_home_text'] : $user->lang['HOME'], 'L_ONLINE_EXPLAIN' => $l_online_time, 'U_PRIVATEMSGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'), @@ -4945,6 +4946,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 'U_VIEWONLINE' => ($auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid("{$phpbb_root_path}viewonline.$phpEx") : '', 'U_LOGIN_LOGOUT' => $u_login_logout, 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"), + 'U_HOME' => $config['site_home_url'], 'U_SEARCH' => append_sid("{$phpbb_root_path}search.$phpEx"), 'U_REGISTER' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'), 'U_PROFILE' => append_sid("{$phpbb_root_path}ucp.$phpEx"), diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 6e99fd56a0..18efee72b5 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2637,6 +2637,12 @@ function change_database_data(&$no_updates, $version) // After we have calculated the timezones we can delete user_dst column from user table. $db_tools->sql_column_remove(USERS_TABLE, 'user_dst'); } + + if (!isset($config['site_home_url'])) + { + $config->set('site_home_url', ''); + $config->set('site_home_text', ''); + } break; } diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 0bb1858c11..6b95d81713 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -240,6 +240,8 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_protocol', INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_gc', '3600'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_length', '3600'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_desc', '{L_CONFIG_SITE_DESC}'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_home_url', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_home_text', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('sitename', '{L_CONFIG_SITENAME}'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_path', 'images/smilies'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_per_page', '50'); diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 0754884473..6b043b887d 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -49,6 +49,10 @@ $lang = array_merge($lang, array( 'OVERRIDE_STYLE' => 'Override user style', 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces user’s style with the default.', 'SITE_DESC' => 'Site description', + 'SITE_HOME_TEXT' => 'Site home text', + 'SITE_HOME_TEXT_EXPLAIN' => 'Specify a Site Home Text to use your own instead of the default text in the breadcrumbs ’Home.’', + 'SITE_HOME_URL' => 'Site home URL', + 'SITE_HOME_URL_EXPLAIN' => 'If you specify a Site Home URL, a link to this page will be added to your board’s breadcrumbs and the site logo will also be linked to this address.', 'SITE_NAME' => 'Site name', 'SYSTEM_TIMEZONE' => 'Guest timezone', 'SYSTEM_TIMEZONE_EXPLAIN' => 'Timezone to use for displaying times to users who are not logged in (guests, bots). Logged in users set their timezone during registration and can change it in their user control panel.', diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index b473e7022c..ed05bbe80f 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -6,7 +6,7 @@