OSDN Git Service

重複キーをコメントアウト(install.sql)
[nucleus-jp/nucleus-jp-ancient.git] / install.php
1 <?php\r
2 /*\r
3  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
4  * Copyright (C) 2002-2009 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  * Below is a friendly way of letting users on non-php systems know that Nucleus won't run there.\r
15  * ?><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
16  */\r
17 \r
18 /**\r
19  * @license http://nucleuscms.org/license.txt GNU General Public License\r
20  * @copyright Copyright (C) 2002-2009 The Nucleus Group\r
21  * @version $Id$\r
22  * $NucleusJP: install.php,v 1.7 2007/02/04 06:28:44 kimitake Exp $\r
23  */\r
24 \r
25 /*\r
26         This part of the install.php code allows for customization of the install process.\r
27         When distributing plugins or skins together with a Nucleus installation, the\r
28         configuration below will instruct to install them\r
29 \r
30         -- Start Of Configurable Part --\r
31 */\r
32 \r
33 include('./install_lang_japanese-utf8.php');\r
34 \r
35 // array with names of plugins to install. Plugin files must be present in the nucleus/plugin/\r
36 // directory.\r
37 //\r
38 // example:\r
39 //     array('NP_TrackBack', 'NP_MemberGoodies')\r
40 $aConfPlugsToInstall = array('NP_SkinFiles');\r
41 \r
42 \r
43 // array with skins to install. skins must be present under the skins/ directory with\r
44 // a subdirectory having the same name that contains a skinbackup.xml file\r
45 //\r
46 // example:\r
47 //     array('base','rsd')\r
48 $aConfSkinsToImport = array('default');\r
49 \r
50 /*\r
51         -- End Of Configurable Part --\r
52 */\r
53 \r
54 // don't give warnings for uninitialized vars\r
55 error_reporting(E_ERROR | E_WARNING | E_PARSE);\r
56 \r
57 // make sure there's no unnecessary escaping:\r
58 set_magic_quotes_runtime(0);\r
59 \r
60 // if there are some plugins or skins to import, do not include vars\r
61 // in globalfunctions.php again... so set a flag\r
62 if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0) ) {\r
63         global $CONF;\r
64         $CONF['installscript'] = 1;\r
65 }\r
66 \r
67 if (phpversion() >= '4.1.0') {\r
68         include_once('nucleus/libs/vars4.1.0.php');\r
69 } else {\r
70         include_once('nucleus/libs/vars4.0.6.php');\r
71 }\r
72 \r
73 include_once('nucleus/libs/mysql.php');\r
74 \r
75 // check if mysql support is installed\r
76         if (!function_exists('mysql_query') ) {\r
77                 _doError(_ERROR1);\r
78         }\r
79 \r
80         if (postVar('action') == 'go') {\r
81                 doInstall();\r
82         } else {\r
83                 showInstallForm();\r
84         }\r
85 \r
86 exit;\r
87 \r
88 function showInstallForm() {\r
89         // 0. pre check if all necessary files exist\r
90         doCheckFiles();\r
91 \r
92         ?>\r
93         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
94         <html xmlns="http://www.w3.org/1999/xhtml">\r
95         <head>\r
96                 <meta http-equiv="content-type" content="application/xhtml+xml; charset=<?php echo _CHARSET; ?>" />\r
97                 <title><?php echo _TITLE; ?></title>\r
98                 <style type="text/css"><!--\r
99                         @import url('nucleus/documentation/styles/manual.css');\r
100                 --></style>\r
101                 <script type="text/javascript"><!--\r
102                         var submitcount = 0;\r
103 \r
104                         // function to make sure the submit button only gets pressed once\r
105                         function checkSubmit() {\r
106                                 if (submitcount == 0) {\r
107                                         submitcount++;\r
108                                         return true;\r
109                                 } else {\r
110                                         return false;\r
111                                 }\r
112                         }\r
113                 --></script>\r
114         </head>\r
115         <body>\r
116                 <div style="text-align:center"><img src="./nucleus/styles/logo.gif" /></div> <!-- Nucleus logo -->\r
117                 <form method="post" action="install.php">\r
118 \r
119                 <h1><?php echo _HEADER1; ?></h1>\r
120 \r
121                 <?php echo _TEXT1; ?>\r
122 \r
123                 <h1><?php echo _HEADER2; ?></h1>\r
124 \r
125                 <?php echo _TEXT2; ?>\r
126 \r
127                 <ul>\r
128                         <li>PHP:\r
129 \r
130 <?php\r
131         echo phpversion();\r
132         $minVersion = '4.0.6';\r
133 \r
134         if (phpversion() < $minVersion) {\r
135                 echo ' <span class="warning" style="display:block">' . sprintf(_TEXT2_WARN, $minVersion) . '</span>';\r
136         } elseif (phpversion() < '5') {\r
137                 echo ' <span class="warning" style="display:block">' . _TEXT2_WARN3 . '</span>';\r
138         }\r
139 ?>\r
140 \r
141                         </li>\r
142                         <li>MySQL:\r
143 \r
144 <?php\r
145         // note: this piece of code is taken from phpMyAdmin\r
146         $result = @mysql_query('SELECT VERSION() AS version');\r
147 \r
148         if ($result != FALSE && @mysql_num_rows($result) > 0) {\r
149                 $row   = mysql_fetch_array($result);\r
150                 $match = explode('.', $row['version']);\r
151         } else {\r
152                 $result = @mysql_query('SHOW VARIABLES LIKE \'version\'');\r
153 \r
154                 if ($result != FALSE && @mysql_num_rows($result) > 0) {\r
155                         $row   = mysql_fetch_row($result);\r
156                         $match = explode('.', $row[1]);\r
157                 } else {\r
158                         $output = shell_exec('mysql -V');\r
159                         preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);\r
160                         $match = explode('.', $version[0]);\r
161 \r
162                         if ($match[0] == '') {\r
163                                 $match[0] = '0';\r
164                                 $match[1] = '0';\r
165                                 $match[2] = '0';\r
166                         }\r
167                 }\r
168         }\r
169 \r
170         $mysqlVersion = implode($match, '.');\r
171         $minVersion = '3.23';\r
172 \r
173         if ($mysqlVersion == '0.0.0') {\r
174                 echo _NOTIFICATION1;\r
175         }\r
176         else {\r
177                 echo $mysqlVersion;\r
178         }\r
179 \r
180         if ($mysqlVersion < $minVersion) {\r
181                 echo ' <span class="warning" style="display:block">' . sprintf(_TEXT2_WARN2, $minVersion) . '</span>';\r
182         }\r
183 ?>\r
184 \r
185                         </li>\r
186                 </ul>\r
187 \r
188 <?php\r
189         // tell people how they can have their config file filled out automatically\r
190         if (@file_exists('config.php') && @!is_writable('config.php')) {\r
191 ?>\r
192 \r
193                 <h1><?php echo _HEADER3; ?></h1>\r
194 \r
195                 <?php echo _TEXT3;\r
196 \r
197 } ?>\r
198 \r
199                 <h1><?php echo _HEADER4; ?></h1>\r
200 \r
201                 <?php echo _TEXT4; ?>\r
202 \r
203                 <fieldset>\r
204                         <legend><?php echo _TEXT4_TAB_HEAD; ?></legend>\r
205                         <table>\r
206                                 <tr>\r
207                                         <td><?php echo _TEXT4_TAB_FIELD1; ?></td>\r
208                                         <td><input name="mySQL_host" value="<?php echo htmlspecialchars(@ini_get('mysql.default_host') )?>" /></td>\r
209                                 </tr>\r
210                                 <tr>\r
211                                         <td><?php echo _TEXT4_TAB_FIELD2; ?></td>\r
212                                         <td><input name="mySQL_user" /></td>\r
213                                 </tr>\r
214                                 <tr>\r
215                                         <td><?php echo _TEXT4_TAB_FIELD3; ?></td>\r
216                                         <td><input name="mySQL_password" type="password" /></td>\r
217                                 </tr>\r
218                                 <tr>\r
219                                         <td><?php echo _TEXT4_TAB_FIELD4; ?></td>\r
220                                         <td><input name="mySQL_database" /> (<input name="mySQL_create" value="1" type="checkbox" id="mySQL_create" /><label for="mySQL_create"><?php echo _TEXT4_TAB_FIELD4_ADD; ?></label>)</td>\r
221                                 </tr>\r
222                         </table>\r
223                 </fieldset>\r
224 \r
225                 <fieldset>\r
226                         <legend><?php echo _TEXT4_TAB2_HEAD; ?></legend>\r
227                         <table>\r
228                                 <tr>\r
229                                         <td><input name="mySQL_usePrefix" value="1" type="checkbox" id="mySQL_usePrefix" /><label for="mySQL_usePrefix"><?php echo _TEXT4_TAB2_FIELD; ?></label></td>\r
230                                         <td><input name="mySQL_tablePrefix" value="" /></td>\r
231                                 </tr>\r
232                         </table>\r
233 \r
234                         <?php echo _TEXT4_TAB2_ADD; ?>\r
235 \r
236                 </fieldset>\r
237 \r
238         <h1><?php echo _HEADER5; ?></h1>\r
239 \r
240         <?php echo _TEXT5; ?>\r
241 \r
242 <?php\r
243 \r
244         // no need to this all! dirname(__FILE__) is all we need -- moraes\r
245         /*\r
246         // discover full path\r
247         $fullPath = serverVar('PATH_TRANSLATED');\r
248 \r
249         if ($fullPath == '') {\r
250                 $fullPath = serverVar('SCRIPT_FILENAME');\r
251         }\r
252 \r
253         $basePath = str_replace('install.php', '', $fullPath);\r
254         $basePath = replaceDoubleBackslash($basePath);\r
255         $basePath = replaceDoubleBackslash($basePath);\r
256 \r
257         // add slash at end if necessary\r
258         if (!endsWithSlash($basePath) ) {\r
259                 $basePath .= '/';\r
260         }\r
261         */\r
262 \r
263         $basePath = dirname(__FILE__) . '/';\r
264 ?>\r
265 \r
266                 <fieldset>\r
267                         <legend><?php echo _TEXT5_TAB_HEAD; ?></legend>\r
268                         <table>\r
269                                 <tr>\r
270                                         <td><?php echo _TEXT5_TAB_FIELD1; ?></td>\r
271                                         <td><input name="IndexURL" size="60" value="<?php\r
272                                                 $url = 'http://' . serverVar('HTTP_HOST') . serverVar('PHP_SELF');\r
273                                                 $url = str_replace('install.php', '', $url);\r
274                                                 $url = replaceDoubleBackslash($url);\r
275 \r
276                                                 // add slash at end if necessary\r
277                                                 if (!endsWithSlash($url) ) {\r
278                                                         $url .= '/';\r
279                                                 }\r
280 \r
281                                                 echo $url; ?>" /></td>\r
282                                 </tr>\r
283                                 <tr>\r
284                                         <td><?php echo _TEXT5_TAB_FIELD2; ?></td>\r
285                                         <td><input name="AdminURL" size="60" value="<?php\r
286                                                 if ($url) {\r
287                                                         echo $url . 'nucleus/';\r
288                                                 } ?>" /></td>\r
289                                 </tr>\r
290                                 <tr>\r
291                                         <td><?php echo _TEXT5_TAB_FIELD3; ?></td>\r
292                                         <td><input name="AdminPath" size="60" value="<?php\r
293                                                 if($basePath) {\r
294                                                         echo $basePath . 'nucleus/';\r
295                                                 } ?>" /></td>\r
296                                 </tr>\r
297                                 <tr>\r
298                                         <td><?php echo _TEXT5_TAB_FIELD4; ?></td>\r
299                                         <td><input name="MediaURL" size="60" value="<?php\r
300                                                 if ($url) {\r
301                                                         echo $url . 'media/';\r
302                                                 } ?>" /></td>\r
303                                 </tr>\r
304                                 <tr>\r
305                                         <td><?php echo _TEXT5_TAB_FIELD5; ?></td>\r
306                                         <td><input name="MediaPath" size="60" value="<?php\r
307                                                 if ($basePath) {\r
308                                                         echo $basePath . 'media/';\r
309                                                 } ?>" /></td>\r
310                                 </tr>\r
311                                 <tr>\r
312                                         <td><?php echo _TEXT5_TAB_FIELD6; ?></td>\r
313                                         <td><input name="SkinsURL" size="60" value="<?php\r
314                                                 if ($url) {\r
315                                                         echo $url . 'skins/';\r
316                                                 } ?>" />\r
317                                                 <br />(<?php echo _TEXT5_TAB_FIELD7_2; ?>)\r
318                                         </td>\r
319                                 </tr>\r
320                                 <tr>\r
321                                         <td><?php echo _TEXT5_TAB_FIELD7; ?></td>\r
322                                         <td><input name="SkinsPath" size="60" value="<?php\r
323                                                 if ($basePath) {\r
324                                                         echo $basePath . 'skins/';\r
325                                                 } ?>" />\r
326                                                 <br />(<?php echo _TEXT5_TAB_FIELD7_2; ?>)\r
327                                         </td>\r
328                                 </tr>\r
329                                 <tr>\r
330                                         <td><?php echo _TEXT5_TAB_FIELD8; ?></td>\r
331                                         <td><input name="PluginURL" size="60" value="<?php\r
332                                                 if ($url) {\r
333                                                         echo $url . 'nucleus/plugins/';\r
334                                                 } ?>" /></td>\r
335                                 </tr>\r
336                                 <tr>\r
337                                         <td><?php echo _TEXT5_TAB_FIELD9; ?></td>\r
338                                         <td><input name="ActionURL" size="60" value="<?php\r
339                                                 if ($url) {\r
340                                                         echo $url . 'action.php';\r
341                                                 } ?>" />\r
342                                                 <br />(<?php echo _TEXT5_TAB_FIELD9_2;?>)\r
343                                         </td>\r
344                                 </tr>\r
345                         </table>\r
346                 </fieldset>\r
347 \r
348                 <?php echo _TEXT5_2; ?>\r
349 \r
350                 <h1><? echo _HEADER6; ?></h1>\r
351 \r
352                 <?php echo _TEXT6; ?>\r
353 \r
354                 <fieldset>\r
355                         <legend><?php echo _TEXT6_TAB_HEAD; ?></legend>\r
356                         <table>\r
357                                 <tr>\r
358                                         <td><?php echo _TEXT6_TAB_FIELD1; ?></td>\r
359                                         <td><input name="User_name" value="" /> <small>(<?php echo _TEXT6_TAB_FIELD1_2; ?>)</small></td>\r
360                                 </tr>\r
361                                 <tr>\r
362                                         <td><?php echo _TEXT6_TAB_FIELD2; ?></td>\r
363                                         <td><input name="User_realname" value="" /></td>\r
364                                 </tr>\r
365                                 <tr>\r
366                                         <td><?php echo _TEXT6_TAB_FIELD3; ?></td>\r
367                                         <td><input name="User_password" type="password" value="" /></td>\r
368                                 </tr>\r
369                                 <tr>\r
370                                         <td><?php echo _TEXT6_TAB_FIELD4; ?></td>\r
371                                         <td><input name="User_password2" type="password" value="" /></td>\r
372                                 </tr>\r
373                                 <tr>\r
374                                         <td><?php echo _TEXT6_TAB_FIELD5; ?></td>\r
375                                         <td><input name="User_email" value="" /> <small>(<?php echo _TEXT6_TAB_FIELD5_2; ?>)</small></td>\r
376                                 </tr>\r
377                         </table>\r
378                 </fieldset>\r
379 \r
380                 <h1><?php echo _HEADER7; ?></h1>\r
381 \r
382                 <?php echo _TEXT7; ?>\r
383 \r
384                 <fieldset>\r
385                         <legend><?php echo _TEXT7_TAB_HEAD; ?></legend>\r
386                         <table>\r
387                                 <tr>\r
388                                         <td><?php echo _TEXT7_TAB_FIELD1; ?></td>\r
389                                         <td><input name="Blog_name" size="60" value="My Nucleus CMS" /></td>\r
390                                 </tr>\r
391                                 <tr>\r
392                                         <td><?php echo _TEXT7_TAB_FIELD2; ?></td>\r
393                                         <td><input name="Blog_shortname" value="mynucleuscms" /> <small>(<?php echo _TEXT7_TAB_FIELD2_2; ?>)</small></td>\r
394                                 </tr>\r
395                         </table>\r
396                 </fieldset>\r
397 \r
398                 <h1><?php echo _HEADER8; ?></h1>\r
399 \r
400                 <fieldset>\r
401                         <legend><?php echo _TEXT8_TAB_HEADER; ?></legend>\r
402                         <table>\r
403                                 <tr>\r
404                                         <td><input name="Weblog_ping" value="1" type="checkbox" id="Weblog_ping" /><?php echo _TEXT8_TAB_FIELD1; ?></td>\r
405                                 </tr>\r
406                         </table>\r
407                 </fieldset>\r
408 \r
409                 <h1><?php echo _HEADER9; ?></h1>\r
410 \r
411                 <?php echo _TEXT9; ?>\r
412 \r
413                 <p><input name="action" value="go" type="hidden" /> <input type="submit" value="<?php echo _BUTTON1; ?>" onclick="return checkSubmit();" /></p>\r
414 \r
415                 </form>\r
416         </body>\r
417 </html>\r
418 \r
419 <?php }\r
420 \r
421 function tableName($unPrefixed) {\r
422         global $mysql_usePrefix, $mysql_prefix;\r
423 \r
424         if ($mysql_usePrefix == 1) {\r
425                 return $mysql_prefix . $unPrefixed;\r
426         } else {\r
427                 return $unPrefixed;\r
428         }\r
429 }\r
430 \r
431 function doInstall() {\r
432         global $mysql_usePrefix, $mysql_prefix, $weblog_ping;\r
433 \r
434         // 0. put all POST-vars into vars\r
435         $mysql_host        = postVar('mySQL_host');\r
436         $mysql_user        = postVar('mySQL_user');\r
437         $mysql_password    = postVar('mySQL_password');\r
438         $mysql_database    = postVar('mySQL_database');\r
439         $mysql_create      = postVar('mySQL_create');\r
440         $mysql_usePrefix   = postVar('mySQL_usePrefix');\r
441         $mysql_prefix      = postVar('mySQL_tablePrefix');\r
442         $config_indexurl   = postVar('IndexURL');\r
443         $config_adminurl   = postVar('AdminURL');\r
444         $config_adminpath  = postVar('AdminPath');\r
445         $config_mediaurl   = postVar('MediaURL');\r
446         $config_skinsurl   = postVar('SkinsURL');\r
447         $config_pluginurl  = postVar('PluginURL');\r
448         $config_actionurl  = postVar('ActionURL');\r
449         $config_mediapath  = postVar('MediaPath');\r
450         $config_skinspath  = postVar('SkinsPath');\r
451         $user_name         = postVar('User_name');\r
452         $user_realname     = postVar('User_realname');\r
453         $user_password     = postVar('User_password');\r
454         $user_password2    = postVar('User_password2');\r
455         $user_email        = postVar('User_email');\r
456         $blog_name         = postVar('Blog_name');\r
457         $blog_shortname    = postVar('Blog_shortname');\r
458         $config_adminemail = $user_email;\r
459         $config_sitename   = $blog_name;\r
460         $weblog_ping       = postVar('Weblog_ping');\r
461 \r
462         $config_indexurl   = replaceDoubleBackslash($config_indexurl);\r
463         $config_adminurl   = replaceDoubleBackslash($config_adminurl);\r
464         $config_mediaurl   = replaceDoubleBackslash($config_mediaurl);\r
465         $config_skinsurl   = replaceDoubleBackslash($config_skinsurl);\r
466         $config_pluginurl  = replaceDoubleBackslash($config_pluginurl);\r
467         $config_actionurl  = replaceDoubleBackslash($config_actionurl);\r
468         $config_adminpath  = replaceDoubleBackslash($config_adminpath);\r
469         $config_skinspath  = replaceDoubleBackslash($config_skinspath);\r
470         $config_mediapath  = replaceDoubleBackslash($config_mediapath);\r
471 \r
472         // 1. check all the data\r
473         $errors = array();\r
474 \r
475         if (!$mysql_database) {\r
476                 array_push($errors, _ERROR2);\r
477         }\r
478 \r
479         if (($mysql_usePrefix == 1) && (strlen($mysql_prefix) == 0) ) {\r
480                 array_push($errors, _ERROR3);\r
481         }\r
482 \r
483         if (($mysql_usePrefix == 1) && (!eregi('^[a-zA-Z0-9_]+$', $mysql_prefix) ) ) {\r
484                 array_push($errors, _ERROR4);\r
485         }\r
486 \r
487         // TODO: add action.php check\r
488         if (!endsWithSlash($config_indexurl) || !endsWithSlash($config_adminurl) || !endsWithSlash($config_mediaurl) || !endsWithSlash($config_pluginurl) || !endsWithSlash($config_skinsurl) ) {\r
489                 array_push($errors, _ERROR5);\r
490         }\r
491 \r
492         if (!endsWithSlash($config_adminpath) ) {\r
493                 array_push($errors, _ERROR6);\r
494         }\r
495 \r
496         if (!endsWithSlash($config_mediapath) ) {\r
497                 array_push($errors, _ERROR7);\r
498         }\r
499 \r
500         if (!endsWithSlash($config_skinspath) ) {\r
501                 array_push($errors, _ERROR8);\r
502         }\r
503 \r
504         if (!is_dir($config_adminpath) ) {\r
505                 array_push($errors, _ERROR9);\r
506         }\r
507 \r
508         if (!_isValidMailAddress($user_email) ) {\r
509                 array_push($errors, _ERROR10);\r
510         }\r
511 \r
512         if (!_isValidDisplayName($user_name) ) {\r
513                 array_push($errors, _ERROR11);\r
514         }\r
515 \r
516         if (!$user_password || !$user_password2) {\r
517                 array_push($errors, _ERROR12);\r
518         }\r
519 \r
520         if ($user_password != $user_password2) {\r
521                 array_push($errors, _ERROR13);\r
522         }\r
523 \r
524         if (!_isValidShortName($blog_shortname) ) {\r
525                 array_push($errors, _ERROR14);\r
526         }\r
527 \r
528         if (sizeof($errors) > 0) {\r
529                 showErrorMessages($errors);\r
530         }\r
531 \r
532         // 2. try to log in to mySQL\r
533         global $MYSQL_CONN;\r
534         $MYSQL_CONN = @mysql_connect($mysql_host, $mysql_user, $mysql_password);\r
535 \r
536         if ($MYSQL_CONN == false) {\r
537                 _doError(_ERROR15 . ': ' . mysql_error() );\r
538         }\r
539 \r
540         // 3. try to create database (if needed)\r
541         if ($mysql_create == 1) {\r
542                 mysql_query('CREATE DATABASE ' . $mysql_database) or _doError(_ERROR16 . ': ' . mysql_error() );\r
543         }\r
544 \r
545         // 4. try to select database\r
546         mysql_select_db($mysql_database) or _doError(_ERROR17);\r
547 \r
548         // 5. execute queries\r
549         $filename = 'install.sql';\r
550         $fd = fopen($filename, 'r');\r
551         $queries = fread($fd, filesize($filename) );\r
552         fclose($fd);\r
553 \r
554         $queries = split("(;\n|;\r)", $queries);\r
555 \r
556         $aTableNames = array(\r
557                 'nucleus_actionlog',\r
558                 'nucleus_ban',\r
559                 'nucleus_blog',\r
560                 'nucleus_category',\r
561                 'nucleus_comment',\r
562                 'nucleus_config',\r
563                 'nucleus_item',\r
564                 'nucleus_karma',\r
565                 'nucleus_member',\r
566                 'nucleus_plugin',\r
567                 'nucleus_skin',\r
568                 'nucleus_template',\r
569                 'nucleus_team',\r
570                 'nucleus_activation',\r
571                 'nucleus_tickets'\r
572         );\r
573 // these are unneeded (one of the replacements above takes care of them)\r
574 //                      'nucleus_plugin_event',\r
575 //                      'nucleus_plugin_option',\r
576 //                      'nucleus_plugin_option_desc',\r
577 //                      'nucleus_skin_desc',\r
578 //                      'nucleus_template_desc',\r
579 \r
580         $aTableNamesPrefixed = array(\r
581                 $mysql_prefix . 'nucleus_actionlog',\r
582                 $mysql_prefix . 'nucleus_ban',\r
583                 $mysql_prefix . 'nucleus_blog',\r
584                 $mysql_prefix . 'nucleus_category',\r
585                 $mysql_prefix . 'nucleus_comment',\r
586                 $mysql_prefix . 'nucleus_config',\r
587                 $mysql_prefix . 'nucleus_item',\r
588                 $mysql_prefix . 'nucleus_karma',\r
589                 $mysql_prefix . 'nucleus_member',\r
590                 $mysql_prefix . 'nucleus_plugin',\r
591                 $mysql_prefix . 'nucleus_skin',\r
592                 $mysql_prefix . 'nucleus_template',\r
593                 $mysql_prefix . 'nucleus_team',\r
594                 $mysql_prefix . 'nucleus_activation',\r
595                 $mysql_prefix . 'nucleus_tickets'\r
596         );\r
597 // these are unneeded (one of the replacements above takes care of them)\r
598 //                      $mysql_prefix . 'nucleus_plugin_event',\r
599 //                      $mysql_prefix . 'nucleus_plugin_option',\r
600 //                      $mysql_prefix . 'nucleus_plugin_option_desc',\r
601 //                      $mysql_prefix . 'nucleus_skin_desc',\r
602 //                      $mysql_prefix . 'nucleus_template_desc',\r
603 \r
604         $count = count($queries);\r
605 \r
606         for ($idx = 0; $idx < $count; $idx++) {\r
607                 $query = trim($queries[$idx]);\r
608                 // echo "QUERY = <small>" . htmlspecialchars($query) . "</small><p>";\r
609 \r
610                 if ($query) {\r
611 \r
612                         if ($mysql_usePrefix == 1) {\r
613                                         $query = str_replace($aTableNames, $aTableNamesPrefixed, $query);\r
614                         }\r
615 \r
616                         mysql_query($query) or _doError(_ERROR30 . ' (<small>' . htmlspecialchars($query) . '</small>): ' . mysql_error() );\r
617                 }\r
618         }\r
619 \r
620         // 5a make first post\r
621         $newpost = "INSERT INTO " . tableName('nucleus_item') . " VALUES (1, '" . _1ST_POST_TITLE . "', '" . _1ST_POST . "', '" . _1ST_POST2 . "', 1, 1, '2005-08-15 11:04:26', 0, 0, 0, 1, 0, 1);";\r
622         mysql_query($newpost) or _doError(_ERROR18 . ' (<small>' . htmlspecialchars($newpost) . '</small>): ' . mysql_error() );\r
623 \r
624         // 6. update global settings\r
625         updateConfig('IndexURL',   $config_indexurl);\r
626         updateConfig('AdminURL',   $config_adminurl);\r
627         updateConfig('MediaURL',   $config_mediaurl);\r
628         updateConfig('SkinsURL',   $config_skinsurl);\r
629         updateConfig('PluginURL',  $config_pluginurl);\r
630         updateConfig('ActionURL',  $config_actionurl);\r
631         updateConfig('AdminEmail', $config_adminemail);\r
632         updateConfig('SiteName',   $config_sitename);\r
633 \r
634         // 7. update GOD member\r
635         $query = 'UPDATE ' . tableName('nucleus_member')\r
636                    . " SET mname     = '" . addslashes($user_name) . "',"\r
637                    . " mrealname     = '" . addslashes($user_realname) . "',"\r
638                    . " mpassword     = '" . md5(addslashes($user_password) ) . "',"\r
639                    . " murl          = '" . addslashes($config_indexurl) . "',"\r
640                    . " memail        = '" . addslashes($user_email) . "',"\r
641                    . " madmin        = 1,"\r
642                    . " mcanlogin     = 1"\r
643                    . " WHERE"\r
644                    . " mnumber       = 1";\r
645 \r
646         mysql_query($query) or _doError(_ERROR19 . ': ' . mysql_error() );\r
647 \r
648         // 8. update weblog settings\r
649         $query = 'UPDATE ' . tableName('nucleus_blog')\r
650                    . " SET bname  = '" . addslashes($blog_name) . "',"\r
651                    . " bshortname = '" . addslashes($blog_shortname) . "',"\r
652                    . " burl       = '" . addslashes($config_indexurl) . "'"\r
653                    . " WHERE"\r
654                    . " bnumber    = 1";\r
655 \r
656         mysql_query($query) or _doError(_ERROR20 . ': ' . mysql_error() );\r
657 \r
658         // 9. update item date\r
659         $query = 'UPDATE ' . tableName('nucleus_item')\r
660                    . " SET   itime   = '" . date('Y-m-d H:i:s', time() ) ."'"\r
661                    . " WHERE inumber = 1";\r
662 \r
663         mysql_query($query) or _doError(_ERROR21 . ': ' . mysql_error() );\r
664 \r
665         global $aConfPlugsToInstall, $aConfSkinsToImport;\r
666         $aSkinErrors = array();\r
667         $aPlugErrors = array();\r
668 \r
669         if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0) ) {\r
670                 // 10. set global variables\r
671                 global $MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD, $MYSQL_DATABASE, $MYSQL_PREFIX;\r
672 \r
673                 $MYSQL_HOST     = $mysql_host;\r
674                 $MYSQL_USER     = $mysql_user;\r
675                 $MYSQL_PASSWORD = $mysql_password;\r
676                 $MYSQL_DATABASE = $mysql_database;\r
677                 $MYSQL_PREFIX   = ($mysql_usePrefix == 1) ? $mysql_prefix : '';\r
678 \r
679                 global $DIR_NUCLEUS, $DIR_MEDIA, $DIR_SKINS, $DIR_PLUGINS, $DIR_LANG, $DIR_LIBS;\r
680 \r
681                 $DIR_NUCLEUS = $config_adminpath;\r
682                 $DIR_MEDIA   = $config_mediapath;\r
683                 $DIR_SKINS   = $config_skinspath;\r
684                 $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';\r
685                 $DIR_LANG    = $DIR_NUCLEUS . 'language/';\r
686                 $DIR_LIBS    = $DIR_NUCLEUS . 'libs/';\r
687 \r
688                 // close database connection (needs to be closed if we want to include globalfunctions.php)\r
689                 mysql_close();\r
690 \r
691                 $manager = '';\r
692                 include_once($DIR_LIBS . 'globalfunctions.php');\r
693 \r
694                 // 11. install custom skins\r
695                 $aSkinErrors = installCustomSkins($manager);\r
696 \r
697                 // 12. install NP_Ping, if decided\r
698                 if ($weblog_ping == 1) {\r
699                         global $aConfPlugsToInstall;\r
700                         array_push($aConfPlugsToInstall, "NP_Ping");\r
701                 }\r
702 \r
703                 // 13. install custom plugins\r
704                 $aPlugErrors = installCustomPlugs($manager);\r
705         }\r
706 \r
707         // 14. Write config file ourselves (if possible)\r
708         $bConfigWritten = 0;\r
709 \r
710         if (@file_exists('config.php') && is_writable('config.php') && $fp = @fopen('config.php', 'w') ) {\r
711                 $config_data = '<' . '?php' . "\n\n";\r
712                 //$config_data .= "\n"; (extraneous, just added extra \n to previous line\r
713                 $config_data .= "       // mySQL connection information\n";\r
714                 $config_data .= "       \$MYSQL_HOST     = '" . $mysql_host . "';\n";\r
715                 $config_data .= "       \$MYSQL_USER     = '" . $mysql_user . "';\n";\r
716                 $config_data .= "       \$MYSQL_PASSWORD = '" . $mysql_password . "';\n";\r
717                 $config_data .= "       \$MYSQL_DATABASE = '" . $mysql_database . "';\n";\r
718                 $config_data .= "       \$MYSQL_PREFIX   = '" . (($mysql_usePrefix == 1) ? $mysql_prefix : '') . "';\n";\r
719                 $config_data .= "\n";\r
720                 $config_data .= "       // main nucleus directory\n";\r
721                 $config_data .= "       \$DIR_NUCLEUS = '" . $config_adminpath . "';\n";\r
722                 $config_data .= "\n";\r
723                 $config_data .= "       // path to media dir\n";\r
724                 $config_data .= "       \$DIR_MEDIA   = '" . $config_mediapath . "';\n";\r
725                 $config_data .= "\n";\r
726                 $config_data .= "       // extra skin files for imported skins\n";\r
727                 $config_data .= "       \$DIR_SKINS   = '" . $config_skinspath . "';\n";\r
728                 $config_data .= "\n";\r
729                 $config_data .= "       // these dirs are normally sub dirs of the nucleus dir, but \n";\r
730                 $config_data .= "       // you can redefine them if you wish\n";\r
731                 $config_data .= "       \$DIR_PLUGINS = \$DIR_NUCLEUS . 'plugins/';\n";\r
732                 $config_data .= "       \$DIR_LANG    = \$DIR_NUCLEUS . 'language/';\n";\r
733                 $config_data .= "       \$DIR_LIBS    = \$DIR_NUCLEUS . 'libs/';\n";\r
734                 $config_data .= "\n";\r
735                 $config_data .= "       // include libs\n";\r
736                 $config_data .= "       include(\$DIR_LIBS . 'globalfunctions.php');\n";\r
737                 $config_data .= "       if (!extension_loaded('mbstring')) {\n";\r
738                 $config_data .= "               include(\$DIR_LIBS . 'mb_emulator/mb-emulator.php');\n";\r
739                 $config_data .= "       }\n";\r
740                 $config_data .= "?" . ">";\r
741 \r
742                 $result = @fputs($fp, $config_data, strlen($config_data) );\r
743                 fclose($fp);\r
744 \r
745                 if ($result) {\r
746                         $bConfigWritten = 1;\r
747                 }\r
748         }\r
749 \r
750 ?>\r
751 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
752 <html xmlns="http://www.w3.org/1999/xhtml">\r
753 <head>\r
754         <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET; ?>" />\r
755         <title><?php echo _TITLE; ?></title>\r
756         <style>@import url('nucleus/styles/manual.css');</style>\r
757 </head>\r
758 <body>\r
759         <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
760 \r
761 <?php\r
762         $aAllErrors = array_merge($aSkinErrors, $aPlugErrors);\r
763 \r
764         if (count($aAllErrors) > 0) {\r
765                 echo '<h1>' . _TITLE2 . '</h1>';\r
766                 echo '<ul><li>' . implode('</li><li>', $aAllErrors) . '</li></ul>';\r
767         }\r
768 \r
769         if (!$bConfigWritten) { ?>\r
770                 <h1><?php echo _TITLE3; ?></h1>\r
771 \r
772                 <? echo _TEXT10; ?>\r
773 \r
774                 <pre><code>&lt;?php\r
775         // mySQL connection information\r
776         $MYSQL_HOST     = '<b><?php echo $mysql_host?></b>';\r
777         $MYSQL_USER     = '<b><?php echo $mysql_user?></b>';\r
778         $MYSQL_PASSWORD = '<i><b>xxxxxxxxxxx</b></i>';\r
779         $MYSQL_DATABASE = '<b><?php echo $mysql_database?></b>';\r
780         $MYSQL_PREFIX   = '<b><?php echo ($mysql_usePrefix == 1)?$mysql_prefix:''?></b>';\r
781 \r
782         // main nucleus directory\r
783         $DIR_NUCLEUS = '<b><?php echo $config_adminpath?></b>';\r
784 \r
785         // path to media dir\r
786         $DIR_MEDIA   = '<b><?php echo $config_mediapath?></b>';\r
787 \r
788         // extra skin files for imported skins\r
789         $DIR_SKINS   = '<b><?php echo $config_skinspath?></b>';\r
790 \r
791         // these dirs are normally sub dirs of the nucleus dir, but\r
792         // you can redefine them if you wish\r
793         $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';\r
794         $DIR_LANG    = $DIR_NUCLEUS . 'language/';\r
795         $DIR_LIBS    = $DIR_NUCLEUS . 'libs/';\r
796 \r
797         // include libs\r
798         include($DIR_LIBS . 'globalfunctions.php');\r
799         if (!extension_loaded('mbstring')) {\r
800                 include($DIR_LIBS . 'mb_emulator/mb-emulator.php');\r
801         }\r
802 ?&gt;</code></pre>\r
803 \r
804         <?php echo _TEXT11; ?>\r
805 \r
806         <div class="note">\r
807         <?php echo _TEXT12; ?>\r
808         </div>\r
809 \r
810 <?php } else { ?>\r
811 \r
812         <h1><?php echo _TITLE4; ?></h1>\r
813 \r
814         <?php echo _TEXT13; ?>\r
815 \r
816 <?php } ?>\r
817 \r
818         <h1><?php echo _TITLE5; ?></h1>\r
819         \r
820         <?php echo _TEXT14; ?>\r
821 \r
822         <ul>\r
823                 <li><?php echo _TEXT14_L1; ?></li>\r
824                 <li><?php echo _TEXT14_L2; ?></li>\r
825         </ul>\r
826 \r
827         <?php echo _TEXT14_EX; ?>\r
828 \r
829         <h1><?php echo _HEADER10; ?></h1>\r
830 \r
831         <?php echo _TEXT15; ?>\r
832 \r
833                 <ul>\r
834                 <li><?php echo _TEXT15_L1; ?></li>\r
835                 <li><?php echo _TEXT15_L2; ?></li>\r
836                 </ul>\r
837 \r
838         <?php echo _TEXT16; ?>\r
839 \r
840         <h1><?php echo _HEADER11; ?></h1>\r
841 \r
842         <p><?php echo _TEXT16; ?>\r
843                 <ul>\r
844                         <li><a href="<?php echo $config_adminurl?>"><?php echo _TEXT16_L1; ?></a></li>\r
845                         <li><a href="<?php echo $config_indexurl?>"><?php echo _TEXT16_L2; ?></a></li>\r
846                 </ul>\r
847         </p>\r
848 \r
849 </body>\r
850 </html>\r
851 \r
852 <?php\r
853 }\r
854 \r
855 function installCustomPlugs(&$manager) {\r
856         global $aConfPlugsToInstall, $DIR_LIBS;\r
857 \r
858         $aErrors = array();\r
859 \r
860         if (count($aConfPlugsToInstall) == 0) {\r
861                 return $aErrors;\r
862         }\r
863 \r
864         $res = sql_query('SELECT * FROM ' . sql_table('plugin') );\r
865         $numCurrent = mysql_num_rows($res);\r
866 \r
867         foreach ($aConfPlugsToInstall as $plugName) {\r
868                 // do this before calling getPlugin (in case the plugin id is used there)\r
869                 $query = 'INSERT INTO ' . sql_table('plugin') . ' (porder, pfile) VALUES (' . (++$numCurrent) . ', "' . addslashes($plugName) . '")';\r
870                 sql_query($query);\r
871 \r
872                 // get and install the plugin\r
873                 $manager->clearCachedInfo('installedPlugins');\r
874                 $plugin =& $manager->getPlugin($plugName);\r
875                 $plugin->plugid = $numCurrent;\r
876 \r
877                 if (!$plugin) {\r
878                         sql_query('DELETE FROM ' . sql_table('plugin') . ' WHERE pfile=\'' . addslashes($plugName) . '\'');\r
879                         $numCurrent--;\r
880                         array_push($aErrors, _ERROR22 . $plugName);\r
881                         continue;\r
882                 }\r
883 \r
884                 $plugin->install();\r
885         }\r
886 \r
887         // SYNC PLUGIN EVENT LIST\r
888         sql_query('DELETE FROM ' . sql_table('plugin_event') );\r
889 \r
890         // loop over all installed plugins\r
891         $res = sql_query('SELECT pid, pfile FROM ' . sql_table('plugin') );\r
892 \r
893         while($o = mysql_fetch_object($res) ) {\r
894                 $pid  =  $o->pid;\r
895                 $plug =& $manager->getPlugin($o->pfile);\r
896 \r
897                 if ($plug) {\r
898                         $eventList = $plug->getEventList();\r
899 \r
900                         foreach ($eventList as $eventName) {\r
901                                 sql_query('INSERT INTO ' . sql_table('plugin_event') . ' (pid, event) VALUES (' . $pid . ', \'' . $eventName . '\')');\r
902                         }\r
903                 }\r
904         }\r
905 \r
906         return $aErrors;\r
907 }\r
908 \r
909 function installCustomSkins(&$manager) {\r
910         global $aConfSkinsToImport, $DIR_LIBS, $DIR_SKINS;\r
911 \r
912         $aErrors = array();\r
913 \r
914         if (count($aConfSkinsToImport) == 0) {\r
915                 return $aErrors;\r
916         }\r
917 \r
918         // load skinie class\r
919         include_once($DIR_LIBS . 'skinie.php');\r
920 \r
921         $importer = new SKINIMPORT();\r
922 \r
923         foreach ($aConfSkinsToImport as $skinName) {\r
924                 $importer->reset();\r
925                 $skinFile = $DIR_SKINS . $skinName . '/skinbackup.xml';\r
926 \r
927                 if (!@file_exists($skinFile) ) {\r
928                         array_push($aErrors, _ERROR23_1 . $skinFile . ' : ' . _ERROR23_2);\r
929                         continue;\r
930                 }\r
931 \r
932                 $error = $importer->readFile($skinFile);\r
933 \r
934                 if ($error) {\r
935                         array_push($aErrors, _ERROR24 . $skinName . ' : ' . $error);\r
936                         continue;\r
937                 }\r
938 \r
939                 $error = $importer->writeToDatabase(1);\r
940 \r
941                 if ($error) {\r
942                         array_push($aErrors, _ERROR24 . $skinName . ' : ' . $error);\r
943                         continue;\r
944                 }\r
945         }\r
946 \r
947         return $aErrors;\r
948 }\r
949 \r
950 // give an error if one or more nucleus are not accessible\r
951 function doCheckFiles() {\r
952         $missingfiles = array();\r
953         $files = array(\r
954                 'install.sql',\r
955                 'index.php',\r
956                 'action.php',\r
957                 'nucleus/index.php',\r
958                 'nucleus/libs/globalfunctions.php',\r
959                 'nucleus/libs/ADMIN.php',\r
960                 'nucleus/libs/BLOG.php',\r
961                 'nucleus/libs/COMMENT.php',\r
962                 'nucleus/libs/COMMENTS.php',\r
963                 'nucleus/libs/ITEM.php',\r
964                 'nucleus/libs/MEMBER.php',\r
965                 'nucleus/libs/SKIN.php',\r
966                 'nucleus/libs/TEMPLATE.php',\r
967                 'nucleus/libs/MEDIA.php',\r
968                 'nucleus/libs/ACTIONLOG.php',\r
969                 'nucleus/media.php'\r
970         );\r
971 \r
972         $count = count($files);\r
973 \r
974         for ($i = 0; $i < $count; $i++) {\r
975                 if (!is_readable($files[$i]) ) {\r
976                         array_push($missingfiles, _ERROR25_1 . $files[$i] . _ERROR25_2);\r
977                 }\r
978         }\r
979 \r
980 // The above code replaces several if statements of the form:\r
981 \r
982 //      if (!is_readable('install.sql') ) {\r
983 //              array_push($missingfiles, 'File <b>install.sql</b> is missing or not readable');\r
984 //      }\r
985 \r
986         if (count($missingfiles) > 0) {\r
987                 showErrorMessages($missingfiles);\r
988         }\r
989 }\r
990 \r
991 function updateConfig($name, $val) {\r
992         $name = addslashes($name);\r
993         $val  = trim(addslashes($val) );\r
994 \r
995         $query = 'UPDATE ' . tableName('nucleus_config')\r
996                    . " SET   value = '$val'"\r
997                    . " WHERE name  = '$name'";\r
998 \r
999         mysql_query($query) or _doError(_ERROR26 . ': ' . mysql_error() );\r
1000         return mysql_insert_id();\r
1001 }\r
1002 \r
1003 function replaceDoubleBackslash($input) {\r
1004         return str_replace('\\', '/', $input);\r
1005 }\r
1006 \r
1007 function endsWithSlash($s) {\r
1008         return (strrpos($s, '/') == strlen($s) - 1);\r
1009 }\r
1010 \r
1011 /**\r
1012  * Checks if email address is valid\r
1013  */\r
1014 function _isValidMailAddress($address) {\r
1015         if (preg_match("/^[a-zA-Z0-9\._-]+@+[A-Za-z0-9\._-]+\.+[A-Za-z]{2,4}$/", $address) ) {\r
1016                 return 1;\r
1017         } else {\r
1018                 return 0;\r
1019         }\r
1020 }\r
1021 \r
1022 // returns true if the given string is a valid shortname\r
1023 // (to check short blog names and nicknames)\r
1024 // logic: starts and ends with a non space, can contain spaces in between\r
1025 //        min 2 chars\r
1026 function _isValidShortName($name) {\r
1027         if (eregi("^[a-z0-9]+$", $name) ) {\r
1028                 return 1;\r
1029         } else {\r
1030                 return 0;\r
1031         }\r
1032 }\r
1033 \r
1034 \r
1035 \r
1036 // returns true if the given string is a valid display name\r
1037 // (to check nicknames)\r
1038 function _isValidDisplayName($name) {\r
1039         if (eregi("^[a-z0-9]+[a-z0-9 ]*[a-z0-9]+$", $name) ) {\r
1040                 return 1;\r
1041         } else {\r
1042                 return 0;\r
1043         }\r
1044 }\r
1045 \r
1046 function _doError($msg) {\r
1047         ?>\r
1048 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
1049 <html xmlns="http://www.w3.org/1999/xhtml">\r
1050 <head>\r
1051         <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET ?>" />\r
1052         <title><?php echo _TITLE; ?></title>\r
1053         <style>@import url('nucleus/styles/manual.css');</style>\r
1054 </head>\r
1055 <body>\r
1056         <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
1057         <h1><?php echo _ERROR27; ?></h1>\r
1058 \r
1059         <p><?php echo _ERROR28; ?>: "<?php echo $msg?>";</p>\r
1060 \r
1061         <p><a href="install.php" onclick="history.back();"><?php echo _TEXT17; ?></a></p>\r
1062 </body>\r
1063 </html>\r
1064 \r
1065 <?php\r
1066         exit;\r
1067 }\r
1068 \r
1069 function showErrorMessages($errors) {\r
1070         ?>\r
1071 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
1072 <html xmlns="http://www.w3.org/1999/xhtml">\r
1073 <head>\r
1074         <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET ?>" />\r
1075         <title><?php echo _TITLE; ?></title>\r
1076         <style>@import url('nucleus/styles/manual.css');</style>\r
1077 </head>\r
1078 <body>\r
1079         <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
1080         <h1><?php echo _ERROR27; ?></h1>\r
1081 \r
1082         <p><?php echo _ERROR29; ?>:</p>\r
1083 \r
1084         <ul>\r
1085 \r
1086 <?php\r
1087         while($msg = array_shift($errors) ) {\r
1088                 echo '<li>' . $msg . '</li>';\r
1089         }\r
1090 ?>\r
1091 \r
1092         </ul>\r
1093 \r
1094         <p><a href="install.php" onclick="history.back();return false;"><?php echo _TEXT17; ?></a></p>\r
1095 </body>\r
1096 </html>\r
1097 \r
1098 <?php\r
1099         exit;\r
1100 }\r
1101 \r
1102 /* for the non-php systems that decide to show the contents:\r
1103 ?></div><?php   */\r
1104 \r
1105 ?>