Same name and namespace in other branches
  1. 4.6.x modules/node.module \node_page_default()
  2. 5.x modules/node/node.module \node_page_default()
  3. 6.x modules/node/node.module \node_page_default()
  4. 7.x modules/node/node.module \node_page_default()

Generate a listing of promoted nodes.

File

modules/node.module, line 2033
The core that allows content to be submitted to the site.

Code

function node_page_default() {
  $result = pager_query(db_rewrite_sql('SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main', 10));
  if (db_num_rows($result)) {
    drupal_add_link(array(
      'rel' => 'alternate',
      'type' => 'application/rss+xml',
      'title' => t('RSS'),
      'href' => url('rss.xml', NULL, NULL, TRUE),
    ));
    $output = '';
    while ($node = db_fetch_object($result)) {
      $output .= node_view(node_load($node->nid), 1);
    }
    $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
  }
  else {
    $output = t('
      <h1 class="title">Welcome to your new Drupal website!</h1>
      <p>Please follow these steps to set up and start using your website:</p>
      <ol>
        <li>
          <strong>Create your administrator account</strong>
          To begin, <a href="%register">create the first account</a>. This account will have full administration rights and will allow you to configure your website.
        </li>
        <li>
          <strong>Configure your website</strong>
          Once logged in, visit the <a href="%admin">administration section</a>, where you can <a href="%config">customize and configure</a> all aspects of your website.
        </li>
        <li>
          <strong>Enable additional functionality</strong>
          Next, visit the <a href="%modules">module list</a> and enable features which suit your specific needs. You can find additional modules in the <a href="%download_modules">Drupal modules download section</a>.
        </li>
        <li>
          <strong>Customize your website design</strong>
          To change the "look and feel" of your website, visit the <a href="%themes">themes section</a>. You may choose from one of the included themes or download additional themes from the <a href="%download_themes">Drupal themes download section</a>.
        </li>
        <li>
          <strong>Start posting content</strong>
          Finally, you can <a href="%content">create content</a> for your website. This message will disappear once you have published your first post.
        </li>
      </ol>
      <p>For more information, please refer to the <a href="%help">Help section</a>, or the <a href="%handbook">online Drupal handbooks</a>. You may also post at the <a href="%forum">Drupal forum</a>, or view the wide range of <a href="%support">other support options</a> available.</p>', array(
      '%drupal' => 'http://drupal.org/',
      '%register' => url('user/register'),
      '%admin' => url('admin'),
      '%config' => url('admin/settings'),
      '%modules' => url('admin/modules'),
      '%download_modules' => 'http://drupal.org/project/modules',
      '%themes' => url('admin/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 = '<div id="first-time">' . $output . '</div>';
  }
  return $output;
}