diff -u'rNF^function' /opt/drupal/includes/menu.inc /var/www/drupal/includes/menu.inc --- /opt/drupal/includes/menu.inc 2006-08-20 11:27:40.000000000 +0530 +++ /var/www/drupal/includes/menu.inc 2006-08-29 23:48:44.000000000 +0530 @@ -534,7 +534,7 @@ function menu_get_active_breadcrumb() { return array(); } - $links[] = l(t('Home'), variable_get('site_frontpage', 'node')); + $links[] = l(t('Home'), drupal_get_frontpage_path()); $trail = _menu_get_active_trail(); foreach ($trail as $mid) { diff -u'rNF^function' /opt/drupal/includes/path.inc /var/www/drupal/includes/path.inc --- /opt/drupal/includes/path.inc 2006-08-23 10:01:30.000000000 +0530 +++ /var/www/drupal/includes/path.inc 2006-08-29 23:48:44.000000000 +0530 @@ -18,11 +18,18 @@ function drupal_init_path() { $_GET['q'] = drupal_get_normal_path(trim($_GET['q'], '/')); } else { - $_GET['q'] = drupal_get_normal_path(variable_get('site_frontpage', 'node')); + $_GET['q'] = drupal_get_normal_path(drupal_get_frontpage_path()); } } /** + * Get the path to the front page. + */ +function drupal_get_frontpage_path() { + return variable_get('welcome_message', FALSE) ? 'welcome' : variable_get('site_frontpage', 'node'); +} + +/** * Given an alias, return its Drupal system URL if one exists. Given a Drupal * system URL return its alias if one exists. * @@ -195,7 +202,7 @@ function drupal_set_title($title = NULL) * Boolean value: TRUE if the current page is the front page; FALSE if otherwise. */ function drupal_is_front_page() { - // As drupal_init_path updates $_GET['q'] with the 'site_frontpage' path, - // we can check it against the 'site_frontpage' variable. - return $_GET['q'] == drupal_get_normal_path(variable_get('site_frontpage', 'node')); + // As drupal_init_path updates $_GET['q'] with the drupal_get_frontpage_path() path, + // we can check it against the drupal_get_frontpage_path() return value. + return $_GET['q'] == drupal_get_normal_path(drupal_get_frontpage_path()); } diff -u'rNF^function' /opt/drupal/modules/block/block.module /var/www/drupal/modules/block/block.module --- /opt/drupal/modules/block/block.module 2006-08-27 18:13:18.000000000 +0530 +++ /var/www/drupal/modules/block/block.module 2006-08-29 23:48:44.000000000 +0530 @@ -667,7 +667,7 @@ function block_list($region) { if ($block->pages) { if ($block->visibility < 2) { $path = drupal_get_path_alias($_GET['q']); - $regexp = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\($|\|)/'), array('|', '.*', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote($block->pages, '/')) .')$/'; + $regexp = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\($|\|)/'), array('|', '.*', '\1'. preg_quote(drupal_get_frontpage_path(), '/') .'\2'), preg_quote($block->pages, '/')) .')$/'; $page_match = !($block->visibility xor preg_match($regexp, $path)); } else { diff -u'rNF^function' /opt/drupal/modules/node/node.module /var/www/drupal/modules/node/node.module --- /opt/drupal/modules/node/node.module 2006-08-29 14:42:02.000000000 +0530 +++ /var/www/drupal/modules/node/node.module 2006-08-29 23:52:16.000000000 +0530 @@ -2266,35 +2266,14 @@ function node_page_default() { $output .= theme('pager', NULL, variable_get('default_nodes_main', 10)); } else { - $output = t(' -

Welcome to your new Drupal website!

-

Please follow these steps to set up and start using your website:

-
    -
  1. - Create your administrator account - To begin, create the first account. This account will have full administration rights and will allow you to configure your website. -
  2. -
  3. - Configure your website - Once logged in, visit the administration section, where you can customize and configure all aspects of your website. -
  4. -
  5. - Enable additional functionality - Next, visit the module list and enable features which suit your specific needs. You can find additional modules in the Drupal modules download section. -
  6. -
  7. - Customize your website design - To change the "look and feel" of your website, visit the themes section. You may choose from one of the included themes or download additional themes from the Drupal themes download section. -
  8. -
  9. - Start posting content - Finally, you can create content for your website. This message will disappear once you have published your first post. -
  10. -
-

For more information, please refer to the help section, or the online Drupal handbooks. You may also post at the Drupal forum, or view the wide range of other support options available.

', - array('@drupal' => 'http://drupal.org/', '@register' => url('user/register'), '@admin' => url('admin'), '@config' => url('admin/settings'), '@modules' => url('admin/settings/modules'), '@download_modules' => 'http://drupal.org/project/modules', '@themes' => url('admin/build/themes'), '@download_themes' => 'http://drupal.org/project/themes', '@content' => url('node/add'), '@help' => url('admin/help'), '@handbook' => 'http://drupal.org/handbooks', '@forum' => 'http://drupal.org/forum', '@support' => 'http://drupal.org/support') - ); - $output = '
'. $output .'
'; + $output = '

'. t('There are no promoted posts.') .'

'; + if (user_access('administer nodes')) { + $output .= '

'. t('You may wish to add content or promote existing content.', array('%add' => url('node/add'), '%administer' => url('admin/content/node'))) .'

'; + } + if (user_access('administer site configuration')) { + $output .= '

'. t('You may wish to change your default front page setting.', array('%settings' => url('admin/settings/site-information'))) .'

'; + } + } drupal_set_title(''); diff -u'rNF^function' /opt/drupal/modules/system/system.module /var/www/drupal/modules/system/system.module --- /opt/drupal/modules/system/system.module 2006-08-29 14:42:03.000000000 +0530 +++ /var/www/drupal/modules/system/system.module 2006-08-29 23:48:44.000000000 +0530 @@ -257,6 +257,17 @@ function system_menu($may_cache) { 'callback arguments' => array('system_clean_url_settings')); } else { + if (variable_get('welcome_message', FALSE)) { + $items[] = array('path' => 'welcome', 'title' => t('Welcome'), + 'callback' => 'system_welcome_page', + 'access' => TRUE, + 'type' => MENU_CALLBACK); + $items[] = array('path' => 'welcome/delete', 'title' => t('Welcome'), + 'callback' => 'system_welcome_delete', + 'access' => TRUE, + 'type' => MENU_CALLBACK); + } + /** * Use the administrative theme if the user is looking at a page in the admin/* path. */ @@ -1561,6 +1572,23 @@ function confirm_form($form, $question, } /** + * Output a welcome page for use in initial site orientation. + */ +function system_welcome_page() { + drupal_set_title(''); + $content = t(variable_get('welcome_message', ''), array('@drupal' => 'http://drupal.org/', '@register' => url('user/register'), '@admin' => url('admin'), '@config' => url('admin/settings'), '@modules' => url('admin/settings/modules'), '@download_modules' => 'http://drupal.org/project/modules', '@themes' => url('admin/build/themes'), '@download_themes' => 'http://drupal.org/project/themes', '@content' => url('node/add'), '@help' => url('admin/help'), '@handbook' => 'http://drupal.org/handbooks', '@forum' => 'http://drupal.org/forum', '@support' => 'http://drupal.org/support')); + return theme('system_welcome_page', $content); +} + +/** + * Disable the welcome page by deleting the variable that triggers it. + */ +function system_welcome_delete() { + variable_del('welcome_message'); + drupal_goto(drupal_get_frontpage_path()); +} + +/** * Determine if a user is in compact mode. */ function system_admin_compact_mode() { @@ -1569,6 +1597,18 @@ function system_admin_compact_mode() { } /** + * Theme the content of a welcome page. + */ +function theme_system_welcome_page($content) { + $output = ''; + $output = '
'. $output . $content .'
'; + return $output; +} + +/** * This function formats an administrative page for viewing. * * @param $blocks diff -u'rNF^function' /opt/drupal/profiles/default/default.profile /var/www/drupal/profiles/default/default.profile --- /opt/drupal/profiles/default/default.profile 2006-08-09 02:48:04.000000000 +0530 +++ /var/www/drupal/profiles/default/default.profile 2006-08-29 23:48:44.000000000 +0530 @@ -20,3 +20,37 @@ function default_profile_details() { 'description' => 'Select this profile to enable some basic Drupal functionality and the default theme.' ); } + +/** + * Do setup tasks specific to this profile. + */ +function default_install() { + // Set the welcome page. + $welcome_message = ' +

Welcome to your new Drupal website!

+

Please follow these steps to set up and start using your website:

+
    +
  1. + Create your administrator account + To begin, create the first account. This account will have full administration rights and will allow you to configure your website. +
  2. +
  3. + Configure your website + Once logged in, visit the administration section, where you can customize and configure all aspects of your website. +
  4. +
  5. + Enable additional functionality + Next, visit the module list and enable features which suit your specific needs. You can find additional modules in the Drupal modules download section. +
  6. +
  7. + Customize your website design + To change the "look and feel" of your website, visit the themes section. You may choose from one of the included themes or download additional themes from the Drupal themes download section. +
  8. +
  9. + Start posting content + Finally, you can create content for your website. This message will disappear once you have published your first post. +
  10. +
+

For more information, please refer to the help section, or the online Drupal handbooks. You may also post at the Drupal forum, or view the wide range of other support options available.

'; + variable_set('welcome_message', $welcome_message); +} \ No newline at end of file