3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4 * Copyright (C) 2002-2004 The Nucleus Group
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 * (see nucleus/documentation/index.html#license for more info)
11 * This script will install the Nucleus tables in your SQL-database, and initialize the data in
14 * Below is a friendly way of letting users on non-php systems know that Nucleus won't run there.
16 * ?><div style="font-size: xx-large;">If you see this text in your browser when you open <i>install.php</i>, your web server is not able to run PHP-scripts, and therefor Nucleus will not be able to run there. </div><div style="display: none"><?php */
19 This part of the install.php code allows for customization of the install process.
20 When distributing plugins or skins together with a Nucleus installation, the
21 configuration below will instruct to install them
23 -- Start Of Configurable Part --
26 // array with names of plugins to install. Plugin files must be present in the nucleus/plugin/
30 // array('NP_TrackBack', 'NP_MemberGoodies')
31 $aConfPlugsToInstall = array();
34 // array with skins to install. skins must be present under the skins/ directory with
35 // a subdirectory having the same name that contains a skinbackup.xml file
38 // array('base','rsd')
39 $aConfSkinsToImport = array();
42 -- End Of Configurable Part --
45 // don't give warnings for uninitialized vars
46 error_reporting(E_ERROR | E_WARNING | E_PARSE);
48 // make sure there's no unnecessary escaping:
49 set_magic_quotes_runtime(0);
51 // if there are some plugins or skins to import, do not include vars
52 // in globalfunctions.php again... so set a flag
53 if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0)) {
55 $CONF['installscript']=1;
57 if (phpversion() >= '4.1.0')
58 include_once('nucleus/libs/vars4.1.0.php');
60 include_once('nucleus/libs/vars4.0.6.php');
62 // check if mysql support is installed
63 if (!function_exists('mysql_query'))
64 _doError('Your PHP version does not have support for MySQL :(');
66 if (postVar('action') == 'go')
72 function showInstallForm() {
74 // 0. pre check if all necessary files exist
79 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
80 <html xmlns="http://www.w3.org/1999/xhtml">
82 <meta http-equiv="content-type" content="application/xhtml+xml; charset=EUC-JP" />
83 <title>Nucleus¤Î¥¤¥ó¥¹¥È¡¼¥ë</title>
84 <style type="text/css"><!--
85 @import url('nucleus/documentation/styles/manual.css');
87 <script type="text/javascript"><!--
88 // function to make sure the submit button only gets pressed once
90 function checkSubmit() {
91 if (submitcount == 0) {
102 <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->
104 <form method="post" action="install.php">
106 <h1>Install Nucleus</h1>
109 ¤³¤Î¥¹¥¯¥ê¥×¥È¤ÏNucleus¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ò¼ê½õ¤±¤·¤Þ¤¹¡£MySQL¥Æ¡¼¥Ö¥ë¤Î¥»¥Ã¥È¥¢¥Ã¥×¤È¡¢<i>config.php</i>¤ËÆþÎϤ¹¤ë¤¿¤á¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡Êconfig.php¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò0666¤Ë¤·¤Æ¤ª¤±¤Ð¡¢¸å¼Ô¤Îºî¶È¤Ï¼«Æ°Åª¤Ë¹Ô¤ï¤ì¤Þ¤¹¡Ë¡£¤³¤ì¤ò¤Ê¤¹°Ù¤Ë¡¢¤¤¤¯¤Ä¤«¤Î¾ðÊó¤òÆþÎϤ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
113 ¤¹¤Ù¤Æ¤ÎÍó¤ÎÆþÎϤ¬É¬ÍפǤ¹¡£¥ª¥×¥·¥ç¥ó¾ðÊó¤Ï¥¤¥ó¥¹¥È¡¼¥ë¤¬´°Î»¤·¤¿¤é¡¢Nucleus¤Î´ÉÍýÎΰ褫¤éÀßÄê²Äǽ¤Ç¤¹¡£
116 <h1>PHP & MySQL Versions</h1>
119 °Ê²¼¤Ï¤¢¤Ê¤¿¤Î¥¦¥§¥Ö¥Û¥¹¥È¤Ë¤ª¤±¤ëPHP¥¤¥ó¥¿¡¼¥×¥ê¥¿¡¼¤ÈMySQL¥µ¡¼¥Ð¡¼¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤¹¡£Nucleus¤Î¥µ¥Ý¡¼¥È¥Õ¥©¡¼¥é¥à¤ËÌäÂê¤òÊó¹ð¤¹¤ë¤È¤¤Ï¡¢¤³¤Î¾ðÊó¤ò½ñ¤Åº¤¨¤Æ¤¯¤À¤µ¤¤¡£
123 <li>PHP: <?php echo phpversion();
124 $minVersion = '4.0.6';
126 if (phpversion() < $minVersion)
127 echo ' <span class="warning">Ãí°Õ: Nucleus¤ÎÆ°ºî¤Ë¤Ï¾¯¤Ê¤¯¤È¤â¥Ð¡¼¥¸¥ç¥ó ',$minVersion,' ¤¬É¬ÍפȤµ¤ì¤Þ¤¹</span>';
130 // note: this piece of code is taken from phpMyAdmin
132 $result = @mysql_query('SELECT VERSION() AS version');
133 if ($result != FALSE && @mysql_num_rows($result) > 0) {
134 $row = mysql_fetch_array($result);
135 $match = explode('.', $row['version']);
137 $result = @mysql_query('SHOW VARIABLES LIKE \'version\'');
138 if ($result != FALSE && @mysql_num_rows($result) > 0){
139 $row = mysql_fetch_row($result);
140 $match = explode('.', $row[1]);
148 if (!isset($match) || !isset($match[0])) {
151 if (!isset($match[1])) {
154 if (!isset($match[2])) {
158 if ($match[0] != '?') {
159 $match[0] = intval($match[0]);
160 $match[1] = intval($match[1]);
163 $mysqlVersion = implode($match, '.');
164 $minVersion = '3.23';
168 if ($mysqlVersion < $minVersion)
169 echo ' <span class="warning">Ãí°Õ: Nucleus¤ÎÆ°ºî¤Ë¤Ï¾¯¤Ê¤¯¤È¤â¥Ð¡¼¥¸¥ç¥ó ',$minVersion,' ¤¬É¬ÍפȤµ¤ì¤Þ¤¹</span>';
174 // tell people how they can have their config file filled out automatically
175 if (@file_exists('config.php') && @!is_writable('config.php')) {
177 <h1><i>config.php</i>¤Î¼«Æ°¥¢¥Ã¥×¥Ç¡¼¥È</h1>
180 ¤â¤·<em>config.php</em>¤ò¼«Æ°Åª¤Ë¹¹¿·¤¹¤ë¤è¤¦¤Ë¤·¤¿¤¤¤Ê¤é¡¢½ñ¤¹þ¤ß²Äǽ¤Ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£<em>config.php</em>¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò<strong>666</strong>¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£Nucleus¤Î¥¤¥ó¥¹¥È¡¼¥ëÀ®¸ù¸å¤Ë¡¢¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò<strong>444</strong>¤ËÌᤵ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡Ê<a href="nucleus/documentation/tips.html#filepermissions">¥Ñ¡¼¥ß¥Ã¥·¥ç¥óÊѹ¹¤Î´Ê°×¥¬¥¤¥É</a>¡Ë¡£
184 ¤â¤·¥Õ¥¡¥¤¥ë¤Ë½ñ¤¹þ¤Þ¤Ê¤¤¤È¤¤¤¦ÁªÂò¤ò¤·¤¿¡Ê¤¢¤ë¤¤¤Ï¹Ô¤¨¤Ê¤¤¡Ë¾ì¹ç¡§¤´¿´Çۤʤ¯¡£¥¤¥ó¥¹¥È¡¼¥ë¤Î²áÄø¤Ç<em>config.php</em>¤ÎÃæ¿È¤¬Ä󶡤µ¤ì¤Þ¤¹¡£¤Ç¤¹¤«¤é¡¢¤½¤ì¤ò¤´¼«¿È¤Ç¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£
189 <h1>MySQL¤Î¥í¥°¥¤¥ó¥Ç¡¼¥¿</h1>
192 MySQL¤Î¥Ç¡¼¥¿¤ò°Ê²¼¤ËÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£¤½¤ì¤é¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¡¦¥Æ¡¼¥Ö¥ë¤òºîÀ®¤·¾ðÊó¤òÆþÎϤ¹¤ë¤¿¤á¤ËɬÍפʤâ¤Î¤Ç¤¹¡£¸å¤Ç¡¢<i>config.php</i>¤Ë¤âµÆþ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡Ê¾åµ¤Î¼«Æ°¥¢¥Ã¥×¥Ç¡¼¥È¤òÍøÍѤ¹¤ë¾ì¹ç¡¢¤½¤Î¼ê½ç¤Ï¾Êά¤µ¤ì¤Þ¤¹¡Ë¡£
196 ¤â¤·¤³¤Î¾ðÊ󤬤狼¤é¤Ê¤±¤ì¤Ð¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô¤«¥Û¥¹¥Æ¥£¥ó¥°¸µ¤ËÏ¢Íí¤ò¤È¤Ã¤Æ¤¯¤À¤µ¤¤¡£¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢¥Û¥¹¥È̾¤Ï'localhost'¤Ç¤¹¡£¤â¤·Nucleus¤¬¤¢¤Ê¤¿¤Î¥µ¡¼¥Ð¤ÎPHPÀßÄ꤫¤é'default MySQL host'¤ò¸¡ÃΤ·¤¿¤Ê¤é¡¢'¥Û¥¹¥È̾'¤Ë´û¤ËµÆþ¤µ¤ì¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¡£¤â¤Ã¤È¤â¡¢¤³¤Î¾ðÊó¤¬Àµ³Î¤Ç¤¢¤ë¤È¤¤¤¦ÊݾڤϤ¢¤ê¤Þ¤»¤ó¡£
200 <legend>´ðËܤΥǡ¼¥¿¥Ù¡¼¥¹ÀßÄê</legend>
203 <td><input name="mySQL_host" value="<?php echo htmlspecialchars(@ini_get('mysql.default_host'))?>" /></td>
205 <td>¥æ¡¼¥¶¡¼Ì¾¡§</td>
206 <td><input name="mySQL_user" /></td>
208 <td>¥Ñ¥¹¥ï¡¼¥É¡§</td>
209 <td><input name="mySQL_password" type="password" /></td>
211 <td>¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¡§</td>
212 <td><input name="mySQL_database" /> (<input name="mySQL_create" value="1" type="checkbox" id="mySQL_create"><label for="mySQL_create" />¥Ç¡¼¥¿¥Ù¡¼¥¹¤òºîÀ®¤¹¤ëɬÍפ¬¤¢¤ë</label>)</td>
217 <legend>¹âÅù¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹ÀßÄê</legend>
219 <td><input name="mySQL_usePrefix" value="1" type="checkbox" id="mySQL_usePrefix"><label for="mySQL_usePrefix" />¥Æ¡¼¥Ö¥ë¡¦¥×¥ê¥Õ¥£¥Ã¥¯¥¹¤òÍøÍÑ</label></td>
220 <td><input name="mySQL_tablePrefix" value="" /></td>
222 <p>°ì¤Ä¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÊ£¿ô¤ÎNucleus¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤ª¤ê¡¢¼«Ê¬¤¬²¿¤ò¤ä¤Ã¤Æ¤¤¤ë¤Î¤«Íý²ò¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤ò½ü¤¤¤Æ¤Ï¡¢<strong>¤³¤ì¤òÊѹ¹¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó</strong>¡£</p>
223 <p>Nucleus¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤¿¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Æ¡¼¥Ö¥ë¤Ï¡¢¤³¤Î¥×¥ê¥Õ¥£¥Ã¥¯¥¹¤¬Æ¬¤Ë¤Ä¤¤Þ¤¹¡£</p>
226 <h1>¥Ç¥£¥ì¥¯¥È¥ê¤ÈURL</h1>
229 ¤³¤Î¥¤¥ó¥¹¥È¡¼¥ë¥¹¥¯¥ê¥×¥È¤ÏNucleus¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÈURL¤ò¸«¤Ä¤±¤è¤¦¤È¤·¤Þ¤·¤¿¡£²¼¤ÎÃͤò¥Á¥§¥Ã¥¯¤·¤ÆɬÍפʤéÄûÀµ¤·¤Æ¤¯¤À¤µ¤¤¡£¥Õ¥¡¥¤¥ë¤Ø¤Î¥Ñ¥¹¤ÈURL¤Ï¥¹¥é¥Ã¥·¥å'/'¤Ç½ª¤ï¤é¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
233 <legend>URLs and directories</legend>
235 <td>Site <strong>URL</strong>:</td>
237 <input name="IndexURL" size="60" value="<?php $url = "http://" . serverVar('HTTP_HOST') . serverVar('PHP_SELF');
238 $url = str_replace("install.php",'',$url);
239 $url = str_replace("\\","/",$url);
240 // add slash at end if necessary
241 if (!endsWithSlash($url)) $url .= '/';
246 <td>Admin-area <strong>URL</strong>:</td>
247 <td><input name="AdminURL" size="60" value="<?php if ($url) echo $url . 'nucleus/';
251 <td>Admin-area <strong>path</strong>:</td>
252 <td><input name="AdminPath" size="60" value="<?php $path = str_replace("install.php",'',serverVar('SCRIPT_FILENAME'));
253 $path = str_replace("\\","/",$path);
254 // add slash at end if necessary
255 if (!endsWithSlash($path)) $path .= '/';
256 if($path) echo $path . 'nucleus/';
260 <td>Media files <strong>URL</strong>:</td>
261 <td><input name="MediaURL" size="60" value="<?php if ($url) echo $url . 'media/';
265 <td>Media directory <strong>path</strong>:</td>
266 <td><input name="MediaPath" size="60" value="<?php $path = str_replace("install.php",'',serverVar('SCRIPT_FILENAME'));
267 $path = str_replace("\\","/",$path);
268 // add slash at end if necessary
269 if (!endsWithSlash($path)) $path .= '/';
270 if ($path) echo $path . 'media/';
274 <td>Extra skin files <strong>URL</strong>:</td>
275 <td><input name="SkinsURL" size="60" value="<?php if ($url) echo $url . 'skins/';
277 <br />(¥¤¥ó¥Ý¡¼¥È¤µ¤ì¤¿¥¹¥¥ó¤¬»ÈÍÑ)
280 <td>Extra skin files directory <strong>path</strong>:</td>
281 <td><input name="SkinsPath" size="60" value="<?php $path = str_replace("install.php",'',serverVar('SCRIPT_FILENAME'));
282 $path = str_replace("\\","/",$path);
283 // add slash at end if necessary
284 if (!endsWithSlash($path)) $path .= '/';
285 if ($path) echo $path . 'skins/';
287 <br />(¥¤¥ó¥Ý¡¼¥È¤µ¤ì¤¿¥¹¥¥ó¤Î¥Õ¥¡¥¤¥ëÎà¤òÃÖ¤¯¾ì½ê)
290 <td>Plugin files <strong>URL</strong>:</td>
291 <td><input name="PluginURL" size="60" value="<?php if ($url) echo $url . 'nucleus/plugins/';
295 <td>Action <strong>URL</strong>:</td>
296 <td><input name="ActionURL" size="60" value="<?php if ($url) echo $url . 'action.php';
298 <br />(<tt>action.php</tt>¤Ø¤Îhttp://¤«¤é»Ï¤Þ¤ëURL)
304 <strong>ÉÕµ:</strong> ÁêÂХѥ¹¤Ç¤Ï¤Ê¤¯<strong>ÀäÂХѥ¹¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤</strong>¡£Ä̾ÀäÂХѥ¹¤Ï<tt>/home/username/public_html/</tt>¤Î¤è¤¦¤Ê·Á¤ò¤È¤ê¤Þ¤¹¡£Unix¥·¥¹¥Æ¥à¡Ê¤Û¤È¤ó¤É¤Î¥µ¡¼¥Ð¡¼¤¬¤½¤¦¤Ç¤¹¡Ë¤Ë¤ª¤¤¤Æ¡¢¥Ñ¥¹¤Ï¥¹¥é¥Ã¥·¥å¤«¤é»Ï¤Þ¤ê¤Þ¤¹¡£¤â¤·¤³¤ì¤é¤Î¾ðÊóÆþÎϤËÌäÂ꤬À¸¤¸¤¿¤é¡¢¤¢¤Ê¤¿¤Î¥µ¡¼¥Ð´ÉÍý¼Ô¤Ë¤¿¤º¤Í¤ë¤Ù¤¤Ç¤¹¡£
307 <h1>´ÉÍý¸¢¸Â¤ò¤â¤Ä¥æ¡¼¥¶¡¼</h1>
309 <p>°Ê²¼¤Ë¡¢¥µ¥¤¥È¤ÎºÇ½é¤Î¥æ¡¼¥¶¡¼¤òºîÀ®¤¹¤ë¤¿¤á¤Î¤¤¤¯¤Ä¤«¤Î¾ðÊó¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£</p>
312 <legend>´ÉÍý¸¢¸Â¤ò»ý¤Ä¥æ¡¼¥¶¡¼</legend>
314 <td>ɽ¼¨¤µ¤ì¤ë̾Á°¡§</td>
316 <input name="User_name" value="" />
317 <small>(µö²Ä¤µ¤ì¤ëʸ»ú¡§a-z ¤È 0-9¡¢ºÇ½é¤ÈºÇ¸å°Ê³°¤Î¥¹¥Ú¡¼¥¹)</small>
320 <td>ËÜ̾¡Ê¥Ï¥ó¥É¥ë̾¡Ë¡§</td>
321 <td><input name="User_realname" value="" /></td>
323 <td>¥Ñ¥¹¥ï¡¼¥É¡§</td>
324 <td><input name="User_password" type="password" value="" /></td>
326 <td>¥Ñ¥¹¥ï¡¼¥É¤Î³Îǧ¡§</td>
327 <td><input name="User_password2" type="password" value="" /></td>
329 <td>¥á¡¼¥ë¥¢¥É¥ì¥¹¡§</td>
331 <input name="User_email" value="" />
332 <small>(ÍøÍѲÄǽ¤Ê¥á¡¼¥ë¥¢¥É¥ì¥¹¤òÆþ¤ì¤Æ¤¯¤À¤µ¤¤)</small>
337 <h1>¥¦¥§¥Ö¥í¥°¤Î¥Ç¡¼¥¿</h1>
339 <p>°Ê²¼¤Ë¡¢¥Ç¥Õ¥©¥ë¥È¤Îweblog¤òºîÀ®¤¹¤ë¤¿¤á¤Ë¤¤¤¯¤Ä¤«¤Î¾ðÊó¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£¤³¤Îweblog¤Î̾Á°¤Ï¡¢¥µ¥¤¥È̾¤È¤·¤Æ¤âÍøÍѤµ¤ì¤Þ¤¹¡£</p>
342 <legend>¥¦¥§¥Ö¥í¥°¤Î¥Ç¡¼¥¿</legend>
345 <td><input name="Blog_name" size="60" value="My Nucleus Weblog" /></td>
347 <td>Blog¤Îû½Ì̾¡§</td>
349 <input name="Blog_shortname" value="myweblog" />
350 <small>(µö²Ä¤µ¤ì¤ëʸ»ú¡§a-z ¤È 0-9¡¢¥¹¥Ú¡¼¥¹¤ÏÉÔ²Ä)</small>
355 <h1>¥Ç¡¼¥¿¤ÎÁ÷¿®</h1>
358 ¾å¤Ë½ñ¤¤¤Æ¤¤¿¥Ç¡¼¥¿¤¬Àµ¤·¤¤¤«³Î¤«¤á¤Æ¤¯¤À¤µ¤¤¡£¤è¤±¤ì¤Ð¥Ç¡¼¥¿¥Ù¡¼¥¹¡¦¥Æ¡¼¥Ö¥ë¤ÈºÇ½é¤Î¥Ç¡¼¥¿¤òÀßÄꤹ¤ë¤¿¤á¤Ë²¼¤Î¥Ü¥¿¥ó¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£¾¯¤·»þ´Ö¤¬¤«¤«¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¤´¿ÉÊú¤ò¡£<b>¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤Î¤Ï°ì²ó¤À¤±¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£</b>
362 <input name="action" value="go" type="hidden" />
363 <input type="submit" value="Install Nucleus" onclick="return checkSubmit();" />
374 function tableName($unPrefixed)
376 global $mysql_usePrefix, $mysql_prefix;
377 if ($mysql_usePrefix == 1)
378 return $mysql_prefix . $unPrefixed;
383 function doInstall() {
384 global $mysql_usePrefix, $mysql_prefix;
386 // 0. put all POST-vars into vars
387 $mysql_host = postVar('mySQL_host');
388 $mysql_user = postVar('mySQL_user');
389 $mysql_password = postVar('mySQL_password');
390 $mysql_database = postVar('mySQL_database');
391 $mysql_create = postVar('mySQL_create');
392 $mysql_usePrefix = postVar('mySQL_usePrefix');
393 $mysql_prefix = postVar('mySQL_tablePrefix');
394 $config_indexurl = postVar('IndexURL');
395 $config_adminurl = postVar('AdminURL');
396 $config_adminpath = postVar('AdminPath');
397 $config_mediaurl = postVar('MediaURL');
398 $config_skinsurl = postVar('SkinsURL');
399 $config_pluginurl = postVar('PluginURL');
400 $config_actionurl = postVar('ActionURL');
401 $config_mediapath = postVar('MediaPath');
402 $config_skinspath = postVar('SkinsPath');
403 $user_name = postVar('User_name');
404 $user_realname = postVar('User_realname');
405 $user_password = postVar('User_password');
406 $user_password2 = postVar('User_password2');
407 $user_email = postVar('User_email');
408 $blog_name = postVar('Blog_name');
409 $blog_shortname = postVar('Blog_shortname');
410 $config_adminemail = $user_email;
411 $config_sitename = $blog_name;
414 $config_indexurl = str_replace("\\","/",$config_indexurl);
415 $config_adminurl = str_replace("\\","/",$config_adminurl);
416 $config_mediaurl = str_replace("\\","/",$config_mediaurl);
417 $config_skinsurl = str_replace("\\","/",$config_skinsurl);
418 $config_pluginurl = str_replace("\\","/",$config_pluginurl);
419 $config_actionurl = str_replace("\\","/",$config_actionurl);
420 $config_adminpath = str_replace("\\","/",$config_adminpath);
421 $config_skinspath = str_replace("\\","/",$config_skinspath);
423 // 1. check all the data
426 if (!$mysql_database)
427 array_push($errors,"mySQL database name missing");
428 if (($mysql_usePrefix == 1) && (strlen($mysql_prefix) == 0))
429 array_push($errors,"mySQL prefix was selected, but prefix is empty");
430 if (($mysql_usePrefix == 1) && (!eregi('^[a-zA-Z0-9_]+$', $mysql_prefix)))
431 array_push($errors,"mySQL prefix should only contain characters from the ranges A-Z, a-z, 0-9 or underscores");
432 if (!endsWithSlash($config_indexurl) || !endsWithSlash($config_adminurl)
433 || !endsWithSlash($config_mediaurl)
434 || !endsWithSlash($config_pluginurl)
435 || !endsWithSlash($config_skinsurl)
436 // TODO: add action.php check
438 array_push($errors,"One of the URLs does not end with a slash, or action url does not end with 'action.php'");
439 if (!endsWithSlash($config_adminpath))
440 array_push($errors,"The path of the administration area does not end with a slash");
441 if (!endsWithSlash($config_mediapath))
442 array_push($errors,"The media path does not end with a slash");
443 if (!endsWithSlash($config_skinspath))
444 array_push($errors,"The skins path does not end with a slash");
445 if (!is_dir($config_adminpath))
446 array_push($errors,"The path of the administration area does not exist on your server");
447 if (!_isValidMailAddress($user_email))
448 array_push($errors,"Invalid e-mail address given for user");
449 if (!_isValidDisplayName($user_name))
450 array_push($errors,"User name is not a valid display name (allowed chars: a-zA-Z0-9 and spaces)");
451 if (!$user_password || !$user_password2)
452 array_push($errors, "User password is empty");
453 if ($user_password != $user_password2)
454 array_push($errors, "User password do not match");
455 if (!_isValidShortName($blog_shortname))
456 array_push($errors, "Invalid short name given for blog (allowed chars: a-z0-9, no spaces)");
457 if (sizeof($errors) > 0)
458 showErrorMessages($errors);
460 // 2. try to log in to mySQL
461 $connection = @mysql_connect($mysql_host, $mysql_user, $mysql_password);
462 if ($connection == false)
463 _doError("Could not connect to mySQL server: " . mysql_error());
465 // 3. try to create database (if needed)
466 if ($mysql_create == 1) {
467 mysql_query("CREATE DATABASE " . $mysql_database) or _doError("Could not create database. Make sure you have the rights to do so. SQL error was: " . mysql_error());
470 // 4. try to select database
471 mysql_select_db($mysql_database) or _doError("Could not select database. Make sure it exists");
473 // 5. execute queries
474 $filename = "install.sql";
475 $fd = fopen ($filename, "r");
476 $queries = fread ($fd, filesize ($filename));
479 $queries = split("(;\n|;\r)",$queries);
481 $aTableNames = array(
495 'nucleus_activation',
497 // these are unneeded (one of the replacements above takes care of them)
498 // 'nucleus_plugin_event',
499 // 'nucleus_plugin_option',
500 // 'nucleus_plugin_option_desc',
501 // 'nucleus_skin_desc',
502 // 'nucleus_template_desc',
504 $aTableNamesPrefixed = array(
505 $mysql_prefix . 'nucleus_actionlog',
506 $mysql_prefix . 'nucleus_ban',
507 $mysql_prefix . 'nucleus_blog',
508 $mysql_prefix . 'nucleus_category',
509 $mysql_prefix . 'nucleus_comment',
510 $mysql_prefix . 'nucleus_config',
511 $mysql_prefix . 'nucleus_item',
512 $mysql_prefix . 'nucleus_karma',
513 $mysql_prefix . 'nucleus_member',
514 $mysql_prefix . 'nucleus_plugin',
515 $mysql_prefix . 'nucleus_skin',
516 $mysql_prefix . 'nucleus_template',
517 $mysql_prefix . 'nucleus_team',
518 $mysql_prefix . 'nucleus_activation',
519 $mysql_prefix . 'nucleus_tickets'
520 // these are unneeded (one of the replacements above takes care of them)
521 // $mysql_prefix . 'nucleus_plugin_event',
522 // $mysql_prefix . 'nucleus_plugin_option',
523 // $mysql_prefix . 'nucleus_plugin_option_desc',
524 // $mysql_prefix . 'nucleus_skin_desc',
525 // $mysql_prefix . 'nucleus_template_desc',
528 for ($idx = 0;$idx<sizeof($queries);$idx++) {
529 $query = trim($queries[$idx]);
530 // echo "QUERY = <small>" . htmlspecialchars($query) . "</small><p>";
532 if ($mysql_usePrefix == 1)
533 $query = str_replace($aTableNames, $aTableNamesPrefixed, $query);
534 mysql_query($query) or _doError("Error while executing query (<small>" . htmlspecialchars($query) . "</small>): " . mysql_error());
539 // 6. update global settings
540 updateConfig('IndexURL', $config_indexurl);
541 updateConfig('AdminURL', $config_adminurl);
542 updateConfig('MediaURL', $config_mediaurl);
543 updateConfig('SkinsURL', $config_skinsurl);
544 updateConfig('PluginURL', $config_pluginurl);
545 updateConfig('ActionURL', $config_actionurl);
546 updateConfig('AdminEmail', $config_adminemail);
547 updateConfig('SiteName', $config_sitename);
550 // 7. update GOD member
551 $query = 'UPDATE ' . tableName('nucleus_member')
552 . " SET mname='" . addslashes($user_name) . "',"
553 . " mrealname='". addslashes($user_realname) . "',"
554 . " mpassword='". md5(addslashes($user_password)) . "',"
555 . " murl='" . addslashes($config_indexurl) . "',"
556 . " memail='" . addslashes($user_email) . "',"
559 . " WHERE mnumber=1";
560 mysql_query($query) or _doError("Error while setting member settings: " . mysql_error());
562 // 8. update weblog settings
563 $query = 'UPDATE ' . tableName('nucleus_blog')
564 . " SET bname='" . addslashes($blog_name) . "',"
565 . " bshortname='". addslashes($blog_shortname) . "',"
566 . " burl='" . addslashes($config_indexurl) . "'"
567 . " WHERE bnumber=1";
568 mysql_query($query) or _doError("Error while setting weblog settings: " . mysql_error());
570 // 9. update item date
571 $query = 'UPDATE ' . tableName('nucleus_item')
572 . " SET itime='". date("Y-m-d H:i:s",time()) ."'"
573 . " WHERE inumber=1";
574 mysql_query($query) or _doError("Error with query: " . mysql_error());
576 global $aConfPlugsToInstall, $aConfSkinsToImport;
577 $aSkinErrors = array();
578 $aPlugErrors = array();
579 if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0)) {
580 // 10. set global variables
581 global $MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD, $MYSQL_DATABASE, $MYSQL_PREFIX;
582 $MYSQL_HOST = $mysql_host;
583 $MYSQL_USER = $mysql_user;
584 $MYSQL_PASSWORD = $mysql_password;
585 $MYSQL_DATABASE = $mysql_database;
586 $MYSQL_PREFIX = ($mysql_usePrefix == 1)?$mysql_prefix:'';
587 global $DIR_NUCLEUS, $DIR_MEDIA, $DIR_SKINS, $DIR_PLUGINS, $DIR_LANG, $DIR_LIBS;
588 $DIR_NUCLEUS = $config_adminpath;
589 $DIR_MEDIA = $config_mediapath;
590 $DIR_SKINS = $config_skinspath;
591 $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';
592 $DIR_LANG = $DIR_NUCLEUS . 'language/';
593 $DIR_LIBS = $DIR_NUCLEUS . 'libs/';
595 // close database connection (needs to be closed if we want to include globalfunctions.php)
599 include_once($DIR_LIBS . 'globalfunctions.php');
601 // 11. install custom skins
602 $aSkinErrors = installCustomSkins($manager);
604 // 12. install custom plugins
605 $aPlugErrors = installCustomPlugs($manager);
610 // 12. Write config file ourselves (if possible)
612 if (@file_exists('config.php') && is_writable('config.php') && $fp = @fopen('config.php', 'w')) {
613 $config_data = "<" . "?php \n";
614 $config_data .= "\n";
615 $config_data .= " // mySQL connection information\n";
616 $config_data .= " \$MYSQL_HOST = '" . $mysql_host . "';\n";
617 $config_data .= " \$MYSQL_USER = '" . $mysql_user . "';\n";
618 $config_data .= " \$MYSQL_PASSWORD = '" . $mysql_password . "';\n";
619 $config_data .= " \$MYSQL_DATABASE = '" . $mysql_database . "';\n";
620 $config_data .= " \$MYSQL_PREFIX = '" . (($mysql_usePrefix == 1)?$mysql_prefix:'') . "';\n";
621 $config_data .= "\n";
622 $config_data .= " // main nucleus directory\n";
623 $config_data .= " \$DIR_NUCLEUS = '" . $config_adminpath . "';\n";
624 $config_data .= "\n";
625 $config_data .= " // path to media dir\n";
626 $config_data .= " \$DIR_MEDIA = '" . $config_mediapath . "';\n";
627 $config_data .= "\n";
628 $config_data .= " // extra skin files for imported skins\n";
629 $config_data .= " \$DIR_SKINS = '" . $config_skinspath . "';\n";
630 $config_data .= "\n";
631 $config_data .= " // these dirs are normally sub dirs of the nucleus dir, but \n";
632 $config_data .= " // you can redefine them if you wish\n";
633 $config_data .= " \$DIR_PLUGINS = \$DIR_NUCLEUS . 'plugins/';\n";
634 $config_data .= " \$DIR_LANG = \$DIR_NUCLEUS . 'language/';\n";
635 $config_data .= " \$DIR_LIBS = \$DIR_NUCLEUS . 'libs/';\n";
636 $config_data .= "\n";
637 $config_data .= " // include libs\n";
638 $config_data .= " include(\$DIR_LIBS.'globalfunctions.php');\n";
639 $config_data .= " if (!extension_loaded('mbstring')) {\n";
640 $config_data .= " include(\$DIR_LIBS.'mb_emulator/mb-emulator.php');\n";
641 $config_data .= " }\n";
642 $config_data .= "?" . ">";
644 $result = @fputs($fp, $config_data, strlen($config_data));
652 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
653 <html xmlns="http://www.w3.org/1999/xhtml">
655 <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />
656 <title>Nucleus¤Î¥¤¥ó¥¹¥È¡¼¥ë</title>
658 @import url('nucleus/styles/manual.css');
662 <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->
664 $aAllErrors = array_merge($aSkinErrors, $aPlugErrors);
665 if (count($aAllErrors) > 0) {
666 echo '<h1>Skin/Plugin Install errors</h1>';
667 echo '<ul><li>'.implode('</li><li>', $aAllErrors).'</li></ul>';
670 if (!$bConfigWritten) { ?>
671 <h1>¥¤¥ó¥¹¥È¡¼¥ë¤Ï¤Û¤Ü´°Î»¤·¤Þ¤·¤¿¡ª</h1>
673 ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Æ¡¼¥Ö¥ë¤Î½é´üÃÍÆþÎϤ¬À®¸ù¤·¤Þ¤·¤¿¡£¸å¤Ï<i>config.php</i>¤ò½ñ¤´¹¤¨¤ë¤À¤±¤Ç¤¹¡£°Ê²¼¤Ë½ñ¤´¹¤¨¤ë¤Ù¤ÆâÍƤòɽ¼¨¤·¤Þ¤¹¡Êmysql¤Î¥Ñ¥¹¥ï¡¼¥É¤Ï¥Þ¥¹¥¯¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤³¤Ï¼ÂºÝ¤Î¤â¤Î¤Ë½ñ¤´¹¤¨¤Æ¤¯¤À¤µ¤¤¡Ë
678 // mySQL connection information
679 $MYSQL_HOST = '<b><?php echo $mysql_host?></b>';
680 $MYSQL_USER = '<b><?php echo $mysql_user?></b>';
681 $MYSQL_PASSWORD = '<i><b>xxxxxxxxxxx</b></i>';
682 $MYSQL_DATABASE = '<b><?php echo $mysql_database?></b>';
683 $MYSQL_PREFIX = '<b><?php echo ($mysql_usePrefix == 1)?$mysql_prefix:''?></b>';
685 // main nucleus directory
686 $DIR_NUCLEUS = '<b><?php echo $config_adminpath?></b>';
689 $DIR_MEDIA = '<b><?php echo $config_mediapath?></b>';
691 // extra skin files for imported skins
692 $DIR_SKINS = '<b><?php echo $config_skinspath?></b>';
694 // these dirs are normally sub dirs of the nucleus dir, but
695 // you can redefine them if you wish
696 $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';
697 $DIR_LANG = $DIR_NUCLEUS . 'language/';
698 $DIR_LIBS = $DIR_NUCLEUS . 'libs/';
701 include($DIR_LIBS.'globalfunctions.php');
702 if (!extension_loaded('mbstring')) {
703 include($DIR_LIBS.'mb_emulator/mb-emulator.php');
709 <p>¤¢¤Ê¤¿¤Î¥³¥ó¥Ô¥å¡¼¥¿¾å¤Î¥Õ¥¡¥¤¥ë¤ò½ñ¤´¹¤¨¤¿¤é¡¢FTP¤ò»È¤Ã¤Æ¥¦¥§¥Ö¥µ¡¼¥Ð¤Ë¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£ASCII¥â¡¼¥É¤ÇÁ÷¿®¤·¤Æ¥Õ¥¡¥¤¥ë¤ò¾å½ñ¤¤·¤Þ¤¹¡£
713 <b>ÉÕµ:</b> <i>config.php</i>¤ÎºÇ½é¤ä½ª¤ï¤ê¤Ë¥¹¥Ú¡¼¥¹¤ò¶õ¤±¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤·¤ç¤¦¡£¼Â¹Ô»þ¤Ë¥¨¥é¡¼¤ò°ú¤µ¯¤³¤¹¸¶°ø¤È¤Ê¤ê¤Þ¤¹¡£
715 ¤·¤¿¤¬¤Ã¤Æ¡¢config.php¤ÎºÇ½é¤Îʸ»ú¤Ï "<"¤ÇºÇ¸å¤Îʸ»ú¤Ï">"¤È¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
719 <h1>¥¤¥ó¥¹¥È¡¼¥ë¤Ï´°Î»¤·¤Þ¤·¤¿¡ª</h1>
721 <p>Nucleus¤Ï¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¡¢<code>config.php</code>¤Ï¥¢¥Ã¥×¥Ç¡¼¥È¤µ¤ì¤Þ¤·¤¿¡£</p>
723 <p>¥»¥¥å¥ê¥Æ¥£¤Î¤¿¤á<code>config.php</code>¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò444¤ËÌ᤹¤³¤È¤ò˺¤ì¤Ê¤¤¤Ç¤¯¤À¤µ¤¤(<a href="nucleus/documentation/tips.html#filepermissions">¥Ñ¡¼¥ß¥Ã¥·¥ç¥óÊѹ¹¤Î´Ê°×¥¬¥¤¥É</a>)¡£</p>
725 <h1>¥¤¥ó¥¹¥È¡¼¥ë¥Õ¥¡¥¤¥ë¤Îºï½ü</h1>
727 <p>¥¦¥§¥Ö¥µ¡¼¥Ð¤«¤é¼¡¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤¡§</p>
730 <li><b>install.sql</b>¡§¥Æ¡¼¥Ö¥ë¤Î¹½Â¤¤òÆâÊñ¤¹¤ë¥Õ¥¡¥¤¥ë</li>
731 <li><b>install.php</b>¡§¤³¤Î¥Õ¥¡¥¤¥ë</li>
734 <p>¤â¤·¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢´ÉÍýÎΰè¤ò³«¤¯¤³¤È¤¬½ÐÍè¤Þ¤»¤ó¡£</p>
736 <h1>¥¦¥§¥Ö¥µ¥¤¥È¤Î³Îǧ</h1>
738 ¥¦¥§¥Ö¥µ¥¤¥È¤ò»È¤¦½àÈ÷¤¬À°¤¤¤Þ¤·¤¿¡£
740 <li><a href="<?php echo $config_adminurl?>">´ÉÍýÎΰè¤Ë¥í¥°¥¤¥ó¤·¤Æ¥µ¥¤¥È¤ÎÀßÄê¤ò¹Ô¤¦</a></li>
741 <li><a href="<?php echo $config_indexurl?>">¤¹¤°¤Ë¥µ¥¤¥È¤Ø¹Ô¤Ã¤Æ¤ß¤ë</a></li>
751 function installCustomPlugs(&$manager) {
752 global $aConfPlugsToInstall, $DIR_LIBS;
756 if (count($aConfPlugsToInstall) == 0)
759 $numCurrent = mysql_num_rows(sql_query('SELECT * FROM '.sql_table('plugin')));
761 foreach ($aConfPlugsToInstall as $plugName) {
762 // do this before calling getPlugin (in case the plugin id is used there)
763 $query = 'INSERT INTO '.sql_table('plugin').' (porder, pfile) VALUES ('.(++$numCurrent).',"'.addslashes($plugName).'")';
766 // get and install the plugin
767 $plugin =& $manager->getPlugin($plugName);
769 sql_query('DELETE FROM ' . sql_table('plugin') . ' WHERE pfile=\''. addslashes($plugName).'\'');
771 array_push($aErrors, 'Unable to install plugin ' . $plugName);
777 // SYNC PLUGIN EVENT LIST
778 sql_query('DELETE FROM '.sql_table('plugin_event'));
779 // loop over all installed plugins
780 $res = sql_query('SELECT pid, pfile FROM '.sql_table('plugin'));
781 while($o = mysql_fetch_object($res)) {
783 $plug =& $manager->getPlugin($o->pfile);
786 $eventList = $plug->getEventList();
787 foreach ($eventList as $eventName)
788 sql_query('INSERT INTO '.sql_table('plugin_event').' (pid, event) VALUES ('.$pid.', \''.$eventName.'\')');
795 function installCustomSkins(&$manager) {
796 global $aConfSkinsToImport, $DIR_LIBS, $DIR_SKINS;
800 if (count($aConfSkinsToImport) == 0)
804 include_once($DIR_LIBS . 'skinie.php');
806 $importer = new SKINIMPORT();
808 foreach ($aConfSkinsToImport as $skinName) {
811 $skinFile = $DIR_SKINS . $skinName . '/skinbackup.xml';
812 if (!@file_exists($skinFile)) {
813 array_push($aErrors, 'Unable to import ' . $skinFile . ' : file does not exist');
816 $error = $importer->readFile($skinFile);
818 array_push($aErrors, 'Unable to import ' . $skinName . ' : ' . $error);
821 $error = $importer->writeToDatabase(1);
823 array_push($aErrors, 'Unable to import ' . $skinName . ' : ' . $error);
831 // give an error if one or more nucleus are not accessible
832 function doCheckFiles() {
833 $missingfiles = array();
835 if (!is_readable('install.sql'))
836 array_push($missingfiles, "File <b>install.sql</b> is missing or not readable");
837 if (!is_readable('index.php'))
838 array_push($missingfiles, "File <b>index.php</b> is missing or not readable");
839 if (!is_readable('action.php'))
840 array_push($missingfiles, "File <b>action.php</b> is missing or not readable");
841 if (!is_readable('nucleus/index.php'))
842 array_push($missingfiles, "File <b>nucleus/index.php</b> is missing or not readable");
843 if (!is_readable('nucleus/libs/globalfunctions.php'))
844 array_push($missingfiles, "File <b>nucleus/libs/globalfunctions.php</b> is missing or not readable");
845 if (!is_readable('nucleus/libs/ADMIN.php'))
846 array_push($missingfiles, "File <b>nucleus/libs/ADMIN.php</b> is missing or not readable");
847 if (!is_readable('nucleus/libs/BLOG.php'))
848 array_push($missingfiles, "File <b>nucleus/libs/BLOG.php</b> is missing or not readable");
849 if (!is_readable('nucleus/libs/COMMENT.php'))
850 array_push($missingfiles, "File <b>nucleus/libs/COMMENT.php</b> is missing or not readable");
851 if (!is_readable('nucleus/libs/COMMENTS.php'))
852 array_push($missingfiles, "File <b>nucleus/libs/COMMENTS.php</b> is missing or not readable");
853 if (!is_readable('nucleus/libs/ITEM.php'))
854 array_push($missingfiles, "File <b>nucleus/libs/ITEM.php</b> is missing or not readable");
855 if (!is_readable('nucleus/libs/MEMBER.php'))
856 array_push($missingfiles, "File <b>nucleus/libs/MEMBER.php</b> is missing or not readable");
857 if (!is_readable('nucleus/libs/SKIN.php'))
858 array_push($missingfiles, "File <b>nucleus/libs/SKIN.php</b> is missing or not readable");
859 if (!is_readable('nucleus/libs/TEMPLATE.php'))
860 array_push($missingfiles, "File <b>nucleus/libs/TEMPLATE.php</b> is missing or not readable");
861 if (!is_readable('nucleus/libs/MEDIA.php'))
862 array_push($missingfiles, "File <b>nucleus/libs/MEDIA.php</b> is missing or not readable");
863 if (!is_readable('nucleus/libs/ACTIONLOG.php'))
864 array_push($missingfiles, "File <b>nucleus/libs/ACTIONLOG.php</b> is missing or not readable");
865 if (!is_readable('nucleus/media.php'))
866 array_push($missingfiles, "File <b>nucleus/media.php</b> is missing or not readable");
869 if (sizeof($missingfiles) > 0)
870 showErrorMessages($missingfiles);
875 function updateConfig($name, $val) {
876 $name = addslashes($name);
877 $val = trim(addslashes($val));
879 $query = 'UPDATE ' . tableName('nucleus_config')
880 . " SET value='$val'"
881 . " WHERE name='$name'";
883 mysql_query($query) or _doError("Query error while trying to update config: " . mysql_error());
884 return mysql_insert_id();
887 function endsWithSlash($s) {
888 return (strrpos($s,'/') == strlen($s) - 1);
892 * Checks if email address is valid
894 function _isValidMailAddress($address) {
895 if (preg_match("/^[a-zA-Z0-9\._-]+@+[A-Za-z0-9\._-]+\.+[A-Za-z]{2,4}$/", $address))
901 // returns true if the given string is a valid shortname
902 // (to check short blog names and nicknames)
903 // logic: starts and ends with a non space, can contain spaces in between
905 function _isValidShortName($name) {
906 if (eregi("^[a-z0-9]+$", $name))
914 // returns true if the given string is a valid display name
915 // (to check nicknames)
916 function _isValidDisplayName($name) {
917 if (eregi("^[a-z0-9]+[a-z0-9 ]*[a-z0-9]+$", $name))
923 function _doError($msg) {
925 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
926 <html xmlns="http://www.w3.org/1999/xhtml">
928 <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />
929 <title>Nucleus Install</title>
931 @import url('nucleus/styles/manual.css');
935 <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->
938 Error message was: "<?php echo $msg?>";
942 <a href="install.php" onclick="history.back();return false;">Go Back</a>
949 function showErrorMessages($errors) {
951 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
952 <html xmlns="http://www.w3.org/1999/xhtml">
954 <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />
955 <title>Nucleus Install</title>
957 @import url('nucleus/styles/manual.css');
961 <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->
968 <?php while($msg = array_shift($errors))
969 echo "<li>$msg</li>";
974 <a href="install.php" onclick="history.back();return false;">Go Back</a>
982 /* for the non-php systems that decide to show the contents: