home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Blogs / wordpress2.6.exe / wordpress2.6 / wp-admin / install.php < prev    next >
Encoding:
PHP Script  |  2008-07-10  |  4.2 KB  |  110 lines

  1. <?php
  2. define('WP_INSTALLING', true);
  3.  
  4. require_once('../wp-load.php');
  5. require_once('./includes/upgrade.php');
  6.  
  7. if (isset($_GET['step']))
  8.     $step = $_GET['step'];
  9. else
  10.     $step = 0;
  11. function display_header(){
  12. header( 'Content-Type: text/html; charset=utf-8' );
  13. ?>
  14. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  15. <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
  16. <head>
  17.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  18.     <title><?php _e('WordPress › Installation'); ?></title>
  19.     <?php wp_admin_css( 'install', true ); ?>
  20. </head>
  21. <body>
  22. <h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
  23.  
  24. <?php
  25. }//end function display_header();
  26.  
  27. // Let's check to make sure WP isn't already installed.
  28. if ( is_blog_installed() ) {display_header(); die('<h1>'.__('Already Installed').'</h1><p>'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'</p></body></html>');}
  29.  
  30. switch($step) {
  31.     case 0:
  32.     case 1: // in case people are directly linking to this
  33.       display_header();
  34. ?>
  35. <h1><?php _e('Welcome'); ?></h1>
  36. <p><?php printf(__('Welcome to the famous five minute WordPress installation process! You may want to browse the <a href="%s">ReadMe documentation</a> at your leisure.  Otherwise, just fill in the information below and you\'ll be on your way to using the most extendable and powerful personal publishing platform in the world.'), '../readme.html'); ?></p>
  37. <!--<h2 class="step"><a href="install.php?step=1"><?php _e('First Step'); ?></a></h2>-->
  38.  
  39. <h1><?php _e('Information needed'); ?></h1>
  40. <p><?php _e("Please provide the following information.  Don't worry, you can always change these settings later."); ?></p>
  41.  
  42. <form id="setup" method="post" action="install.php?step=2">
  43.     <table class="form-table">
  44.         <tr>
  45.             <th scope="row"><label for="weblog_title"><?php _e('Blog Title'); ?></label></th>
  46.             <td><input name="weblog_title" type="text" id="weblog_title" size="25" /></td>
  47.         </tr>
  48.         <tr>
  49.             <th scope="row"><label for="admin_email"><?php _e('Your E-mail'); ?></label></th>
  50.             <td><input name="admin_email" type="text" id="admin_email" size="25" /><br />
  51.             <?php _e('Double-check your email address before continuing.'); ?>
  52.         </tr>
  53.         <tr>
  54.             <td colspan="2"><label><input type="checkbox" name="blog_public" value="1" checked="checked" /> <?php _e('Allow my blog to appear in search engines like Google and Technorati.'); ?></label></td>
  55.         </tr>
  56.     </table>
  57.     <p class="step"><input type="submit" name="Submit" value="<?php _e('Install WordPress'); ?>" class="button" /></p>
  58. </form>
  59.  
  60. <?php
  61.         break;
  62.     case 2:
  63.         if ( !empty($wpdb->error) )
  64.             wp_die($wpdb->error->get_error_message());
  65.  
  66.         display_header();
  67.         // Fill in the data we gathered
  68.         $weblog_title = stripslashes($_POST['weblog_title']);
  69.         $admin_email = stripslashes($_POST['admin_email']);
  70.         $public = (int) $_POST['blog_public'];
  71.         // check e-mail address
  72.         if (empty($admin_email)) {
  73.             // TODO: poka-yoke
  74.             die('<p>'.__("<strong>ERROR</strong>: you must provide an e-mail address.").'</p>');
  75.         } else if (!is_email($admin_email)) {
  76.             // TODO: poka-yoke
  77.             die('<p>'.__('<strong>ERROR</strong>: that isn’t a valid e-mail address.  E-mail addresses look like: <code>username@example.com</code>').'</p>');
  78.         }
  79.  
  80.         $wpdb->show_errors();
  81.         $result = wp_install($weblog_title, 'admin', $admin_email, $public);
  82.         extract($result, EXTR_SKIP);
  83. ?>
  84.  
  85. <h1><?php _e('Success!'); ?></h1>
  86.  
  87. <p><?php printf(__('WordPress has been installed. Were you expecting more steps? Sorry to disappoint.'), ''); ?></p>
  88.  
  89. <table class="form-table">
  90.     <tr>
  91.         <th><?php _e('Username'); ?></th>
  92.         <td><code>admin</code></td>
  93.     </tr>
  94.     <tr>
  95.         <th><?php _e('Password'); ?></th>
  96.         <td><code><?php echo $password; ?></code><br />
  97.             <?php echo '<p>'.__('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.').'</p>'; ?></td>
  98.     </tr>
  99. </table>
  100.  
  101. <p class="step"><a href="../wp-login.php" class="button"><?php _e('Log In'); ?></a></p>
  102.  
  103. <?php
  104.         break;
  105. }
  106. ?>
  107. <script type="text/javascript">var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script>
  108. </body>
  109. </html>
  110.