Make WordPress Core


Ignore:
Timestamp:
04/01/2006 10:59:31 PM (20 years ago)
Author:
ryan
Message:

Make setup-config purtier. Props Potter_System. fixes #2618

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/setup-config.php

    r3643 r3673  
    22define('WP_INSTALLING', true);
    33
    4 if (file_exists('../wp-config.php'))
    5     die("The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.");
    6 
    74if (!file_exists('../wp-config-sample.php'))
    85    die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.');
     6
    97$configFile = file('../wp-config-sample.php');
    108
    119if (!is_writable('../')) die("Sorry, I can't write to the directory. You'll have to either change the permissions on your WordPress directory or create your wp-config.php manually.");
    1210
    13 $step = 0;
    14 if(isset($_GET['step'])) $step = $_GET['step'];
     11
     12if (isset($_GET['step']))
     13    $step = $_GET['step'];
     14else
     15    $step = 0;
    1516header( 'Content-Type: text/html; charset=utf-8' );
    16 
    17 function setup_header() { ?>
     17?>
    1818<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    1919<html xmlns="http://www.w3.org/1999/xhtml">
     
    2222<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    2323<style media="screen" type="text/css">
    24     <!--
     24    <!--
     25    html {
     26        background: #eee;
     27    }
    2528    body {
     29        background: #fff;
     30        color: #000;
    2631        font-family: Georgia, "Times New Roman", Times, serif;
    27         margin-left: 15%;
    28         margin-right: 15%;
     32        margin-left: 20%;
     33        margin-right: 20%;
     34        padding: .2em 2em;
     35    }
     36
     37    h1 {
     38        color: #006;
     39        font-size: 18px;
     40        font-weight: lighter;
     41    }
     42
     43    h2 {
     44        font-size: 16px;
     45    }
     46
     47    p, li, dt {
     48        line-height: 140%;
     49        padding-bottom: 2px;
     50    }
     51
     52    ul, ol {
     53        padding: 5px 5px 5px 20px;
    2954    }
    3055    #logo {
    31         margin: 0;
    32         padding: 0;
    33         background-image: url(http://wordpress.org/images/logo.png);
    34         background-repeat: no-repeat;
    35         height: 60px;
    36         border-bottom: 4px solid #333;
     56        margin-bottom: 2em;
    3757    }
    38     #logo a {
    39         display: block;
    40         height: 60px;
     58    .step a, .step input {
     59        font-size: 2em;
    4160    }
    42     #logo a span {
    43         display: none;
     61    td input {
     62        font-size: 1.5em;
    4463    }
    45     p, li {
    46         line-height: 140%;
     64    .step, th {
     65        text-align: right;
    4766    }
    48     -->
     67    #footer {
     68        text-align: center;
     69        border-top: 1px solid #ccc;
     70        padding-top: 1em;
     71        font-style: italic;
     72    }
     73    -->
    4974    </style>
    5075</head>
    51 <body> 
    52 <h1 id="logo"><a href="http://wordpress.org/"><span>WordPress</span></a></h1>
     76<body>
     77<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
    5378<?php
    54 }
     79// Check if wp-config.php has been created
     80if (file_exists('../wp-config.php'))
     81    die("<p>The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p></body></html>");
    5582
    5683switch($step) {
    5784    case 0:
    58     setup_header();
    5985?>
    6086
     
    6389  <li>Database name</li>
    6490  <li>Database username</li>
    65   <li>Database password</li> 
     91  <li>Database password</li>
    6692  <li>Database host</li>
    6793  <li>Table prefix (if you want to run more than one WordPress in a single database) </li>
     
    7399
    74100    case 1:
    75     setup_header();
    76101    ?>
    77102</p>
    78 <form method="post" action="setup-config.php?step=2"> 
     103<form method="post" action="setup-config.php?step=2">
    79104  <p>Below you should enter your database connection details. If you're not sure about these, contact your host. </p>
    80105  <table>
    81106    <tr>
    82107      <th scope="row">Database Name</th>
    83       <td><input name="dbname" type="text" size="45" value="wordpress" /></td>
     108      <td><input name="dbname" type="text" size="25" value="wordpress" /></td>
    84109      <td>The name of the database you want to run WP in. </td>
    85110    </tr>
    86111    <tr>
    87112      <th scope="row">User Name</th>
    88       <td><input name="uname" type="text" size="45" value="username" /></td>
     113      <td><input name="uname" type="text" size="25" value="username" /></td>
    89114      <td>Your MySQL username</td>
    90115    </tr>
    91116    <tr>
    92117      <th scope="row">Password</th>
    93       <td><input name="pwd" type="text" size="45" value="password" /></td>
     118      <td><input name="pwd" type="text" size="25" value="password" /></td>
    94119      <td>...and MySQL password.</td>
    95120    </tr>
    96121    <tr>
    97122      <th scope="row">Database Host</th>
    98       <td><input name="dbhost" type="text" size="45" value="localhost" /></td>
     123      <td><input name="dbhost" type="text" size="25" value="localhost" /></td>
    99124      <td>99% chance you won't need to change this value.</td>
    100125    </tr>
    101126    <tr>
    102127      <th scope="row">Table Prefix</th>
    103       <td><input name="prefix" type="text" id="prefix" value="wp_" size="45" /></td>
     128      <td><input name="prefix" type="text" id="prefix" value="wp_" size="25" /></td>
    104129      <td>If you want to run multiple WordPress installations in a single database, change this.</td>
    105130    </tr>
    106   </table>
    107   <input name="submit" type="submit" value="Submit" />
     131  </table>
     132  <h2 class="step">
     133  <input name="submit" type="submit" value="Submit" />
     134  </h2>
    108135</form>
    109136<?php
     
    151178    fclose($handle);
    152179    chmod('../wp-config.php', 0666);
    153     setup_header();
    154180?>
    155181<p>All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to <a href="install.php">run the install!</a></p>
    156182<?php
    157183    break;
    158 
    159184}
    160 ?>
     185?>
     186<p id="footer"><a href="http://wordpress.org/">WordPress</a>, personal publishing platform.</p>
    161187</body>
    162188</html>
Note: See TracChangeset for help on using the changeset viewer.