From 325f9891b28ef3d1bb8f385057ad487ce9e9c79e Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 8 Feb 2004 21:16:03 +0000 Subject: - Added a welcome message written by Steven. --- modules/node/node.module | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'modules/node') diff --git a/modules/node/node.module b/modules/node/node.module index a7b86e31f..e5b9d29c5 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1491,6 +1491,30 @@ function node_delete($edit) { return $output; } +function node_page_default() { + $result = pager_query('SELECT nid, type FROM {node} WHERE promote = 1 AND status = 1 ORDER BY static DESC, created DESC', variable_get('default_nodes_main', 10)); + + if (db_affected_rows($result)) { + drupal_set_html_head(''); + + $output = ''; + while ($node = db_fetch_object($result)) { + $output .= node_view(node_load(array('nid' => $node->nid, 'type' => $node->type)), 1); + } + $output .= theme('pager', NULL, variable_get('default_nodes_main', 10)); + } + else { + $output = t(" +

Welcome to your new Drupal-powered website. This welcome message will guide you through your first steps with Drupal, and will disappear once you've posted your first piece of content.

+

The first thing you'll need to do is create the first account. This account will have full administration rights and will allow you to further configure your website. Once you are logged in, you can go to the administration section and set up your site's configuration.

+

Drupal's functionality is contained in 'modules', each with a specific function. You should visit the module list and enable those modules necessary for your particular website.

+

The presentation of your website is handled by 'themes'. You can use one of the existing themes, modify them, or create your own from scratch.

+

We suggest you look around the administration section and explore the various options Drupal offers you. For more information, you can refer to the Drupal handbook online.

", array('%drupal' => 'http://www.drupal.org/', '%register' => url('user/register'), '%admin' => url('admin'), '%config' => url('admin/system'), '%modules' => url('admin/system/modules'), '%themes' => url('admin/system/themes'), '%handbook' => 'http://www.drupal.org/handbook')); + } + + return $output; +} + function node_page() { if (user_access('access content')) { $op = $_POST['op'] ? $_POST['op'] : arg(1); @@ -1538,15 +1562,7 @@ function node_page() { print theme('page', node_delete($edit), t('Delete %name', array('%name' => $name))); break; default: - $output = ''; - $result = pager_query('SELECT nid, type FROM {node} WHERE promote = 1 AND status = 1 ORDER BY static DESC, created DESC', variable_get('default_nodes_main', 10)); - - while ($node = db_fetch_object($result)) { - $output .= node_view(node_load(array('nid' => $node->nid, 'type' => $node->type)), 1); - } - $output .= theme('pager', NULL, variable_get('default_nodes_main', 10)); - drupal_set_html_head(''); - print theme('page', $output, ''); + print theme('page', node_page_default(), ''); } } else { -- cgit v1.2.3