OSDN Git Service

merged 3.2.1(?) modification
[nucleus-jp/nucleus-jp-ancient.git] / utf8 / install.php
1 <?php\r
2         /*\r
3          * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
4          * Copyright (C) 2002-2005 The Nucleus Group\r
5          *\r
6          * This program is free software; you can redistribute it and/or\r
7          * modify it under the terms of the GNU General Public License\r
8          * as published by the Free Software Foundation; either version 2\r
9          * of the License, or (at your option) any later version.\r
10          * (see nucleus/documentation/index.html#license for more info)\r
11          * This script will install the Nucleus tables in your SQL-database, and initialize the data in\r
12          * those tables.\r
13          */\r
14         /**\r
15          * Below is a friendly way of letting users on non-php systems know that Nucleus won't run there.\r
16          * @license http://nucleuscms.org/license.txt GNU General Public License\r
17          * @copyright Copyright (C) 2002-2005 The Nucleus Group\r
18          * @version $Id: install.php,v 1.5 2005-04-20 06:53:20 kimitake Exp $\r
19          */\r
20         ?><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     */\r
21 \r
22         /*\r
23                 This part of the install.php code allows for customization of the install process.\r
24                 When distributing plugins or skins together with a Nucleus installation, the\r
25                 configuration below will instruct to install them\r
26 \r
27                 -- Start Of Configurable Part --\r
28         */\r
29 \r
30                 // array with names of plugins to install. Plugin files must be present in the nucleus/plugin/\r
31                 // directory.\r
32                 //\r
33                 // example:\r
34                 //     array('NP_TrackBack', 'NP_MemberGoodies')\r
35                 $aConfPlugsToInstall = array('NP_SkinFiles');\r
36 \r
37 \r
38                 // array with skins to install. skins must be present under the skins/ directory with\r
39                 // a subdirectory having the same name that contains a skinbackup.xml file\r
40                 //\r
41                 // example:\r
42                 //     array('base','rsd')\r
43                 $aConfSkinsToImport = array('default');\r
44 \r
45         /*\r
46                 -- End Of Configurable Part --\r
47         */\r
48 \r
49         // don't give warnings for uninitialized vars\r
50         error_reporting(E_ERROR | E_WARNING | E_PARSE);\r
51 \r
52         // make sure there's no unnecessary escaping:\r
53         set_magic_quotes_runtime(0);\r
54 \r
55   // if there are some plugins or skins to import, do not include vars\r
56   // in globalfunctions.php again... so set a flag\r
57         if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0)) {\r
58           global $CONF;\r
59           $CONF['installscript']=1;\r
60         }\r
61   if (phpversion() >= '4.1.0')\r
62           include_once('nucleus/libs/vars4.1.0.php');\r
63   else\r
64           include_once('nucleus/libs/vars4.0.6.php');\r
65 \r
66         // check if mysql support is installed\r
67         if (!function_exists('mysql_query'))\r
68                 _doError('Your PHP version does not have support for MySQL :(');\r
69 \r
70         if (postVar('action') == 'go')\r
71                 doInstall();\r
72         else\r
73                 showInstallForm();\r
74         exit;\r
75 \r
76         function showInstallForm() {\r
77 \r
78                 // 0. pre check if all necessary files exist\r
79                 doCheckFiles();\r
80 \r
81         ?>\r
82         <!DOCTYPE html\r
83         PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
84         <html xmlns="http://www.w3.org/1999/xhtml">\r
85         <head>\r
86                 <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />\r
87                 <title>Nucleusのインストール</title>\r
88                 <style type="text/css"><!--\r
89                         @import url('nucleus/documentation/styles/manual.css');\r
90                 --></style>\r
91                 <script type="text/javascript"><!--\r
92                         // function to make sure the submit button only gets pressed once\r
93                         var submitcount=0;\r
94                         function checkSubmit() {\r
95                                 if (submitcount == 0) {\r
96                                         submitcount++;\r
97                                         return true;\r
98                                 } else {\r
99                                         return false;\r
100                                 }\r
101                         }\r
102                 --></script>\r
103         </head>\r
104         <body>\r
105 \r
106   <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
107 \r
108         <form method="post" action="install.php">\r
109 \r
110         <h1>Install Nucleus</h1>\r
111 \r
112         <p>\r
113         このスクリプトはNucleusのインストールを手助けします。MySQLテーブルのセットアップと、<i>config.php</i>に入力するための情報を表示します(config.phpのパーミッションを0666にしておけば、後者の作業は自動的に行われます)。これをなす為に、いくつかの情報を入力する必要があります。\r
114         </p>\r
115 \r
116         <p>\r
117         すべての欄の入力が必要です。オプション情報はインストールが完了したら、Nucleusの管理領域から設定可能です。\r
118         </p>\r
119 \r
120         <h1>PHP &amp; MySQL Versions</h1>\r
121 \r
122         <p>\r
123                 以下はあなたのウェブホストにおけるPHPインタープリターとMySQLサーバーのバージョンです。Nucleusのサポートフォーラムに問題を報告するときは、この情報を書き添えてください。\r
124         </p>\r
125 \r
126         <ul>\r
127                 <li>PHP: <?php                  echo phpversion();\r
128                         $minVersion = '4.0.6';\r
129 \r
130                         if (phpversion() < $minVersion)\r
131                                 echo ' <span class="warning">注意: Nucleusの動作には少なくともバージョン ',$minVersion,' が必要とされます</span>';\r
132                 ?></li>\r
133                 <li>MySQL: <?php\r
134                         // note: this piece of code is taken from phpMyAdmin\r
135 \r
136                         $result = @mysql_query('SELECT VERSION() AS version');\r
137                         if ($result != FALSE && @mysql_num_rows($result) > 0) {\r
138                                 $row   = mysql_fetch_array($result);\r
139                                 $match = explode('.', $row['version']);\r
140                         } else {\r
141                                 $result = @mysql_query('SHOW VARIABLES LIKE \'version\'');\r
142                                 if ($result != FALSE && @mysql_num_rows($result) > 0){\r
143                                         $row   = mysql_fetch_row($result);\r
144                                         $match = explode('.', $row[1]);\r
145                                 } else {\r
146                                         $match[0] = '?';\r
147                                         $match[1] = '?';\r
148                                         $match[2] = '?';\r
149                                 }\r
150                         }\r
151 \r
152                         if (!isset($match) || !isset($match[0])) {\r
153                                 $match[0] = 3;\r
154                         }\r
155                         if (!isset($match[1])) {\r
156                                 $match[1] = 21;\r
157                         }\r
158                         if (!isset($match[2])) {\r
159                                 $match[2] = 0;\r
160                         }\r
161 \r
162                         if ($match[0] != '?') {\r
163                                 $match[0] = intval($match[0]);\r
164                                 $match[1] = intval($match[1]);\r
165                         }\r
166 \r
167                         $mysqlVersion = implode($match, '.');\r
168                         $minVersion = '3.23';\r
169 \r
170                         echo $mysqlVersion;\r
171 \r
172                         if ($mysqlVersion < $minVersion)\r
173                                 echo ' <span class="warning">注意: Nucleusの動作には少なくともバージョン ',$minVersion,' が必要とされます</span>';\r
174                 ?></li>\r
175         </ul>\r
176 \r
177 <?php\r
178         // tell people how they can have their config file filled out automatically\r
179         if (@file_exists('config.php') && @!is_writable('config.php')) {\r
180 ?>\r
181         <h1><i>config.php</i>の自動アップデート</h1>\r
182 \r
183         <p>\r
184         もし<em>config.php</em>を自動的に更新するようにしたいなら、書き込み可能にする必要があります。<em>config.php</em>のパーミッションを<strong>666</strong>にしてください。Nucleusのインストール成功後に、パーミッションを<strong>444</strong>に戻さなければなりません(<a href="nucleus/documentation/tips.html#filepermissions">パーミッション変更の簡易ガイド</a>)。\r
185         </p>\r
186 \r
187         <p>\r
188         もしファイルに書き込まないという選択をした(あるいは行えない)場合:ご心配なく。インストールの過程で<em>config.php</em>の中身が提供されます。ですから、それをご自身でアップロードしてください。\r
189         </p>\r
190 \r
191 <?php } ?>\r
192 \r
193         <h1>MySQLのログインデータ</h1>\r
194 \r
195         <p>\r
196         MySQLのデータを以下に入力してください。それらはデータベース・テーブルを作成し情報を入力するために必要なものです。後で、<i>config.php</i>にも記入する必要があります(上記の自動アップデートを利用する場合、その手順は省略されます)。\r
197         </p>\r
198 \r
199         <p>\r
200         もしこの情報がわからなければ、システム管理者かホスティング元に連絡をとってください。ほとんどの場合、ホスト名は'localhost'です。もしNucleusがあなたのサーバのPHP設定から'default MySQL host'を検知したなら、'ホスト名'に既に記入されているはずです。もっとも、この情報が正確であるという保証はありません。\r
201         </p>\r
202 \r
203         <fieldset>\r
204                 <legend>基本のデータベース設定</legend>\r
205                 <table><tr>\r
206                         <td>ホスト名:</td>\r
207                         <td><input name="mySQL_host" value="<?php echo htmlspecialchars(@ini_get('mysql.default_host'))?>" /></td>\r
208                 </tr><tr>\r
209                         <td>ユーザー名:</td>\r
210                         <td><input name="mySQL_user" /></td>\r
211                 </tr><tr>\r
212                         <td>パスワード:</td>\r
213                         <td><input name="mySQL_password" type="password" /></td>\r
214                 </tr><tr>\r
215                         <td>データベース名:</td>\r
216                         <td><input name="mySQL_database" /> (<input name="mySQL_create" value="1" type="checkbox" id="mySQL_create"><label for="mySQL_create" />データベースを作成する必要がある</label>)</td>\r
217                 </tr></table>\r
218         </fieldset>\r
219 \r
220         <fieldset>\r
221                 <legend>高等なデータベース設定</legend>\r
222                 <table><tr>\r
223                         <td><input name="mySQL_usePrefix" value="1" type="checkbox" id="mySQL_usePrefix"><label for="mySQL_usePrefix" />テーブル・プリフィックスを利用</label></td>\r
224                         <td><input name="mySQL_tablePrefix" value="" /></td>\r
225                 </tr></table>\r
226                 <p>一つのデータベースに複数のNucleusをインストールしており、自分が何をやっているのか理解されている場合を除いては、<strong>これを変更する必要はありません</strong>。</p>\r
227                 <p>Nucleusによって生成されたすべてのデータベーステーブルは、このプリフィックスが頭につきます。</p>\r
228         </fieldset>\r
229 \r
230         <h1>ディレクトリとURL</h1>\r
231 \r
232         <p>\r
233         このインストールスクリプトはNucleusがインストールされているディレクトリとURLを見つけようとしました。下の値をチェックして必要なら訂正してください。ファイルへのパスとURLはスラッシュ'/'で終わらなくてはなりません。\r
234         </p>\r
235 \r
236         <fieldset>\r
237                 <legend>URLs and directories</legend>\r
238                 <table><tr>\r
239                         <td>Site <strong>URL</strong>:</td>\r
240                         <td>\r
241                                         <input name="IndexURL" size="60" value="<?php                                   $url = "http://" . serverVar('HTTP_HOST') . serverVar('PHP_SELF');\r
242                                         $url = str_replace("install.php",'',$url);\r
243                                         $url = str_replace("\\","/",$url);\r
244                                         // add slash at end if necessary\r
245                                         if (!endsWithSlash($url)) $url .= '/';\r
246                                         echo $url;\r
247                                 ?>" />\r
248                         </td>\r
249                 </tr><tr>\r
250                         <td>Admin-area <strong>URL</strong>:</td>\r
251                         <td><input name="AdminURL" size="60" value="<?php                                       if ($url) echo $url . 'nucleus/';\r
252                                 ?>" />\r
253                         </td>\r
254                 </tr><tr>\r
255                         <td>Admin-area <strong>path</strong>:</td>\r
256                         <td><input name="AdminPath" size="60" value="<?php                                      $path = str_replace("install.php",'',serverVar('SCRIPT_FILENAME'));\r
257                                         $path = str_replace("\\","/",$path);\r
258                                         // add slash at end if necessary\r
259                                         if (!endsWithSlash($path)) $path .= '/';\r
260                                         if($path) echo  $path . 'nucleus/';\r
261                                 ?>" />\r
262                         </td>\r
263                 </tr><tr>\r
264                         <td>Media files <strong>URL</strong>:</td>\r
265                         <td><input name="MediaURL" size="60" value="<?php                                       if ($url) echo $url . 'media/';\r
266                                 ?>" />\r
267                         </td>\r
268                 </tr><tr>\r
269                         <td>Media directory <strong>path</strong>:</td>\r
270                         <td><input name="MediaPath" size="60" value="<?php                                      $path = str_replace("install.php",'',serverVar('SCRIPT_FILENAME'));\r
271                                         $path = str_replace("\\","/",$path);\r
272                                         // add slash at end if necessary\r
273                                         if (!endsWithSlash($path)) $path .= '/';\r
274                                         if ($path) echo $path . 'media/';\r
275                                 ?>" />\r
276                         </td>\r
277                 </tr><tr>\r
278                         <td>Extra skin files <strong>URL</strong>:</td>\r
279                         <td><input name="SkinsURL" size="60" value="<?php                                       if ($url) echo $url . 'skins/';\r
280                                 ?>" />\r
281                                 <br />(インポートされたスキンが使用)\r
282                         </td>\r
283                 </tr><tr>\r
284                         <td>Extra skin files directory <strong>path</strong>:</td>\r
285                         <td><input name="SkinsPath" size="60" value="<?php                              $path = str_replace("install.php",'',serverVar('SCRIPT_FILENAME'));\r
286                                 $path = str_replace("\\","/",$path);\r
287                                 // add slash at end if necessary\r
288                                 if (!endsWithSlash($path)) $path .= '/';\r
289                                 if ($path) echo $path . 'skins/';\r
290                                 ?>" />\r
291                                 <br />(インポートされたスキンのファイル類を置く場所)\r
292                         </td>\r
293                 </tr><tr>\r
294                         <td>Plugin files <strong>URL</strong>:</td>\r
295                         <td><input name="PluginURL" size="60" value="<?php                                      if ($url) echo $url . 'nucleus/plugins/';\r
296                                 ?>" />\r
297                         </td>\r
298                 </tr><tr>\r
299                         <td>Action <strong>URL</strong>:</td>\r
300                         <td><input name="ActionURL" size="60" value="<?php                                      if ($url) echo $url . 'action.php';\r
301                                 ?>" />\r
302                                 <br />(<tt>action.php</tt>へのhttp://から始まるURL)\r
303                         </td>\r
304                 </tr></table>\r
305         </fieldset>\r
306 \r
307         <p class="note">\r
308         <strong>付記:</strong> 相対パスではなく<strong>絶対パスを使ってください</strong>。通常、絶対パスは<tt>/home/username/public_html/</tt>のような形をとります。Unixシステム(ほとんどのサーバーがそうです)において、パスはスラッシュから始まります。もしこれらの情報入力に問題が生じたら、あなたのサーバ管理者にたずねるべきです。\r
309         </p>\r
310 \r
311         <h1>管理権限をもつユーザー</h1>\r
312 \r
313         <p>以下に、サイトの最初のユーザーを作成するためのいくつかの情報を入力してください。</p>\r
314 \r
315         <fieldset>\r
316                 <legend>管理権限を持つユーザー</legend>\r
317                 <table><tr>\r
318                         <td>表示される名前:</td>\r
319                         <td>\r
320                                 <input name="User_name" value="" />\r
321                                 <small>(許可される文字:a-z と 0-9、最初と最後以外のスペース)</small>\r
322                         </td>\r
323                 </tr><tr>\r
324                         <td>本名(ハンドル名):</td>\r
325                         <td><input name="User_realname" value="" /></td>\r
326                 </tr><tr>\r
327                         <td>パスワード:</td>\r
328                         <td><input name="User_password" type="password" value="" /></td>\r
329                 </tr><tr>\r
330                         <td>パスワードの確認:</td>\r
331                         <td><input name="User_password2" type="password" value="" /></td>\r
332                 </tr><tr>\r
333                         <td>メールアドレス:</td>\r
334                         <td>\r
335                                 <input name="User_email" value="" />\r
336                                 <small>(利用可能なメールアドレスを入れてください)</small>\r
337                         </td>\r
338                 </tr></table>\r
339         </fieldset>\r
340 \r
341         <h1>ウェブログのデータ</h1>\r
342 \r
343         <p>以下に、デフォルトのweblogを作成するためにいくつかの情報を入力してください。このweblogの名前は、サイト名としても利用されます。</p>\r
344 \r
345         <fieldset>\r
346                 <legend>ウェブログのデータ</legend>\r
347                 <table><tr>\r
348                         <td>Blog名:</td>\r
349                         <td><input name="Blog_name" size="60" value="My Nucleus CMS" /></td>\r
350                 </tr><tr>\r
351                         <td>Blogの短縮名:</td>\r
352                         <td>\r
353                                 <input name="Blog_shortname" value="mynucleuscms" />\r
354                                 <small>(許可される文字:a-z と 0-9、スペースは不可)</small>\r
355                         </td>\r
356                 </tr></table>\r
357         </fieldset>\r
358 \r
359         <h1>データの送信</h1>\r
360 \r
361         <p>\r
362         上に書いてきたデータが正しいか確かめてください。よければデータベース・テーブルと最初のデータを設定するために下のボタンを押してください。少し時間がかかるかもしれませんがご辛抱を。<b>ボタンをクリックするのは一回だけにしてください。</b>\r
363         </p>\r
364 \r
365         <p>\r
366                 <input name="action" value="go" type="hidden" />\r
367                 <input type="submit" value="Nucleus CMSのインストール" onclick="return checkSubmit();" />\r
368         </p>\r
369 \r
370         </form>\r
371 \r
372         </body>\r
373         </html>\r
374 \r
375 \r
376         <?php   }\r
377 \r
378         function tableName($unPrefixed)\r
379         {\r
380                 global $mysql_usePrefix, $mysql_prefix;\r
381                 if ($mysql_usePrefix == 1)\r
382                         return $mysql_prefix . $unPrefixed;\r
383                 else\r
384                         return $unPrefixed;\r
385         }\r
386 \r
387         function doInstall() {\r
388                 global $mysql_usePrefix, $mysql_prefix;\r
389 \r
390                 // 0. put all POST-vars into vars\r
391                 $mysql_host             = postVar('mySQL_host');\r
392                 $mysql_user             = postVar('mySQL_user');\r
393                 $mysql_password         = postVar('mySQL_password');\r
394                 $mysql_database         = postVar('mySQL_database');\r
395                 $mysql_create           = postVar('mySQL_create');\r
396                 $mysql_usePrefix        = postVar('mySQL_usePrefix');\r
397                 $mysql_prefix           = postVar('mySQL_tablePrefix');\r
398                 $config_indexurl        = postVar('IndexURL');\r
399                 $config_adminurl        = postVar('AdminURL');\r
400                 $config_adminpath       = postVar('AdminPath');\r
401                 $config_mediaurl        = postVar('MediaURL');\r
402                 $config_skinsurl        = postVar('SkinsURL');\r
403                 $config_pluginurl       = postVar('PluginURL');\r
404                 $config_actionurl       = postVar('ActionURL');\r
405                 $config_mediapath       = postVar('MediaPath');\r
406                 $config_skinspath       = postVar('SkinsPath');\r
407                 $user_name                      = postVar('User_name');\r
408                 $user_realname          = postVar('User_realname');\r
409                 $user_password          = postVar('User_password');\r
410                 $user_password2         = postVar('User_password2');\r
411                 $user_email             = postVar('User_email');\r
412                 $blog_name                      = postVar('Blog_name');\r
413                 $blog_shortname         = postVar('Blog_shortname');\r
414                 $config_adminemail      = $user_email;\r
415                 $config_sitename        = $blog_name;\r
416 \r
417 \r
418                 $config_indexurl        = str_replace("\\","/",$config_indexurl);\r
419                 $config_adminurl        = str_replace("\\","/",$config_adminurl);\r
420                 $config_mediaurl        = str_replace("\\","/",$config_mediaurl);\r
421                 $config_skinsurl        = str_replace("\\","/",$config_skinsurl);\r
422                 $config_pluginurl       = str_replace("\\","/",$config_pluginurl);\r
423                 $config_actionurl       = str_replace("\\","/",$config_actionurl);\r
424                 $config_adminpath       = str_replace("\\","/",$config_adminpath);\r
425                 $config_skinspath       = str_replace("\\","/",$config_skinspath);\r
426 \r
427                 // 1. check all the data\r
428                 $errors = array();\r
429 \r
430                 if (!$mysql_database)\r
431                         array_push($errors,"mySQL database name missing");\r
432                 if (($mysql_usePrefix == 1) && (strlen($mysql_prefix) == 0))\r
433                         array_push($errors,"mySQL prefix was selected, but prefix is empty");\r
434                 if (($mysql_usePrefix == 1) && (!eregi('^[a-zA-Z0-9_]+$', $mysql_prefix)))\r
435                         array_push($errors,"mySQL prefix should only contain characters from the ranges A-Z, a-z, 0-9 or underscores");\r
436                 if (!endsWithSlash($config_indexurl) || !endsWithSlash($config_adminurl)\r
437                                                      || !endsWithSlash($config_mediaurl)\r
438                                                      || !endsWithSlash($config_pluginurl)\r
439                                                      || !endsWithSlash($config_skinsurl)\r
440                                                                 // TODO: add action.php check\r
441                     )\r
442                         array_push($errors,"One of the URLs does not end with a slash, or action url does not end with 'action.php'");\r
443                 if (!endsWithSlash($config_adminpath))\r
444                         array_push($errors,"The path of the administration area does not end with a slash");\r
445                 if (!endsWithSlash($config_mediapath))\r
446                         array_push($errors,"The media path does not end with a slash");\r
447                 if (!endsWithSlash($config_skinspath))\r
448                         array_push($errors,"The skins path does not end with a slash");\r
449                 if (!is_dir($config_adminpath))\r
450                         array_push($errors,"The path of the administration area does not exist on your server");\r
451                 if (!_isValidMailAddress($user_email))\r
452                         array_push($errors,"Invalid e-mail address given for user");\r
453                 if (!_isValidDisplayName($user_name))\r
454                         array_push($errors,"User name is not a valid display name (allowed chars: a-zA-Z0-9 and spaces)");\r
455                 if (!$user_password || !$user_password2)\r
456                         array_push($errors, "User password is empty");\r
457                 if ($user_password != $user_password2)\r
458                         array_push($errors, "User password do not match");\r
459                 if (!_isValidShortName($blog_shortname))\r
460                         array_push($errors, "Invalid short name given for blog (allowed chars: a-z0-9, no spaces)");\r
461                 if (sizeof($errors) > 0)\r
462                         showErrorMessages($errors);\r
463 \r
464                 // 2. try to log in to mySQL\r
465                 $connection = @mysql_connect($mysql_host, $mysql_user, $mysql_password);\r
466                 if ($connection == false)\r
467                         _doError("Could not connect to mySQL server: " . mysql_error());\r
468 \r
469                 // 3. try to create database (if needed)\r
470                 if ($mysql_create == 1) {\r
471                         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());\r
472                 }\r
473 \r
474                 // 4. try to select database\r
475                 mysql_select_db($mysql_database) or _doError("Could not select database. Make sure it exists");\r
476 \r
477                 // 5. execute queries\r
478                 $filename = "install.sql";\r
479                 $fd = fopen ($filename, "r");\r
480                 $queries = fread ($fd, filesize ($filename));\r
481                 fclose ($fd);\r
482 \r
483                 $queries = split("(;\n|;\r)",$queries);\r
484 \r
485                 $aTableNames = array(\r
486                         'nucleus_actionlog',\r
487                         'nucleus_ban',\r
488                         'nucleus_blog',\r
489                         'nucleus_category',\r
490                         'nucleus_comment',\r
491                         'nucleus_config',\r
492                         'nucleus_item',\r
493                         'nucleus_karma',\r
494                         'nucleus_member',\r
495                         'nucleus_plugin',\r
496                         'nucleus_skin',\r
497                         'nucleus_template',\r
498                         'nucleus_team',\r
499                         'nucleus_activation',\r
500                         'nucleus_tickets'\r
501 // these are unneeded (one of the replacements above takes care of them)\r
502 //                      'nucleus_plugin_event',\r
503 //                      'nucleus_plugin_option',\r
504 //                      'nucleus_plugin_option_desc',\r
505 //                      'nucleus_skin_desc',\r
506 //                      'nucleus_template_desc',\r
507                 );\r
508                 $aTableNamesPrefixed = array(\r
509                         $mysql_prefix . 'nucleus_actionlog',\r
510                         $mysql_prefix . 'nucleus_ban',\r
511                         $mysql_prefix . 'nucleus_blog',\r
512                         $mysql_prefix . 'nucleus_category',\r
513                         $mysql_prefix . 'nucleus_comment',\r
514                         $mysql_prefix . 'nucleus_config',\r
515                         $mysql_prefix . 'nucleus_item',\r
516                         $mysql_prefix . 'nucleus_karma',\r
517                         $mysql_prefix . 'nucleus_member',\r
518                         $mysql_prefix . 'nucleus_plugin',\r
519                         $mysql_prefix . 'nucleus_skin',\r
520                         $mysql_prefix . 'nucleus_template',\r
521                         $mysql_prefix . 'nucleus_team',\r
522                         $mysql_prefix . 'nucleus_activation',\r
523                         $mysql_prefix . 'nucleus_tickets'\r
524 // these are unneeded (one of the replacements above takes care of them)\r
525 //                      $mysql_prefix . 'nucleus_plugin_event',\r
526 //                      $mysql_prefix . 'nucleus_plugin_option',\r
527 //                      $mysql_prefix . 'nucleus_plugin_option_desc',\r
528 //                      $mysql_prefix . 'nucleus_skin_desc',\r
529 //                      $mysql_prefix . 'nucleus_template_desc',\r
530                 );\r
531 \r
532                 for ($idx = 0;$idx<sizeof($queries);$idx++) {\r
533                         $query = trim($queries[$idx]);\r
534                         // echo "QUERY = <small>" . htmlspecialchars($query) . "</small><p>";\r
535                         if ($query) {\r
536                                 if ($mysql_usePrefix == 1)\r
537                                         $query = str_replace($aTableNames, $aTableNamesPrefixed, $query);\r
538                                 mysql_query($query) or _doError("Error while executing query (<small>" . htmlspecialchars($query) . "</small>): " . mysql_error());\r
539                         }\r
540 \r
541                 }\r
542 \r
543                 // 6. update global settings\r
544                 updateConfig('IndexURL',        $config_indexurl);\r
545                 updateConfig('AdminURL',        $config_adminurl);\r
546                 updateConfig('MediaURL',        $config_mediaurl);\r
547                 updateConfig('SkinsURL',        $config_skinsurl);\r
548                 updateConfig('PluginURL',       $config_pluginurl);\r
549                 updateConfig('ActionURL',       $config_actionurl);\r
550                 updateConfig('AdminEmail',      $config_adminemail);\r
551                 updateConfig('SiteName',        $config_sitename);\r
552 \r
553 \r
554                 // 7. update GOD member\r
555                 $query =  'UPDATE ' . tableName('nucleus_member')\r
556                        . " SET mname='" . addslashes($user_name) . "',"\r
557                        . "     mrealname='". addslashes($user_realname) . "',"\r
558                        . "     mpassword='". md5(addslashes($user_password)) . "',"\r
559                        . "     murl='" . addslashes($config_indexurl) . "',"\r
560                        . "     memail='" . addslashes($user_email) . "',"\r
561                        . "     madmin=1,"\r
562                        . "     mcanlogin=1"\r
563                        . " WHERE mnumber=1";\r
564                 mysql_query($query) or _doError("Error while setting member settings: " . mysql_error());\r
565 \r
566                 // 8. update weblog settings\r
567                 $query =  'UPDATE ' . tableName('nucleus_blog')\r
568                        . " SET bname='" . addslashes($blog_name) . "',"\r
569                        . "     bshortname='". addslashes($blog_shortname) . "',"\r
570                        . "     burl='" . addslashes($config_indexurl) . "'"\r
571                        . " WHERE bnumber=1";\r
572                 mysql_query($query) or _doError("Error while setting weblog settings: " . mysql_error());\r
573 \r
574                 // 9. update item date\r
575                 $query =  'UPDATE ' . tableName('nucleus_item')\r
576                         . " SET itime='". date("Y-m-d H:i:s",time()) ."'"\r
577                         . " WHERE inumber=1";\r
578                 mysql_query($query) or _doError("Error with query: " . mysql_error());\r
579 \r
580                 global $aConfPlugsToInstall, $aConfSkinsToImport;\r
581                 $aSkinErrors = array();\r
582                 $aPlugErrors = array();\r
583                 if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0)) {\r
584                         // 10. set global variables\r
585                         global $MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD, $MYSQL_DATABASE, $MYSQL_PREFIX;\r
586                         $MYSQL_HOST = $mysql_host;\r
587                         $MYSQL_USER = $mysql_user;\r
588                         $MYSQL_PASSWORD = $mysql_password;\r
589                         $MYSQL_DATABASE = $mysql_database;\r
590                         $MYSQL_PREFIX = ($mysql_usePrefix == 1)?$mysql_prefix:'';\r
591                         global $DIR_NUCLEUS, $DIR_MEDIA, $DIR_SKINS, $DIR_PLUGINS, $DIR_LANG, $DIR_LIBS;\r
592                         $DIR_NUCLEUS = $config_adminpath;\r
593                         $DIR_MEDIA = $config_mediapath;\r
594                         $DIR_SKINS = $config_skinspath;\r
595                         $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';\r
596                         $DIR_LANG = $DIR_NUCLEUS . 'language/';\r
597                         $DIR_LIBS = $DIR_NUCLEUS . 'libs/';\r
598 \r
599                         // close database connection (needs to be closed if we want to include globalfunctions.php)\r
600                         mysql_close();\r
601 \r
602                         $manager = '';\r
603                         include_once($DIR_LIBS . 'globalfunctions.php');\r
604 \r
605                         // 11. install custom skins\r
606                         $aSkinErrors = installCustomSkins($manager);\r
607 \r
608                         // 12. install custom plugins\r
609                         $aPlugErrors = installCustomPlugs($manager);\r
610 \r
611                 }\r
612 \r
613 \r
614                 // 12. Write config file ourselves (if possible)\r
615                 $bConfigWritten = 0;\r
616                 if (@file_exists('config.php') && is_writable('config.php') && $fp = @fopen('config.php', 'w')) {\r
617                         $config_data = "<" . "?php \n";\r
618                         $config_data .= "\n";\r
619                         $config_data .= "       // mySQL connection information\n";\r
620                         $config_data .= "       \$MYSQL_HOST = '" . $mysql_host . "';\n";\r
621                         $config_data .= "       \$MYSQL_USER = '" . $mysql_user . "';\n";\r
622                         $config_data .= "       \$MYSQL_PASSWORD = '" . $mysql_password . "';\n";\r
623                         $config_data .= "       \$MYSQL_DATABASE = '" . $mysql_database . "';\n";\r
624                         $config_data .= "       \$MYSQL_PREFIX = '" . (($mysql_usePrefix == 1)?$mysql_prefix:'') . "';\n";\r
625                         $config_data .= "\n";\r
626                         $config_data .= "       // main nucleus directory\n";\r
627                         $config_data .= "       \$DIR_NUCLEUS = '" . $config_adminpath . "';\n";\r
628                         $config_data .= "\n";\r
629                         $config_data .= "       // path to media dir\n";\r
630                         $config_data .= "       \$DIR_MEDIA = '" . $config_mediapath . "';\n";\r
631                         $config_data .= "\n";\r
632                         $config_data .= "       // extra skin files for imported skins\n";\r
633                         $config_data .= "       \$DIR_SKINS = '" . $config_skinspath . "';\n";\r
634                         $config_data .= "\n";\r
635                         $config_data .= "       // these dirs are normally sub dirs of the nucleus dir, but \n";\r
636                         $config_data .= "       // you can redefine them if you wish\n";\r
637                         $config_data .= "       \$DIR_PLUGINS = \$DIR_NUCLEUS . 'plugins/';\n";\r
638                         $config_data .= "       \$DIR_LANG = \$DIR_NUCLEUS . 'language/';\n";\r
639                         $config_data .= "       \$DIR_LIBS = \$DIR_NUCLEUS . 'libs/';\n";\r
640                         $config_data .= "\n";\r
641                         $config_data .= "       // include libs\n";\r
642                         $config_data .= "       include(\$DIR_LIBS.'globalfunctions.php');\n";\r
643                         $config_data .= "       if (!extension_loaded('mbstring')) {\n";\r
644                         $config_data .= "       include(\$DIR_LIBS.'mb_emulator/mb-emulator.php');\n";\r
645                         $config_data .= "       }\n";\r
646                         $config_data .= "?" . ">";\r
647 \r
648                         $result = @fputs($fp, $config_data, strlen($config_data));\r
649                         fclose($fp);\r
650 \r
651                         if ($result)\r
652                                 $bConfigWritten = 1;\r
653                 }\r
654 \r
655                 ?>\r
656 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
657                 <html xmlns="http://www.w3.org/1999/xhtml">\r
658                 <head>\r
659                         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
660                         <title>Nucleusのインストール</title>\r
661                         <style>\r
662                                 @import url('nucleus/styles/manual.css');\r
663                         </style>\r
664                 </head>\r
665                 <body>\r
666                 <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
667 <?php\r
668         $aAllErrors = array_merge($aSkinErrors, $aPlugErrors);\r
669         if (count($aAllErrors) > 0) {\r
670                 echo '<h1>Skin/Plugin Install errors</h1>';\r
671                 echo '<ul><li>'.implode('</li><li>', $aAllErrors).'</li></ul>';\r
672         }\r
673 \r
674         if (!$bConfigWritten) { ?>\r
675                         <h1>インストールはほぼ完了しました!</h1>\r
676                         <p>\r
677                         データベーステーブルの初期値入力が成功しました。後は<i>config.php</i>を書き換えるだけです。以下に書き換えるべき内容を表示します(mysqlのパスワードはマスクされています。ここは実際のものに書き換えてください)\r
678                         </p>\r
679 \r
680                         <pre>\r
681 &lt;?php\r
682         // mySQL connection information\r
683         $MYSQL_HOST = '<b><?php echo $mysql_host?></b>';\r
684         $MYSQL_USER = '<b><?php echo $mysql_user?></b>';\r
685         $MYSQL_PASSWORD = '<i><b>xxxxxxxxxxx</b></i>';\r
686         $MYSQL_DATABASE = '<b><?php echo $mysql_database?></b>';\r
687         $MYSQL_PREFIX = '<b><?php echo ($mysql_usePrefix == 1)?$mysql_prefix:''?></b>';\r
688 \r
689         // main nucleus directory\r
690         $DIR_NUCLEUS = '<b><?php echo $config_adminpath?></b>';\r
691 \r
692         // path to media dir\r
693         $DIR_MEDIA = '<b><?php echo $config_mediapath?></b>';\r
694 \r
695         // extra skin files for imported skins\r
696         $DIR_SKINS = '<b><?php echo $config_skinspath?></b>';\r
697 \r
698         // these dirs are normally sub dirs of the nucleus dir, but\r
699         // you can redefine them if you wish\r
700         $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';\r
701         $DIR_LANG = $DIR_NUCLEUS . 'language/';\r
702         $DIR_LIBS = $DIR_NUCLEUS . 'libs/';\r
703 \r
704         // include libs\r
705         include($DIR_LIBS.'globalfunctions.php');\r
706         if (!extension_loaded('mbstring')) {\r
707                 include($DIR_LIBS.'mb_emulator/mb-emulator.php');\r
708         }\r
709 ?&gt;\r
710                         </pre>\r
711 \r
712                         <p>あなたのコンピュータ上のファイルを書き換えたら、FTPを使ってウェブサーバにアップロードしてください。ASCIIモードで送信してファイルを上書きします。\r
713                         </p>\r
714 \r
715                         <div class="note">\r
716                         <b>付記:</b> <i>config.php</i>の最初や終わりにスペースを空けないようにしましょう。実行時にエラーを引き起こす原因となります。\r
717                         <br />\r
718                         したがって、config.phpの最初の文字は "&lt;"で最後の文字は"&gt;"としなければなりません。\r
719                         </div>\r
720 \r
721 <?php } else { ?>\r
722                         <h1>インストールは完了しました!</h1>\r
723 \r
724                         <p>Nucleusはインストールされ、<code>config.php</code>はアップデートされました。</p>\r
725 \r
726                         <p>セキュリティのため<code>config.php</code>のパーミッションを444に戻すことを忘れないでください(<a href="nucleus/documentation/tips.html#filepermissions">パーミッション変更の簡易ガイド</a>)。</p>\r
727 <?php } ?>\r
728                         <h1>インストールファイルの削除</h1>\r
729 \r
730                         <p>ウェブサーバから次のファイルを削除してください:</p>\r
731 \r
732                         <ul>\r
733                                 <li><b>install.sql</b>:テーブルの構造を内包するファイル</li>\r
734                                 <li><b>install.php</b>:このファイル</li>\r
735                         </ul>\r
736 \r
737                         <p>もしこれらのファイルを削除していなければ、管理領域を開くことが出来ません。</p>\r
738 \r
739                         <h1>ウェブサイトの確認</h1>\r
740                         <p>\r
741                         ウェブサイトを使う準備が整いました。\r
742                         <ul>\r
743                                 <li><a href="<?php echo $config_adminurl?>">管理領域にログインしてサイトの設定を行う</a></li>\r
744                                 <li><a href="<?php echo $config_indexurl?>">すぐにサイトへ行ってみる</a></li>\r
745                         </ul>\r
746                         </p>\r
747 \r
748                 </body>\r
749                 </html>\r
750                 <?php\r
751         }\r
752 \r
753 \r
754         function installCustomPlugs(&$manager) {\r
755                 global $aConfPlugsToInstall, $DIR_LIBS;\r
756 \r
757                 $aErrors = array();\r
758 \r
759                 if (count($aConfPlugsToInstall) == 0)\r
760                         return $aErrors;\r
761 \r
762                 $numCurrent = mysql_num_rows(sql_query('SELECT * FROM '.sql_table('plugin')));\r
763 \r
764                 foreach ($aConfPlugsToInstall as $plugName) {\r
765                         // do this before calling getPlugin (in case the plugin id is used there)\r
766                         $query = 'INSERT INTO '.sql_table('plugin').' (porder, pfile) VALUES ('.(++$numCurrent).',"'.addslashes($plugName).'")';\r
767                         sql_query($query);\r
768 \r
769                         // get and install the plugin\r
770                         $plugin =& $manager->getPlugin($plugName);\r
771                         if (!$plugin) {\r
772                                 sql_query('DELETE FROM ' . sql_table('plugin') . ' WHERE pfile=\''. addslashes($plugName).'\'');\r
773                                 $numCurrent--;\r
774                                 array_push($aErrors, 'Unable to install plugin ' . $plugName);\r
775                                 continue;\r
776                         }\r
777                         $plugin->install();\r
778                 }\r
779 \r
780                 // SYNC PLUGIN EVENT LIST\r
781                 sql_query('DELETE FROM '.sql_table('plugin_event'));\r
782                 // loop over all installed plugins\r
783                 $res = sql_query('SELECT pid, pfile FROM '.sql_table('plugin'));\r
784                 while($o = mysql_fetch_object($res)) {\r
785                         $pid = $o->pid;\r
786                         $plug =& $manager->getPlugin($o->pfile);\r
787                         if ($plug)\r
788                         {\r
789                                 $eventList = $plug->getEventList();\r
790                                 foreach ($eventList as $eventName) \r
791                                         sql_query('INSERT INTO '.sql_table('plugin_event').' (pid, event) VALUES ('.$pid.', \''.$eventName.'\')');\r
792                         }\r
793                 }\r
794 \r
795                 return $aErrors;\r
796         }\r
797 \r
798         function installCustomSkins(&$manager) {\r
799                 global $aConfSkinsToImport, $DIR_LIBS, $DIR_SKINS;\r
800 \r
801                 $aErrors = array();\r
802 \r
803                 if (count($aConfSkinsToImport) == 0)\r
804                         return $aErrors;\r
805 \r
806                 // load skinie class\r
807                 include_once($DIR_LIBS . 'skinie.php');\r
808 \r
809                 $importer = new SKINIMPORT();\r
810 \r
811                 foreach ($aConfSkinsToImport as $skinName) {\r
812                         $importer->reset();\r
813 \r
814                         $skinFile = $DIR_SKINS . $skinName . '/skinbackup.xml';\r
815                         if (!@file_exists($skinFile)) {\r
816                                 array_push($aErrors, 'Unable to import ' . $skinFile . ' : file does not exist');\r
817                                 continue;\r
818                         }\r
819                         $error = $importer->readFile($skinFile);\r
820                         if ($error) {\r
821                                 array_push($aErrors, 'Unable to import ' . $skinName . ' : ' . $error);\r
822                                 continue;\r
823                         }\r
824                         $error = $importer->writeToDatabase(1);\r
825                         if ($error) {\r
826                                 array_push($aErrors, 'Unable to import ' . $skinName . ' : ' . $error);\r
827                                 continue;\r
828                         }\r
829                 }\r
830 \r
831                 return $aErrors;\r
832         }\r
833 \r
834         // give an error if one or more nucleus are not accessible\r
835         function doCheckFiles() {\r
836                 $missingfiles = array();\r
837 \r
838                 if (!is_readable('install.sql'))\r
839                         array_push($missingfiles, "File <b>install.sql</b> is missing or not readable");\r
840                 if (!is_readable('index.php'))\r
841                         array_push($missingfiles, "File <b>index.php</b> is missing or not readable");\r
842                 if (!is_readable('action.php'))\r
843                         array_push($missingfiles, "File <b>action.php</b> is missing or not readable");\r
844                 if (!is_readable('nucleus/index.php'))\r
845                         array_push($missingfiles, "File <b>nucleus/index.php</b> is missing or not readable");\r
846                 if (!is_readable('nucleus/libs/globalfunctions.php'))\r
847                         array_push($missingfiles, "File <b>nucleus/libs/globalfunctions.php</b> is missing or not readable");\r
848                 if (!is_readable('nucleus/libs/ADMIN.php'))\r
849                         array_push($missingfiles, "File <b>nucleus/libs/ADMIN.php</b> is missing or not readable");\r
850                 if (!is_readable('nucleus/libs/BLOG.php'))\r
851                         array_push($missingfiles, "File <b>nucleus/libs/BLOG.php</b> is missing or not readable");\r
852                 if (!is_readable('nucleus/libs/COMMENT.php'))\r
853                         array_push($missingfiles, "File <b>nucleus/libs/COMMENT.php</b> is missing or not readable");\r
854                 if (!is_readable('nucleus/libs/COMMENTS.php'))\r
855                         array_push($missingfiles, "File <b>nucleus/libs/COMMENTS.php</b> is missing or not readable");\r
856                 if (!is_readable('nucleus/libs/ITEM.php'))\r
857                         array_push($missingfiles, "File <b>nucleus/libs/ITEM.php</b> is missing or not readable");\r
858                 if (!is_readable('nucleus/libs/MEMBER.php'))\r
859                         array_push($missingfiles, "File <b>nucleus/libs/MEMBER.php</b> is missing or not readable");\r
860                 if (!is_readable('nucleus/libs/SKIN.php'))\r
861                         array_push($missingfiles, "File <b>nucleus/libs/SKIN.php</b> is missing or not readable");\r
862                 if (!is_readable('nucleus/libs/TEMPLATE.php'))\r
863                         array_push($missingfiles, "File <b>nucleus/libs/TEMPLATE.php</b> is missing or not readable");\r
864                 if (!is_readable('nucleus/libs/MEDIA.php'))\r
865                         array_push($missingfiles, "File <b>nucleus/libs/MEDIA.php</b> is missing or not readable");\r
866                 if (!is_readable('nucleus/libs/ACTIONLOG.php'))\r
867                         array_push($missingfiles, "File <b>nucleus/libs/ACTIONLOG.php</b> is missing or not readable");\r
868                 if (!is_readable('nucleus/media.php'))\r
869                         array_push($missingfiles, "File <b>nucleus/media.php</b> is missing or not readable");\r
870 \r
871 \r
872                 if (sizeof($missingfiles) > 0)\r
873                         showErrorMessages($missingfiles);\r
874 \r
875 \r
876         }\r
877 \r
878         function updateConfig($name, $val) {\r
879                 $name = addslashes($name);\r
880                 $val = trim(addslashes($val));\r
881 \r
882                 $query = 'UPDATE ' . tableName('nucleus_config')\r
883                        . " SET value='$val'"\r
884                        . " WHERE name='$name'";\r
885 \r
886                 mysql_query($query) or _doError("Query error while trying to update config: " . mysql_error());\r
887                 return mysql_insert_id();\r
888         }\r
889 \r
890         function endsWithSlash($s) {\r
891                 return (strrpos($s,'/') == strlen($s) - 1);\r
892         }\r
893 \r
894         /**\r
895           * Checks if email address is valid\r
896           */\r
897         function _isValidMailAddress($address) {\r
898                 if (preg_match("/^[a-zA-Z0-9\._-]+@+[A-Za-z0-9\._-]+\.+[A-Za-z]{2,4}$/", $address))\r
899                         return 1;\r
900                 else\r
901                         return 0;\r
902         }\r
903 \r
904         // returns true if the given string is a valid shortname\r
905         // (to check short blog names and nicknames)\r
906         // logic: starts and ends with a non space, can contain spaces in between\r
907         //        min 2 chars\r
908         function _isValidShortName($name) {\r
909                 if (eregi("^[a-z0-9]+$", $name))\r
910                         return 1;\r
911                 else\r
912                         return 0;\r
913         }\r
914 \r
915 \r
916 \r
917         // returns true if the given string is a valid display name\r
918         // (to check nicknames)\r
919         function _isValidDisplayName($name) {\r
920                 if (eregi("^[a-z0-9]+[a-z0-9 ]*[a-z0-9]+$", $name))\r
921                         return 1;\r
922                 else\r
923                         return 0;\r
924         }\r
925 \r
926         function _doError($msg) {\r
927                 ?>\r
928 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
929                 <html xmlns="http://www.w3.org/1999/xhtml">\r
930                 <head>\r
931                         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
932                         <title>Nucleus Install</title>\r
933                         <style>\r
934                                 @import url('nucleus/styles/manual.css');\r
935                         </style>\r
936                 </head>\r
937                 <body>\r
938                   <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
939                         <h1>Error!</h1>\r
940                         <p>\r
941                         Error message was: "<?php echo $msg?>";\r
942                         </p>\r
943 \r
944                         <p>\r
945                         <a href="install.php" onclick="history.back();return false;">Go Back</a>\r
946                         </p>\r
947                 </body>\r
948                 </html>\r
949                 <?php           exit;\r
950         }\r
951 \r
952         function showErrorMessages($errors) {\r
953                 ?>\r
954 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
955                 <html xmlns="http://www.w3.org/1999/xhtml">\r
956                 <head>\r
957                         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
958                         <title>Nucleus Install</title>\r
959                         <style>\r
960                                 @import url('nucleus/styles/manual.css');\r
961                         </style>\r
962                 </head>\r
963                 <body>\r
964                   <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
965                         <h1>Errors!</h1>\r
966                         <p>\r
967                         Errors were found:\r
968                         </p>\r
969 \r
970                         <ul>\r
971                         <?php   while($msg = array_shift($errors))\r
972                                         echo "<li>$msg</li>";\r
973                         ?>\r
974                         </ul>\r
975 \r
976                         <p>\r
977                         <a href="install.php" onclick="history.back();return false;">Go Back</a>\r
978                         </p>\r
979                 </body>\r
980                 </html>\r
981                 <?php           exit;\r
982         }\r
983 \r
984 \r
985         /* for the non-php systems that decide to show the contents:\r
986            ?></div><?php        */\r
987 \r
988 ?>\r