X-Git-Url: http://git.sourceforge.jp/view?p=nucleus-jp%2Fnucleus-jp-ancient.git;a=blobdiff_plain;f=euc%2Finstall.php;h=aa2a9fbfcd57534b2ea06350ac6d941d2f8cce30;hp=47d354d3d243c98461edd6ec627f73894f807198;hb=eb2773e9ff1aa431c39726208a3d06db87128f99;hpb=d4d9ab10bb515ac1c787d809a995c121f7f4a3be diff --git a/euc/install.php b/euc/install.php index 47d354d..aa2a9fb 100755 --- a/euc/install.php +++ b/euc/install.php @@ -1,985 +1,977 @@ -
If you see this text in your browser when you open install.php, your web server is not able to run PHP-scripts, and therefor Nucleus will not be able to run there.
0) || (count($aConfSkinsToImport) > 0)) { - global $CONF; - $CONF['installscript']=1; - } - if (phpversion() >= '4.1.0') - include_once('nucleus/libs/vars4.1.0.php'); - else - include_once('nucleus/libs/vars4.0.6.php'); - - // check if mysql support is installed - if (!function_exists('mysql_query')) - _doError('Your PHP version does not have support for MySQL :('); - - if (postVar('action') == 'go') - doInstall(); - else - showInstallForm(); - exit; - - function showInstallForm() { - - // 0. pre check if all necessary files exist - doCheckFiles(); - - ?> - - - - - Nucleus¤Î¥¤¥ó¥¹¥È¡¼¥ë - - - - - -
- -
- -

Install Nucleus

- -

- ¤³¤Î¥¹¥¯¥ê¥×¥È¤ÏNucleus¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ò¼ê½õ¤±¤·¤Þ¤¹¡£MySQL¥Æ¡¼¥Ö¥ë¤Î¥»¥Ã¥È¥¢¥Ã¥×¤È¡¢config.php¤ËÆþÎϤ¹¤ë¤¿¤á¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡Êconfig.php¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò0666¤Ë¤·¤Æ¤ª¤±¤Ð¡¢¸å¼Ô¤Îºî¶È¤Ï¼«Æ°Åª¤Ë¹Ô¤ï¤ì¤Þ¤¹¡Ë¡£¤³¤ì¤ò¤Ê¤¹°Ù¤Ë¡¢¤¤¤¯¤Ä¤«¤Î¾ðÊó¤òÆþÎϤ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ -

- -

- ¤¹¤Ù¤Æ¤ÎÍó¤ÎÆþÎϤ¬É¬ÍפǤ¹¡£¥ª¥×¥·¥ç¥ó¾ðÊó¤Ï¥¤¥ó¥¹¥È¡¼¥ë¤¬´°Î»¤·¤¿¤é¡¢Nucleus¤Î´ÉÍýÎΰ褫¤éÀßÄê²Äǽ¤Ç¤¹¡£ -

- -

PHP & MySQL Versions

- -

- °Ê²¼¤Ï¤¢¤Ê¤¿¤Î¥¦¥§¥Ö¥Û¥¹¥È¤Ë¤ª¤±¤ëPHP¥¤¥ó¥¿¡¼¥×¥ê¥¿¡¼¤ÈMySQL¥µ¡¼¥Ð¡¼¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤¹¡£Nucleus¤Î¥µ¥Ý¡¼¥È¥Õ¥©¡¼¥é¥à¤ËÌäÂê¤òÊó¹ð¤¹¤ë¤È¤­¤Ï¡¢¤³¤Î¾ðÊó¤ò½ñ¤­Åº¤¨¤Æ¤¯¤À¤µ¤¤¡£ -

- - - - -

config.php¤Î¼«Æ°¥¢¥Ã¥×¥Ç¡¼¥È

- -

- ¤â¤·config.php¤ò¼«Æ°Åª¤Ë¹¹¿·¤¹¤ë¤è¤¦¤Ë¤·¤¿¤¤¤Ê¤é¡¢½ñ¤­¹þ¤ß²Äǽ¤Ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£config.php¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò666¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£Nucleus¤Î¥¤¥ó¥¹¥È¡¼¥ëÀ®¸ù¸å¤Ë¡¢¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò444¤ËÌᤵ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡Ê¥Ñ¡¼¥ß¥Ã¥·¥ç¥óÊѹ¹¤Î´Ê°×¥¬¥¤¥É¡Ë¡£ -

- -

- ¤â¤·¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤Ê¤¤¤È¤¤¤¦ÁªÂò¤ò¤·¤¿¡Ê¤¢¤ë¤¤¤Ï¹Ô¤¨¤Ê¤¤¡Ë¾ì¹ç¡§¤´¿´Çۤʤ¯¡£¥¤¥ó¥¹¥È¡¼¥ë¤Î²áÄø¤Çconfig.php¤ÎÃæ¿È¤¬Ä󶡤µ¤ì¤Þ¤¹¡£¤Ç¤¹¤«¤é¡¢¤½¤ì¤ò¤´¼«¿È¤Ç¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£ -

- - - -

MySQL¤Î¥í¥°¥¤¥ó¥Ç¡¼¥¿

- -

- MySQL¤Î¥Ç¡¼¥¿¤ò°Ê²¼¤ËÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£¤½¤ì¤é¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¡¦¥Æ¡¼¥Ö¥ë¤òºîÀ®¤·¾ðÊó¤òÆþÎϤ¹¤ë¤¿¤á¤ËɬÍפʤâ¤Î¤Ç¤¹¡£¸å¤Ç¡¢config.php¤Ë¤âµ­Æþ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡Ê¾åµ­¤Î¼«Æ°¥¢¥Ã¥×¥Ç¡¼¥È¤òÍøÍѤ¹¤ë¾ì¹ç¡¢¤½¤Î¼ê½ç¤Ï¾Êά¤µ¤ì¤Þ¤¹¡Ë¡£ -

- -

- ¤â¤·¤³¤Î¾ðÊ󤬤狼¤é¤Ê¤±¤ì¤Ð¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô¤«¥Û¥¹¥Æ¥£¥ó¥°¸µ¤ËÏ¢Íí¤ò¤È¤Ã¤Æ¤¯¤À¤µ¤¤¡£¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢¥Û¥¹¥È̾¤Ï'localhost'¤Ç¤¹¡£¤â¤·Nucleus¤¬¤¢¤Ê¤¿¤Î¥µ¡¼¥Ð¤ÎPHPÀßÄ꤫¤é'default MySQL host'¤ò¸¡ÃΤ·¤¿¤Ê¤é¡¢'¥Û¥¹¥È̾'¤Ë´û¤Ëµ­Æþ¤µ¤ì¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¡£¤â¤Ã¤È¤â¡¢¤³¤Î¾ðÊó¤¬Àµ³Î¤Ç¤¢¤ë¤È¤¤¤¦ÊݾڤϤ¢¤ê¤Þ¤»¤ó¡£ -

- -
- ´ðËܤΥǡ¼¥¿¥Ù¡¼¥¹ÀßÄê - - - - - - - - - - - - -
¥Û¥¹¥È̾¡§
¥æ¡¼¥¶¡¼Ì¾¡§
¥Ñ¥¹¥ï¡¼¥É¡§
¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¡§ ()
-
- -
- ¹âÅù¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹ÀßÄê - - - -
-

°ì¤Ä¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÊ£¿ô¤ÎNucleus¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤ª¤ê¡¢¼«Ê¬¤¬²¿¤ò¤ä¤Ã¤Æ¤¤¤ë¤Î¤«Íý²ò¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤ò½ü¤¤¤Æ¤Ï¡¢¤³¤ì¤òÊѹ¹¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£

-

Nucleus¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤¿¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Æ¡¼¥Ö¥ë¤Ï¡¢¤³¤Î¥×¥ê¥Õ¥£¥Ã¥¯¥¹¤¬Æ¬¤Ë¤Ä¤­¤Þ¤¹¡£

-
- -

¥Ç¥£¥ì¥¯¥È¥ê¤ÈURL

- -

- ¤³¤Î¥¤¥ó¥¹¥È¡¼¥ë¥¹¥¯¥ê¥×¥È¤ÏNucleus¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÈURL¤ò¸«¤Ä¤±¤è¤¦¤È¤·¤Þ¤·¤¿¡£²¼¤ÎÃͤò¥Á¥§¥Ã¥¯¤·¤ÆɬÍפʤéÄûÀµ¤·¤Æ¤¯¤À¤µ¤¤¡£¥Õ¥¡¥¤¥ë¤Ø¤Î¥Ñ¥¹¤ÈURL¤Ï¥¹¥é¥Ã¥·¥å'/'¤Ç½ª¤ï¤é¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£ -

- -
- URLs and directories - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Site URL: - " /> -
Admin-area URL: -
Admin-area path:" /> -
Media files URL: -
Media directory path:" /> -
Extra skin files URL: -
(¥¤¥ó¥Ý¡¼¥È¤µ¤ì¤¿¥¹¥­¥ó¤¬»ÈÍÑ) -
Extra skin files directory path:" /> -
(¥¤¥ó¥Ý¡¼¥È¤µ¤ì¤¿¥¹¥­¥ó¤Î¥Õ¥¡¥¤¥ëÎà¤òÃÖ¤¯¾ì½ê) -
Plugin files URL: -
Action URL: -
(action.php¤Ø¤Îhttp://¤«¤é»Ï¤Þ¤ëURL) -
-
- -

- ÉÕµ­: ÁêÂХѥ¹¤Ç¤Ï¤Ê¤¯ÀäÂХѥ¹¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£Ä̾ÀäÂХѥ¹¤Ï/home/username/public_html/¤Î¤è¤¦¤Ê·Á¤ò¤È¤ê¤Þ¤¹¡£Unix¥·¥¹¥Æ¥à¡Ê¤Û¤È¤ó¤É¤Î¥µ¡¼¥Ð¡¼¤¬¤½¤¦¤Ç¤¹¡Ë¤Ë¤ª¤¤¤Æ¡¢¥Ñ¥¹¤Ï¥¹¥é¥Ã¥·¥å¤«¤é»Ï¤Þ¤ê¤Þ¤¹¡£¤â¤·¤³¤ì¤é¤Î¾ðÊóÆþÎϤËÌäÂ꤬À¸¤¸¤¿¤é¡¢¤¢¤Ê¤¿¤Î¥µ¡¼¥Ð´ÉÍý¼Ô¤Ë¤¿¤º¤Í¤ë¤Ù¤­¤Ç¤¹¡£ -

- -

´ÉÍý¸¢¸Â¤ò¤â¤Ä¥æ¡¼¥¶¡¼

- -

°Ê²¼¤Ë¡¢¥µ¥¤¥È¤ÎºÇ½é¤Î¥æ¡¼¥¶¡¼¤òºîÀ®¤¹¤ë¤¿¤á¤Î¤¤¤¯¤Ä¤«¤Î¾ðÊó¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£

- -
- ´ÉÍý¸¢¸Â¤ò»ý¤Ä¥æ¡¼¥¶¡¼ - - - - - - - - - - - - - - - -
ɽ¼¨¤µ¤ì¤ë̾Á°¡§ - - (µö²Ä¤µ¤ì¤ëʸ»ú¡§a-z ¤È 0-9¡¢ºÇ½é¤ÈºÇ¸å°Ê³°¤Î¥¹¥Ú¡¼¥¹) -
ËÜ̾¡Ê¥Ï¥ó¥É¥ë̾¡Ë¡§
¥Ñ¥¹¥ï¡¼¥É¡§
¥Ñ¥¹¥ï¡¼¥É¤Î³Îǧ¡§
¥á¡¼¥ë¥¢¥É¥ì¥¹¡§ - - (ÍøÍѲÄǽ¤Ê¥á¡¼¥ë¥¢¥É¥ì¥¹¤òÆþ¤ì¤Æ¤¯¤À¤µ¤¤) -
-
- -

¥¦¥§¥Ö¥í¥°¤Î¥Ç¡¼¥¿

- -

°Ê²¼¤Ë¡¢¥Ç¥Õ¥©¥ë¥È¤Îweblog¤òºîÀ®¤¹¤ë¤¿¤á¤Ë¤¤¤¯¤Ä¤«¤Î¾ðÊó¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£¤³¤Îweblog¤Î̾Á°¤Ï¡¢¥µ¥¤¥È̾¤È¤·¤Æ¤âÍøÍѤµ¤ì¤Þ¤¹¡£

- -
- ¥¦¥§¥Ö¥í¥°¤Î¥Ç¡¼¥¿ - - - - - - -
Blog̾¡§
Blog¤Îû½Ì̾¡§ - - (µö²Ä¤µ¤ì¤ëʸ»ú¡§a-z ¤È 0-9¡¢¥¹¥Ú¡¼¥¹¤ÏÉÔ²Ä) -
-
- -

¥Ç¡¼¥¿¤ÎÁ÷¿®

- -

- ¾å¤Ë½ñ¤¤¤Æ¤­¤¿¥Ç¡¼¥¿¤¬Àµ¤·¤¤¤«³Î¤«¤á¤Æ¤¯¤À¤µ¤¤¡£¤è¤±¤ì¤Ð¥Ç¡¼¥¿¥Ù¡¼¥¹¡¦¥Æ¡¼¥Ö¥ë¤ÈºÇ½é¤Î¥Ç¡¼¥¿¤òÀßÄꤹ¤ë¤¿¤á¤Ë²¼¤Î¥Ü¥¿¥ó¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£¾¯¤·»þ´Ö¤¬¤«¤«¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¤´¿ÉÊú¤ò¡£¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤Î¤Ï°ì²ó¤À¤±¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£ -

- -

- - -

- -
- - - - - - 0) - showErrorMessages($errors); - - // 2. try to log in to mySQL - $connection = @mysql_connect($mysql_host, $mysql_user, $mysql_password); - if ($connection == false) - _doError("Could not connect to mySQL server: " . mysql_error()); - - // 3. try to create database (if needed) - if ($mysql_create == 1) { - 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()); - } - - // 4. try to select database - mysql_select_db($mysql_database) or _doError("Could not select database. Make sure it exists"); - - // 5. execute queries - $filename = "install.sql"; - $fd = fopen ($filename, "r"); - $queries = fread ($fd, filesize ($filename)); - fclose ($fd); - - $queries = split("(;\n|;\r)",$queries); - - $aTableNames = array( - 'nucleus_actionlog', - 'nucleus_ban', - 'nucleus_blog', - 'nucleus_category', - 'nucleus_comment', - 'nucleus_config', - 'nucleus_item', - 'nucleus_karma', - 'nucleus_member', - 'nucleus_plugin', - 'nucleus_skin', - 'nucleus_template', - 'nucleus_team', - 'nucleus_activation', - 'nucleus_tickets' -// these are unneeded (one of the replacements above takes care of them) -// 'nucleus_plugin_event', -// 'nucleus_plugin_option', -// 'nucleus_plugin_option_desc', -// 'nucleus_skin_desc', -// 'nucleus_template_desc', - ); - $aTableNamesPrefixed = array( - $mysql_prefix . 'nucleus_actionlog', - $mysql_prefix . 'nucleus_ban', - $mysql_prefix . 'nucleus_blog', - $mysql_prefix . 'nucleus_category', - $mysql_prefix . 'nucleus_comment', - $mysql_prefix . 'nucleus_config', - $mysql_prefix . 'nucleus_item', - $mysql_prefix . 'nucleus_karma', - $mysql_prefix . 'nucleus_member', - $mysql_prefix . 'nucleus_plugin', - $mysql_prefix . 'nucleus_skin', - $mysql_prefix . 'nucleus_template', - $mysql_prefix . 'nucleus_team', - $mysql_prefix . 'nucleus_activation', - $mysql_prefix . 'nucleus_tickets' -// these are unneeded (one of the replacements above takes care of them) -// $mysql_prefix . 'nucleus_plugin_event', -// $mysql_prefix . 'nucleus_plugin_option', -// $mysql_prefix . 'nucleus_plugin_option_desc', -// $mysql_prefix . 'nucleus_skin_desc', -// $mysql_prefix . 'nucleus_template_desc', - ); - - for ($idx = 0;$idx" . htmlspecialchars($query) . "

"; - if ($query) { - if ($mysql_usePrefix == 1) - $query = str_replace($aTableNames, $aTableNamesPrefixed, $query); - mysql_query($query) or _doError("Error while executing query (" . htmlspecialchars($query) . "): " . mysql_error()); - } - - } - - // 6. update global settings - updateConfig('IndexURL', $config_indexurl); - updateConfig('AdminURL', $config_adminurl); - updateConfig('MediaURL', $config_mediaurl); - updateConfig('SkinsURL', $config_skinsurl); - updateConfig('PluginURL', $config_pluginurl); - updateConfig('ActionURL', $config_actionurl); - updateConfig('AdminEmail', $config_adminemail); - updateConfig('SiteName', $config_sitename); - - - // 7. update GOD member - $query = 'UPDATE ' . tableName('nucleus_member') - . " SET mname='" . addslashes($user_name) . "'," - . " mrealname='". addslashes($user_realname) . "'," - . " mpassword='". md5(addslashes($user_password)) . "'," - . " murl='" . addslashes($config_indexurl) . "'," - . " memail='" . addslashes($user_email) . "'," - . " madmin=1," - . " mcanlogin=1" - . " WHERE mnumber=1"; - mysql_query($query) or _doError("Error while setting member settings: " . mysql_error()); - - // 8. update weblog settings - $query = 'UPDATE ' . tableName('nucleus_blog') - . " SET bname='" . addslashes($blog_name) . "'," - . " bshortname='". addslashes($blog_shortname) . "'," - . " burl='" . addslashes($config_indexurl) . "'" - . " WHERE bnumber=1"; - mysql_query($query) or _doError("Error while setting weblog settings: " . mysql_error()); - - // 9. update item date - $query = 'UPDATE ' . tableName('nucleus_item') - . " SET itime='". date("Y-m-d H:i:s",time()) ."'" - . " WHERE inumber=1"; - mysql_query($query) or _doError("Error with query: " . mysql_error()); - - global $aConfPlugsToInstall, $aConfSkinsToImport; - $aSkinErrors = array(); - $aPlugErrors = array(); - if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0)) { - // 10. set global variables - global $MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD, $MYSQL_DATABASE, $MYSQL_PREFIX; - $MYSQL_HOST = $mysql_host; - $MYSQL_USER = $mysql_user; - $MYSQL_PASSWORD = $mysql_password; - $MYSQL_DATABASE = $mysql_database; - $MYSQL_PREFIX = ($mysql_usePrefix == 1)?$mysql_prefix:''; - global $DIR_NUCLEUS, $DIR_MEDIA, $DIR_SKINS, $DIR_PLUGINS, $DIR_LANG, $DIR_LIBS; - $DIR_NUCLEUS = $config_adminpath; - $DIR_MEDIA = $config_mediapath; - $DIR_SKINS = $config_skinspath; - $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/'; - $DIR_LANG = $DIR_NUCLEUS . 'language/'; - $DIR_LIBS = $DIR_NUCLEUS . 'libs/'; - - // close database connection (needs to be closed if we want to include globalfunctions.php) - mysql_close(); - - $manager = ''; - include_once($DIR_LIBS . 'globalfunctions.php'); - - // 11. install custom skins - $aSkinErrors = installCustomSkins($manager); - - // 12. install custom plugins - $aPlugErrors = installCustomPlugs($manager); - - } - - - // 12. Write config file ourselves (if possible) - $bConfigWritten = 0; - if (@file_exists('config.php') && is_writable('config.php') && $fp = @fopen('config.php', 'w')) { - $config_data = "<" . "?php \n"; - $config_data .= "\n"; - $config_data .= " // mySQL connection information\n"; - $config_data .= " \$MYSQL_HOST = '" . $mysql_host . "';\n"; - $config_data .= " \$MYSQL_USER = '" . $mysql_user . "';\n"; - $config_data .= " \$MYSQL_PASSWORD = '" . $mysql_password . "';\n"; - $config_data .= " \$MYSQL_DATABASE = '" . $mysql_database . "';\n"; - $config_data .= " \$MYSQL_PREFIX = '" . (($mysql_usePrefix == 1)?$mysql_prefix:'') . "';\n"; - $config_data .= "\n"; - $config_data .= " // main nucleus directory\n"; - $config_data .= " \$DIR_NUCLEUS = '" . $config_adminpath . "';\n"; - $config_data .= "\n"; - $config_data .= " // path to media dir\n"; - $config_data .= " \$DIR_MEDIA = '" . $config_mediapath . "';\n"; - $config_data .= "\n"; - $config_data .= " // extra skin files for imported skins\n"; - $config_data .= " \$DIR_SKINS = '" . $config_skinspath . "';\n"; - $config_data .= "\n"; - $config_data .= " // these dirs are normally sub dirs of the nucleus dir, but \n"; - $config_data .= " // you can redefine them if you wish\n"; - $config_data .= " \$DIR_PLUGINS = \$DIR_NUCLEUS . 'plugins/';\n"; - $config_data .= " \$DIR_LANG = \$DIR_NUCLEUS . 'language/';\n"; - $config_data .= " \$DIR_LIBS = \$DIR_NUCLEUS . 'libs/';\n"; - $config_data .= "\n"; - $config_data .= " // include libs\n"; - $config_data .= " include(\$DIR_LIBS.'globalfunctions.php');\n"; - $config_data .= " if (!extension_loaded('mbstring')) {\n"; - $config_data .= " include(\$DIR_LIBS.'mb_emulator/mb-emulator.php');\n"; - $config_data .= " }\n"; - $config_data .= "?" . ">"; - - $result = @fputs($fp, $config_data, strlen($config_data)); - fclose($fp); - - if ($result) - $bConfigWritten = 1; - } - - ?> - - - - - Nucleus¤Î¥¤¥ó¥¹¥È¡¼¥ë - - - -

- 0) { - echo '

Skin/Plugin Install errors

'; - echo ''; - } - - if (!$bConfigWritten) { ?> -

¥¤¥ó¥¹¥È¡¼¥ë¤Ï¤Û¤Ü´°Î»¤·¤Þ¤·¤¿¡ª

-

- ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Æ¡¼¥Ö¥ë¤Î½é´üÃÍÆþÎϤ¬À®¸ù¤·¤Þ¤·¤¿¡£¸å¤Ïconfig.php¤ò½ñ¤­´¹¤¨¤ë¤À¤±¤Ç¤¹¡£°Ê²¼¤Ë½ñ¤­´¹¤¨¤ë¤Ù¤­ÆâÍƤòɽ¼¨¤·¤Þ¤¹¡Êmysql¤Î¥Ñ¥¹¥ï¡¼¥É¤Ï¥Þ¥¹¥¯¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤³¤Ï¼ÂºÝ¤Î¤â¤Î¤Ë½ñ¤­´¹¤¨¤Æ¤¯¤À¤µ¤¤¡Ë -

- -
-<?php
-	// mySQL connection information
-	$MYSQL_HOST = '';
-	$MYSQL_USER = '';
-	$MYSQL_PASSWORD = 'xxxxxxxxxxx';
-	$MYSQL_DATABASE = '';
-	$MYSQL_PREFIX = '';
-
-	// main nucleus directory
-	$DIR_NUCLEUS = '';
-
-	// path to media dir
-	$DIR_MEDIA = '';
-
-	// extra skin files for imported skins
-	$DIR_SKINS = '';
-
-	// these dirs are normally sub dirs of the nucleus dir, but
-	// you can redefine them if you wish
-	$DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';
-	$DIR_LANG = $DIR_NUCLEUS . 'language/';
-	$DIR_LIBS = $DIR_NUCLEUS . 'libs/';
-
-	// include libs
-	include($DIR_LIBS.'globalfunctions.php');
-	if (!extension_loaded('mbstring')) {
-	include($DIR_LIBS.'mb_emulator/mb-emulator.php');
-	}
-
-?>
-			
- -

¤¢¤Ê¤¿¤Î¥³¥ó¥Ô¥å¡¼¥¿¾å¤Î¥Õ¥¡¥¤¥ë¤ò½ñ¤­´¹¤¨¤¿¤é¡¢FTP¤ò»È¤Ã¤Æ¥¦¥§¥Ö¥µ¡¼¥Ð¤Ë¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£ASCII¥â¡¼¥É¤ÇÁ÷¿®¤·¤Æ¥Õ¥¡¥¤¥ë¤ò¾å½ñ¤­¤·¤Þ¤¹¡£ -

- -
- ÉÕµ­: config.php¤ÎºÇ½é¤ä½ª¤ï¤ê¤Ë¥¹¥Ú¡¼¥¹¤ò¶õ¤±¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤·¤ç¤¦¡£¼Â¹Ô»þ¤Ë¥¨¥é¡¼¤ò°ú¤­µ¯¤³¤¹¸¶°ø¤È¤Ê¤ê¤Þ¤¹¡£ -
- ¤·¤¿¤¬¤Ã¤Æ¡¢config.php¤ÎºÇ½é¤Îʸ»ú¤Ï "<"¤ÇºÇ¸å¤Îʸ»ú¤Ï">"¤È¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ -
- - -

¥¤¥ó¥¹¥È¡¼¥ë¤Ï´°Î»¤·¤Þ¤·¤¿¡ª

- -

Nucleus¤Ï¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¡¢config.php¤Ï¥¢¥Ã¥×¥Ç¡¼¥È¤µ¤ì¤Þ¤·¤¿¡£

- -

¥»¥­¥å¥ê¥Æ¥£¤Î¤¿¤áconfig.php¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò444¤ËÌ᤹¤³¤È¤ò˺¤ì¤Ê¤¤¤Ç¤¯¤À¤µ¤¤(¥Ñ¡¼¥ß¥Ã¥·¥ç¥óÊѹ¹¤Î´Ê°×¥¬¥¤¥É)¡£

- -

¥¤¥ó¥¹¥È¡¼¥ë¥Õ¥¡¥¤¥ë¤Îºï½ü

- -

¥¦¥§¥Ö¥µ¡¼¥Ð¤«¤é¼¡¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤¡§

- - - -

¤â¤·¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢´ÉÍýÎΰè¤ò³«¤¯¤³¤È¤¬½ÐÍè¤Þ¤»¤ó¡£

- -

¥¦¥§¥Ö¥µ¥¤¥È¤Î³Îǧ

-

- ¥¦¥§¥Ö¥µ¥¤¥È¤ò»È¤¦½àÈ÷¤¬À°¤¤¤Þ¤·¤¿¡£ -

-

- - - - getPlugin($plugName); - if (!$plugin) { - sql_query('DELETE FROM ' . sql_table('plugin') . ' WHERE pfile=\''. addslashes($plugName).'\''); - $numCurrent--; - array_push($aErrors, 'Unable to install plugin ' . $plugName); - continue; - } - $plugin->install(); - } - - // SYNC PLUGIN EVENT LIST - sql_query('DELETE FROM '.sql_table('plugin_event')); - // loop over all installed plugins - $res = sql_query('SELECT pid, pfile FROM '.sql_table('plugin')); - while($o = mysql_fetch_object($res)) { - $pid = $o->pid; - $plug =& $manager->getPlugin($o->pfile); - if ($plug) - { - $eventList = $plug->getEventList(); - foreach ($eventList as $eventName) - sql_query('INSERT INTO '.sql_table('plugin_event').' (pid, event) VALUES ('.$pid.', \''.$eventName.'\')'); - } - } - - return $aErrors; - } - - function installCustomSkins(&$manager) { - global $aConfSkinsToImport, $DIR_LIBS, $DIR_SKINS; - - $aErrors = array(); - - if (count($aConfSkinsToImport) == 0) - return $aErrors; - - // load skinie class - include_once($DIR_LIBS . 'skinie.php'); - - $importer = new SKINIMPORT(); - - foreach ($aConfSkinsToImport as $skinName) { - $importer->reset(); - - $skinFile = $DIR_SKINS . $skinName . '/skinbackup.xml'; - if (!@file_exists($skinFile)) { - array_push($aErrors, 'Unable to import ' . $skinFile . ' : file does not exist'); - continue; - } - $error = $importer->readFile($skinFile); - if ($error) { - array_push($aErrors, 'Unable to import ' . $skinName . ' : ' . $error); - continue; - } - $error = $importer->writeToDatabase(1); - if ($error) { - array_push($aErrors, 'Unable to import ' . $skinName . ' : ' . $error); - continue; - } - } - - return $aErrors; - } - - // give an error if one or more nucleus are not accessible - function doCheckFiles() { - $missingfiles = array(); - - if (!is_readable('install.sql')) - array_push($missingfiles, "File install.sql is missing or not readable"); - if (!is_readable('index.php')) - array_push($missingfiles, "File index.php is missing or not readable"); - if (!is_readable('action.php')) - array_push($missingfiles, "File action.php is missing or not readable"); - if (!is_readable('nucleus/index.php')) - array_push($missingfiles, "File nucleus/index.php is missing or not readable"); - if (!is_readable('nucleus/libs/globalfunctions.php')) - array_push($missingfiles, "File nucleus/libs/globalfunctions.php is missing or not readable"); - if (!is_readable('nucleus/libs/ADMIN.php')) - array_push($missingfiles, "File nucleus/libs/ADMIN.php is missing or not readable"); - if (!is_readable('nucleus/libs/BLOG.php')) - array_push($missingfiles, "File nucleus/libs/BLOG.php is missing or not readable"); - if (!is_readable('nucleus/libs/COMMENT.php')) - array_push($missingfiles, "File nucleus/libs/COMMENT.php is missing or not readable"); - if (!is_readable('nucleus/libs/COMMENTS.php')) - array_push($missingfiles, "File nucleus/libs/COMMENTS.php is missing or not readable"); - if (!is_readable('nucleus/libs/ITEM.php')) - array_push($missingfiles, "File nucleus/libs/ITEM.php is missing or not readable"); - if (!is_readable('nucleus/libs/MEMBER.php')) - array_push($missingfiles, "File nucleus/libs/MEMBER.php is missing or not readable"); - if (!is_readable('nucleus/libs/SKIN.php')) - array_push($missingfiles, "File nucleus/libs/SKIN.php is missing or not readable"); - if (!is_readable('nucleus/libs/TEMPLATE.php')) - array_push($missingfiles, "File nucleus/libs/TEMPLATE.php is missing or not readable"); - if (!is_readable('nucleus/libs/MEDIA.php')) - array_push($missingfiles, "File nucleus/libs/MEDIA.php is missing or not readable"); - if (!is_readable('nucleus/libs/ACTIONLOG.php')) - array_push($missingfiles, "File nucleus/libs/ACTIONLOG.php is missing or not readable"); - if (!is_readable('nucleus/media.php')) - array_push($missingfiles, "File nucleus/media.php is missing or not readable"); - - - if (sizeof($missingfiles) > 0) - showErrorMessages($missingfiles); - - - } - - function updateConfig($name, $val) { - $name = addslashes($name); - $val = trim(addslashes($val)); - - $query = 'UPDATE ' . tableName('nucleus_config') - . " SET value='$val'" - . " WHERE name='$name'"; - - mysql_query($query) or _doError("Query error while trying to update config: " . mysql_error()); - return mysql_insert_id(); - } - - function endsWithSlash($s) { - return (strrpos($s,'/') == strlen($s) - 1); - } - - /** - * Checks if email address is valid - */ - function _isValidMailAddress($address) { - if (preg_match("/^[a-zA-Z0-9\._-]+@+[A-Za-z0-9\._-]+\.+[A-Za-z]{2,4}$/", $address)) - return 1; - else - return 0; - } - - // returns true if the given string is a valid shortname - // (to check short blog names and nicknames) - // logic: starts and ends with a non space, can contain spaces in between - // min 2 chars - function _isValidShortName($name) { - if (eregi("^[a-z0-9]+$", $name)) - return 1; - else - return 0; - } - - - - // returns true if the given string is a valid display name - // (to check nicknames) - function _isValidDisplayName($name) { - if (eregi("^[a-z0-9]+[a-z0-9 ]*[a-z0-9]+$", $name)) - return 1; - else - return 0; - } - - function _doError($msg) { - ?> - - - - - Nucleus Install - - - -
-

Error!

-

- Error message was: ""; -

- -

- Go Back -

- - - - - - - - Nucleus Install - - - -
-

Errors!

-

- Errors were found: -

- - - -

- Go Back -

- - -
If you see this text in your browser when you open install.php, your web server is not able to run PHP-scripts, and therefor Nucleus will not be able to run there.
0) || (count($aConfSkinsToImport) > 0)) { + global $CONF; + $CONF['installscript']=1; + } + if (phpversion() >= '4.1.0') + include_once('nucleus/libs/vars4.1.0.php'); + else + include_once('nucleus/libs/vars4.0.6.php'); + + // check if mysql support is installed + if (!function_exists('mysql_query')) + _doError('Your PHP version does not have support for MySQL :('); + + if (postVar('action') == 'go') + doInstall(); + else + showInstallForm(); + exit; + + function showInstallForm() { + + // 0. pre check if all necessary files exist + doCheckFiles(); + + ?> + + + + + Nucleus¤Î¥¤¥ó¥¹¥È¡¼¥ë + + + + + +
+ +
+ +

Install Nucleus

+ +

+ ¤³¤Î¥¹¥¯¥ê¥×¥È¤ÏNucleus¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ò¼ê½õ¤±¤·¤Þ¤¹¡£MySQL¥Æ¡¼¥Ö¥ë¤Î¥»¥Ã¥È¥¢¥Ã¥×¤È¡¢config.php¤ËÆþÎϤ¹¤ë¤¿¤á¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡Êconfig.php¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò0666¤Ë¤·¤Æ¤ª¤±¤Ð¡¢¸å¼Ô¤Îºî¶È¤Ï¼«Æ°Åª¤Ë¹Ô¤ï¤ì¤Þ¤¹¡Ë¡£¤³¤ì¤ò¤Ê¤¹°Ù¤Ë¡¢¤¤¤¯¤Ä¤«¤Î¾ðÊó¤òÆþÎϤ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ +

+ +

+ ¤¹¤Ù¤Æ¤ÎÍó¤ÎÆþÎϤ¬É¬ÍפǤ¹¡£¥ª¥×¥·¥ç¥ó¾ðÊó¤Ï¥¤¥ó¥¹¥È¡¼¥ë¤¬´°Î»¤·¤¿¤é¡¢Nucleus¤Î´ÉÍýÎΰ褫¤éÀßÄê²Äǽ¤Ç¤¹¡£ +

+ +

PHP & MySQL Versions

+ +

+ °Ê²¼¤Ï¤¢¤Ê¤¿¤Î¥¦¥§¥Ö¥Û¥¹¥È¤Ë¤ª¤±¤ëPHP¥¤¥ó¥¿¡¼¥×¥ê¥¿¡¼¤ÈMySQL¥µ¡¼¥Ð¡¼¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤¹¡£Nucleus¤Î¥µ¥Ý¡¼¥È¥Õ¥©¡¼¥é¥à¤ËÌäÂê¤òÊó¹ð¤¹¤ë¤È¤­¤Ï¡¢¤³¤Î¾ðÊó¤ò½ñ¤­Åº¤¨¤Æ¤¯¤À¤µ¤¤¡£ +

+ + + + +

config.php¤Î¼«Æ°¥¢¥Ã¥×¥Ç¡¼¥È

+ +

+ ¤â¤·config.php¤ò¼«Æ°Åª¤Ë¹¹¿·¤¹¤ë¤è¤¦¤Ë¤·¤¿¤¤¤Ê¤é¡¢½ñ¤­¹þ¤ß²Äǽ¤Ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£config.php¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò666¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£Nucleus¤Î¥¤¥ó¥¹¥È¡¼¥ëÀ®¸ù¸å¤Ë¡¢¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò444¤ËÌᤵ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡Ê¥Ñ¡¼¥ß¥Ã¥·¥ç¥óÊѹ¹¤Î´Ê°×¥¬¥¤¥É¡Ë¡£ +

+ +

+ ¤â¤·¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤Ê¤¤¤È¤¤¤¦ÁªÂò¤ò¤·¤¿¡Ê¤¢¤ë¤¤¤Ï¹Ô¤¨¤Ê¤¤¡Ë¾ì¹ç¡§¤´¿´Çۤʤ¯¡£¥¤¥ó¥¹¥È¡¼¥ë¤Î²áÄø¤Çconfig.php¤ÎÃæ¿È¤¬Ä󶡤µ¤ì¤Þ¤¹¡£¤Ç¤¹¤«¤é¡¢¤½¤ì¤ò¤´¼«¿È¤Ç¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£ +

+ + + +

MySQL¤Î¥í¥°¥¤¥ó¥Ç¡¼¥¿

+ +

+ MySQL¤Î¥Ç¡¼¥¿¤ò°Ê²¼¤ËÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£¤½¤ì¤é¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¡¦¥Æ¡¼¥Ö¥ë¤òºîÀ®¤·¾ðÊó¤òÆþÎϤ¹¤ë¤¿¤á¤ËɬÍפʤâ¤Î¤Ç¤¹¡£¸å¤Ç¡¢config.php¤Ë¤âµ­Æþ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡Ê¾åµ­¤Î¼«Æ°¥¢¥Ã¥×¥Ç¡¼¥È¤òÍøÍѤ¹¤ë¾ì¹ç¡¢¤½¤Î¼ê½ç¤Ï¾Êά¤µ¤ì¤Þ¤¹¡Ë¡£ +

+ +

+ ¤â¤·¤³¤Î¾ðÊ󤬤狼¤é¤Ê¤±¤ì¤Ð¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô¤«¥Û¥¹¥Æ¥£¥ó¥°¸µ¤ËÏ¢Íí¤ò¤È¤Ã¤Æ¤¯¤À¤µ¤¤¡£¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢¥Û¥¹¥È̾¤Ï'localhost'¤Ç¤¹¡£¤â¤·Nucleus¤¬¤¢¤Ê¤¿¤Î¥µ¡¼¥Ð¤ÎPHPÀßÄ꤫¤é'default MySQL host'¤ò¸¡ÃΤ·¤¿¤Ê¤é¡¢'¥Û¥¹¥È̾'¤Ë´û¤Ëµ­Æþ¤µ¤ì¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¡£¤â¤Ã¤È¤â¡¢¤³¤Î¾ðÊó¤¬Àµ³Î¤Ç¤¢¤ë¤È¤¤¤¦ÊݾڤϤ¢¤ê¤Þ¤»¤ó¡£ +

+ +
+ ´ðËܤΥǡ¼¥¿¥Ù¡¼¥¹ÀßÄê + + + + + + + + + + + + +
¥Û¥¹¥È̾¡§
¥æ¡¼¥¶¡¼Ì¾¡§
¥Ñ¥¹¥ï¡¼¥É¡§
¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¡§ ()
+
+ +
+ ¹âÅù¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹ÀßÄê + + + +
+

°ì¤Ä¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÊ£¿ô¤ÎNucleus¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤ª¤ê¡¢¼«Ê¬¤¬²¿¤ò¤ä¤Ã¤Æ¤¤¤ë¤Î¤«Íý²ò¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤ò½ü¤¤¤Æ¤Ï¡¢¤³¤ì¤òÊѹ¹¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£

+

Nucleus¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤¿¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Æ¡¼¥Ö¥ë¤Ï¡¢¤³¤Î¥×¥ê¥Õ¥£¥Ã¥¯¥¹¤¬Æ¬¤Ë¤Ä¤­¤Þ¤¹¡£

+
+ +

¥Ç¥£¥ì¥¯¥È¥ê¤ÈURL

+ +

+ ¤³¤Î¥¤¥ó¥¹¥È¡¼¥ë¥¹¥¯¥ê¥×¥È¤ÏNucleus¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÈURL¤ò¸«¤Ä¤±¤è¤¦¤È¤·¤Þ¤·¤¿¡£²¼¤ÎÃͤò¥Á¥§¥Ã¥¯¤·¤ÆɬÍפʤéÄûÀµ¤·¤Æ¤¯¤À¤µ¤¤¡£¥Õ¥¡¥¤¥ë¤Ø¤Î¥Ñ¥¹¤ÈURL¤Ï¥¹¥é¥Ã¥·¥å'/'¤Ç½ª¤ï¤é¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£ +

+ +
+ URLs and directories + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Site URL: + " /> +
Admin-area URL: +
Admin-area path:" /> +
Media files URL: +
Media directory path:" /> +
Extra skin files URL: +
(¥¤¥ó¥Ý¡¼¥È¤µ¤ì¤¿¥¹¥­¥ó¤¬»ÈÍÑ) +
Extra skin files directory path:" /> +
(¥¤¥ó¥Ý¡¼¥È¤µ¤ì¤¿¥¹¥­¥ó¤Î¥Õ¥¡¥¤¥ëÎà¤òÃÖ¤¯¾ì½ê) +
Plugin files URL: +
Action URL: +
(action.php¤Ø¤Îhttp://¤«¤é»Ï¤Þ¤ëURL) +
+
+ +

+ ÉÕµ­: ÁêÂХѥ¹¤Ç¤Ï¤Ê¤¯ÀäÂХѥ¹¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£Ä̾ÀäÂХѥ¹¤Ï/home/username/public_html/¤Î¤è¤¦¤Ê·Á¤ò¤È¤ê¤Þ¤¹¡£Unix¥·¥¹¥Æ¥à¡Ê¤Û¤È¤ó¤É¤Î¥µ¡¼¥Ð¡¼¤¬¤½¤¦¤Ç¤¹¡Ë¤Ë¤ª¤¤¤Æ¡¢¥Ñ¥¹¤Ï¥¹¥é¥Ã¥·¥å¤«¤é»Ï¤Þ¤ê¤Þ¤¹¡£¤â¤·¤³¤ì¤é¤Î¾ðÊóÆþÎϤËÌäÂ꤬À¸¤¸¤¿¤é¡¢¤¢¤Ê¤¿¤Î¥µ¡¼¥Ð´ÉÍý¼Ô¤Ë¤¿¤º¤Í¤ë¤Ù¤­¤Ç¤¹¡£ +

+ +

´ÉÍý¸¢¸Â¤ò¤â¤Ä¥æ¡¼¥¶¡¼

+ +

°Ê²¼¤Ë¡¢¥µ¥¤¥È¤ÎºÇ½é¤Î¥æ¡¼¥¶¡¼¤òºîÀ®¤¹¤ë¤¿¤á¤Î¤¤¤¯¤Ä¤«¤Î¾ðÊó¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£

+ +
+ ´ÉÍý¸¢¸Â¤ò»ý¤Ä¥æ¡¼¥¶¡¼ + + + + + + + + + + + + + + + +
ɽ¼¨¤µ¤ì¤ë̾Á°¡§ + + (µö²Ä¤µ¤ì¤ëʸ»ú¡§a-z ¤È 0-9¡¢ºÇ½é¤ÈºÇ¸å°Ê³°¤Î¥¹¥Ú¡¼¥¹) +
ËÜ̾¡Ê¥Ï¥ó¥É¥ë̾¡Ë¡§
¥Ñ¥¹¥ï¡¼¥É¡§
¥Ñ¥¹¥ï¡¼¥É¤Î³Îǧ¡§
¥á¡¼¥ë¥¢¥É¥ì¥¹¡§ + + (ÍøÍѲÄǽ¤Ê¥á¡¼¥ë¥¢¥É¥ì¥¹¤òÆþ¤ì¤Æ¤¯¤À¤µ¤¤) +
+
+ +

¥¦¥§¥Ö¥í¥°¤Î¥Ç¡¼¥¿

+ +

°Ê²¼¤Ë¡¢¥Ç¥Õ¥©¥ë¥È¤Îweblog¤òºîÀ®¤¹¤ë¤¿¤á¤Ë¤¤¤¯¤Ä¤«¤Î¾ðÊó¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£¤³¤Îweblog¤Î̾Á°¤Ï¡¢¥µ¥¤¥È̾¤È¤·¤Æ¤âÍøÍѤµ¤ì¤Þ¤¹¡£

+ +
+ ¥¦¥§¥Ö¥í¥°¤Î¥Ç¡¼¥¿ + + + + + + +
Blog̾¡§
Blog¤Îû½Ì̾¡§ + + (µö²Ä¤µ¤ì¤ëʸ»ú¡§a-z ¤È 0-9¡¢¥¹¥Ú¡¼¥¹¤ÏÉÔ²Ä) +
+
+ +

¥Ç¡¼¥¿¤ÎÁ÷¿®

+ +

+ ¾å¤Ë½ñ¤¤¤Æ¤­¤¿¥Ç¡¼¥¿¤¬Àµ¤·¤¤¤«³Î¤«¤á¤Æ¤¯¤À¤µ¤¤¡£¤è¤±¤ì¤Ð¥Ç¡¼¥¿¥Ù¡¼¥¹¡¦¥Æ¡¼¥Ö¥ë¤ÈºÇ½é¤Î¥Ç¡¼¥¿¤òÀßÄꤹ¤ë¤¿¤á¤Ë²¼¤Î¥Ü¥¿¥ó¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£¾¯¤·»þ´Ö¤¬¤«¤«¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¤´¿ÉÊú¤ò¡£¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤Î¤Ï°ì²ó¤À¤±¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£ +

+ +

+ + +

+ +
+ + + + + + 0) + showErrorMessages($errors); + + // 2. try to log in to mySQL + $connection = @mysql_connect($mysql_host, $mysql_user, $mysql_password); + if ($connection == false) + _doError("Could not connect to mySQL server: " . mysql_error()); + + // 3. try to create database (if needed) + if ($mysql_create == 1) { + 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()); + } + + // 4. try to select database + mysql_select_db($mysql_database) or _doError("Could not select database. Make sure it exists"); + + // 5. execute queries + $filename = "install.sql"; + $fd = fopen ($filename, "r"); + $queries = fread ($fd, filesize ($filename)); + fclose ($fd); + + $queries = split("(;\n|;\r)",$queries); + + $aTableNames = array( + 'nucleus_actionlog', + 'nucleus_ban', + 'nucleus_blog', + 'nucleus_category', + 'nucleus_comment', + 'nucleus_config', + 'nucleus_item', + 'nucleus_karma', + 'nucleus_member', + 'nucleus_plugin', + 'nucleus_skin', + 'nucleus_template', + 'nucleus_team' +// these are unneeded (one of the replacements above takes care of them) +// 'nucleus_plugin_event', +// 'nucleus_plugin_option', +// 'nucleus_plugin_option_desc', +// 'nucleus_skin_desc', +// 'nucleus_template_desc', + ); + $aTableNamesPrefixed = array( + $mysql_prefix . 'nucleus_actionlog', + $mysql_prefix . 'nucleus_ban', + $mysql_prefix . 'nucleus_blog', + $mysql_prefix . 'nucleus_category', + $mysql_prefix . 'nucleus_comment', + $mysql_prefix . 'nucleus_config', + $mysql_prefix . 'nucleus_item', + $mysql_prefix . 'nucleus_karma', + $mysql_prefix . 'nucleus_member', + $mysql_prefix . 'nucleus_plugin', + $mysql_prefix . 'nucleus_skin', + $mysql_prefix . 'nucleus_template', + $mysql_prefix . 'nucleus_team' +// these are unneeded (one of the replacements above takes care of them) +// $mysql_prefix . 'nucleus_plugin_event', +// $mysql_prefix . 'nucleus_plugin_option', +// $mysql_prefix . 'nucleus_plugin_option_desc', +// $mysql_prefix . 'nucleus_skin_desc', +// $mysql_prefix . 'nucleus_template_desc', + ); + + for ($idx = 0;$idx" . htmlspecialchars($query) . "

"; + if ($query) { + if ($mysql_usePrefix == 1) + $query = str_replace($aTableNames, $aTableNamesPrefixed, $query); + mysql_query($query) or _doError("Error while executing query (" . htmlspecialchars($query) . "): " . mysql_error()); + } + + } + + // 6. update global settings + updateConfig('IndexURL', $config_indexurl); + updateConfig('AdminURL', $config_adminurl); + updateConfig('MediaURL', $config_mediaurl); + updateConfig('SkinsURL', $config_skinsurl); + updateConfig('PluginURL', $config_pluginurl); + updateConfig('ActionURL', $config_actionurl); + updateConfig('AdminEmail', $config_adminemail); + updateConfig('SiteName', $config_sitename); + + + // 7. update GOD member + $query = 'UPDATE ' . tableName('nucleus_member') + . " SET mname='" . addslashes($user_name) . "'," + . " mrealname='". addslashes($user_realname) . "'," + . " mpassword='". md5(addslashes($user_password)) . "'," + . " murl='" . addslashes($config_indexurl) . "'," + . " memail='" . addslashes($user_email) . "'," + . " madmin=1," + . " mcanlogin=1" + . " WHERE mnumber=1"; + mysql_query($query) or _doError("Error while setting member settings: " . mysql_error()); + + // 8. update weblog settings + $query = 'UPDATE ' . tableName('nucleus_blog') + . " SET bname='" . addslashes($blog_name) . "'," + . " bshortname='". addslashes($blog_shortname) . "'," + . " burl='" . addslashes($config_indexurl) . "'" + . " WHERE bnumber=1"; + mysql_query($query) or _doError("Error while setting weblog settings: " . mysql_error()); + + // 9. update item date + $query = 'UPDATE ' . tableName('nucleus_item') + . " SET itime='". date("Y-m-d H:i:s",time()) ."'" + . " WHERE inumber=1"; + mysql_query($query) or _doError("Error with query: " . mysql_error()); + + global $aConfPlugsToInstall, $aConfSkinsToImport; + $aSkinErrors = array(); + $aPlugErrors = array(); + if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0)) { + // 10. set global variables + global $MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD, $MYSQL_DATABASE, $MYSQL_PREFIX; + $MYSQL_HOST = $mysql_host; + $MYSQL_USER = $mysql_user; + $MYSQL_PASSWORD = $mysql_password; + $MYSQL_DATABASE = $mysql_database; + $MYSQL_PREFIX = ($mysql_usePrefix == 1)?$mysql_prefix:''; + global $DIR_NUCLEUS, $DIR_MEDIA, $DIR_SKINS, $DIR_PLUGINS, $DIR_LANG, $DIR_LIBS; + $DIR_NUCLEUS = $config_adminpath; + $DIR_MEDIA = $config_mediapath; + $DIR_SKINS = $config_skinspath; + $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/'; + $DIR_LANG = $DIR_NUCLEUS . 'language/'; + $DIR_LIBS = $DIR_NUCLEUS . 'libs/'; + + // close database connection (needs to be closed if we want to include globalfunctions.php) + mysql_close(); + + $manager = ''; + include_once($DIR_LIBS . 'globalfunctions.php'); + + // 11. install custom skins + $aSkinErrors = installCustomSkins($manager); + + // 12. install custom plugins + $aPlugErrors = installCustomPlugs($manager); + + } + + + // 12. Write config file ourselves (if possible) + $bConfigWritten = 0; + if (@file_exists('config.php') && is_writable('config.php') && $fp = @fopen('config.php', 'w')) { + $config_data = "<" . "?php \n"; + $config_data .= "\n"; + $config_data .= " // mySQL connection information\n"; + $config_data .= " \$MYSQL_HOST = '" . $mysql_host . "';\n"; + $config_data .= " \$MYSQL_USER = '" . $mysql_user . "';\n"; + $config_data .= " \$MYSQL_PASSWORD = '" . $mysql_password . "';\n"; + $config_data .= " \$MYSQL_DATABASE = '" . $mysql_database . "';\n"; + $config_data .= " \$MYSQL_PREFIX = '" . (($mysql_usePrefix == 1)?$mysql_prefix:'') . "';\n"; + $config_data .= "\n"; + $config_data .= " // main nucleus directory\n"; + $config_data .= " \$DIR_NUCLEUS = '" . $config_adminpath . "';\n"; + $config_data .= "\n"; + $config_data .= " // path to media dir\n"; + $config_data .= " \$DIR_MEDIA = '" . $config_mediapath . "';\n"; + $config_data .= "\n"; + $config_data .= " // extra skin files for imported skins\n"; + $config_data .= " \$DIR_SKINS = '" . $config_skinspath . "';\n"; + $config_data .= "\n"; + $config_data .= " // these dirs are normally sub dirs of the nucleus dir, but \n"; + $config_data .= " // you can redefine them if you wish\n"; + $config_data .= " \$DIR_PLUGINS = \$DIR_NUCLEUS . 'plugins/';\n"; + $config_data .= " \$DIR_LANG = \$DIR_NUCLEUS . 'language/';\n"; + $config_data .= " \$DIR_LIBS = \$DIR_NUCLEUS . 'libs/';\n"; + $config_data .= "\n"; + $config_data .= " // include libs\n"; + $config_data .= " include(\$DIR_LIBS.'globalfunctions.php');\n"; + $config_data .= " if (!extension_loaded('mbstring')) {\n"; + $config_data .= " include(\$DIR_LIBS.'mb_emulator/mb-emulator.php');\n"; + $config_data .= " }\n"; + $config_data .= "?" . ">"; + + $result = @fputs($fp, $config_data, strlen($config_data)); + fclose($fp); + + if ($result) + $bConfigWritten = 1; + } + + ?> + + + + + Nucleus¤Î¥¤¥ó¥¹¥È¡¼¥ë + + + +

+ 0) { + echo '

Skin/Plugin Install errors

'; + echo ''; + } + + if (!$bConfigWritten) { ?> +

¥¤¥ó¥¹¥È¡¼¥ë¤Ï¤Û¤Ü´°Î»¤·¤Þ¤·¤¿¡ª

+

+ ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Æ¡¼¥Ö¥ë¤Î½é´üÃÍÆþÎϤ¬À®¸ù¤·¤Þ¤·¤¿¡£¸å¤Ïconfig.php¤ò½ñ¤­´¹¤¨¤ë¤À¤±¤Ç¤¹¡£°Ê²¼¤Ë½ñ¤­´¹¤¨¤ë¤Ù¤­ÆâÍƤòɽ¼¨¤·¤Þ¤¹¡Êmysql¤Î¥Ñ¥¹¥ï¡¼¥É¤Ï¥Þ¥¹¥¯¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤³¤Ï¼ÂºÝ¤Î¤â¤Î¤Ë½ñ¤­´¹¤¨¤Æ¤¯¤À¤µ¤¤¡Ë +

+ +
+<?php
+	// mySQL connection information
+	$MYSQL_HOST = '';
+	$MYSQL_USER = '';
+	$MYSQL_PASSWORD = 'xxxxxxxxxxx';
+	$MYSQL_DATABASE = '';
+	$MYSQL_PREFIX = '';
+
+	// main nucleus directory
+	$DIR_NUCLEUS = '';
+
+	// path to media dir
+	$DIR_MEDIA = '';
+
+	// extra skin files for imported skins
+	$DIR_SKINS = '';
+
+	// these dirs are normally sub dirs of the nucleus dir, but
+	// you can redefine them if you wish
+	$DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';
+	$DIR_LANG = $DIR_NUCLEUS . 'language/';
+	$DIR_LIBS = $DIR_NUCLEUS . 'libs/';
+
+	// include libs
+	include($DIR_LIBS.'globalfunctions.php');
+?>
+			
+ +

¤¢¤Ê¤¿¤Î¥³¥ó¥Ô¥å¡¼¥¿¾å¤Î¥Õ¥¡¥¤¥ë¤ò½ñ¤­´¹¤¨¤¿¤é¡¢FTP¤ò»È¤Ã¤Æ¥¦¥§¥Ö¥µ¡¼¥Ð¤Ë¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£ASCII¥â¡¼¥É¤ÇÁ÷¿®¤·¤Æ¥Õ¥¡¥¤¥ë¤ò¾å½ñ¤­¤·¤Þ¤¹¡£ +

+ +
+ ÉÕµ­: config.php¤ÎºÇ½é¤ä½ª¤ï¤ê¤Ë¥¹¥Ú¡¼¥¹¤ò¶õ¤±¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤·¤ç¤¦¡£¼Â¹Ô»þ¤Ë¥¨¥é¡¼¤ò°ú¤­µ¯¤³¤¹¸¶°ø¤È¤Ê¤ê¤Þ¤¹¡£ +
+ ¤·¤¿¤¬¤Ã¤Æ¡¢config.php¤ÎºÇ½é¤Îʸ»ú¤Ï "<"¤ÇºÇ¸å¤Îʸ»ú¤Ï">"¤È¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ +
+ + +

¥¤¥ó¥¹¥È¡¼¥ë¤Ï´°Î»¤·¤Þ¤·¤¿¡ª

+ +

Nucleus¤Ï¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¡¢config.php¤Ï¥¢¥Ã¥×¥Ç¡¼¥È¤µ¤ì¤Þ¤·¤¿¡£

+ +

¥»¥­¥å¥ê¥Æ¥£¤Î¤¿¤áconfig.php¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò444¤ËÌ᤹¤³¤È¤ò˺¤ì¤Ê¤¤¤Ç¤¯¤À¤µ¤¤(¥Ñ¡¼¥ß¥Ã¥·¥ç¥óÊѹ¹¤Î´Ê°×¥¬¥¤¥É)¡£

+ +

¥¤¥ó¥¹¥È¡¼¥ë¥Õ¥¡¥¤¥ë¤Îºï½ü

+ +

¥¦¥§¥Ö¥µ¡¼¥Ð¤«¤é¼¡¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤¡§

+ + + +

¤â¤·¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢´ÉÍýÎΰè¤ò³«¤¯¤³¤È¤¬½ÐÍè¤Þ¤»¤ó¡£

+ +

¥¦¥§¥Ö¥µ¥¤¥È¤Î³Îǧ

+

+ ¥¦¥§¥Ö¥µ¥¤¥È¤ò»È¤¦½àÈ÷¤¬À°¤¤¤Þ¤·¤¿¡£ +

+

+ + + + getPlugin($plugName); + if (!$plugin) { + sql_query('DELETE FROM ' . sql_table('plugin') . ' WHERE pfile=\''. addslashes($plugName).'\''); + $numCurrent--; + array_push($aErrors, 'Unable to install plugin ' . $plugName); + continue; + } + $plugin->install(); + } + + // SYNC PLUGIN EVENT LIST + sql_query('DELETE FROM '.sql_table('plugin_event')); + // loop over all installed plugins + $res = sql_query('SELECT pid, pfile FROM '.sql_table('plugin')); + while($o = mysql_fetch_object($res)) { + $pid = $o->pid; + $plug =& $manager->getPlugin($o->pfile); + if ($plug) + { + $eventList = $plug->getEventList(); + foreach ($eventList as $eventName) + sql_query('INSERT INTO '.sql_table('plugin_event').' (pid, event) VALUES ('.$pid.', \''.$eventName.'\')'); + } + } + + return $aErrors; + } + + function installCustomSkins(&$manager) { + global $aConfSkinsToImport, $DIR_LIBS, $DIR_SKINS; + + $aErrors = array(); + + if (count($aConfSkinsToImport) == 0) + return $aErrors; + + // load skinie class + include_once($DIR_LIBS . 'skinie.php'); + + $importer = new SKINIMPORT(); + + foreach ($aConfSkinsToImport as $skinName) { + $importer->reset(); + + $skinFile = $DIR_SKINS . $skinName . '/skinbackup.xml'; + if (!@file_exists($skinFile)) { + array_push($aErrors, 'Unable to import ' . $skinFile . ' : file does not exist'); + continue; + } + $error = $importer->readFile($skinFile); + if ($error) { + array_push($aErrors, 'Unable to import ' . $skinName . ' : ' . $error); + continue; + } + $error = $importer->writeToDatabase(1); + if ($error) { + array_push($aErrors, 'Unable to import ' . $skinName . ' : ' . $error); + continue; + } + } + + return $aErrors; + } + + // give an error if one or more nucleus are not accessible + function doCheckFiles() { + $missingfiles = array(); + + if (!is_readable('install.sql')) + array_push($missingfiles, "File install.sql is missing or not readable"); + if (!is_readable('index.php')) + array_push($missingfiles, "File index.php is missing or not readable"); + if (!is_readable('action.php')) + array_push($missingfiles, "File action.php is missing or not readable"); + if (!is_readable('nucleus/index.php')) + array_push($missingfiles, "File nucleus/index.php is missing or not readable"); + if (!is_readable('nucleus/libs/globalfunctions.php')) + array_push($missingfiles, "File nucleus/libs/globalfunctions.php is missing or not readable"); + if (!is_readable('nucleus/libs/ADMIN.php')) + array_push($missingfiles, "File nucleus/libs/ADMIN.php is missing or not readable"); + if (!is_readable('nucleus/libs/BLOG.php')) + array_push($missingfiles, "File nucleus/libs/BLOG.php is missing or not readable"); + if (!is_readable('nucleus/libs/COMMENT.php')) + array_push($missingfiles, "File nucleus/libs/COMMENT.php is missing or not readable"); + if (!is_readable('nucleus/libs/COMMENTS.php')) + array_push($missingfiles, "File nucleus/libs/COMMENTS.php is missing or not readable"); + if (!is_readable('nucleus/libs/ITEM.php')) + array_push($missingfiles, "File nucleus/libs/ITEM.php is missing or not readable"); + if (!is_readable('nucleus/libs/MEMBER.php')) + array_push($missingfiles, "File nucleus/libs/MEMBER.php is missing or not readable"); + if (!is_readable('nucleus/libs/SKIN.php')) + array_push($missingfiles, "File nucleus/libs/SKIN.php is missing or not readable"); + if (!is_readable('nucleus/libs/TEMPLATE.php')) + array_push($missingfiles, "File nucleus/libs/TEMPLATE.php is missing or not readable"); + if (!is_readable('nucleus/libs/MEDIA.php')) + array_push($missingfiles, "File nucleus/libs/MEDIA.php is missing or not readable"); + if (!is_readable('nucleus/libs/ACTIONLOG.php')) + array_push($missingfiles, "File nucleus/libs/ACTIONLOG.php is missing or not readable"); + if (!is_readable('nucleus/media.php')) + array_push($missingfiles, "File nucleus/media.php is missing or not readable"); + + + if (sizeof($missingfiles) > 0) + showErrorMessages($missingfiles); + + + } + + function updateConfig($name, $val) { + $name = addslashes($name); + $val = trim(addslashes($val)); + + $query = 'UPDATE ' . tableName('nucleus_config') + . " SET value='$val'" + . " WHERE name='$name'"; + + mysql_query($query) or _doError("Query error while trying to update config: " . mysql_error()); + return mysql_insert_id(); + } + + function endsWithSlash($s) { + return (strrpos($s,'/') == strlen($s) - 1); + } + + /** + * Checks if email address is valid + */ + function _isValidMailAddress($address) { + if (preg_match("/^[a-zA-Z0-9\._-]+@+[A-Za-z0-9\._-]+\.+[A-Za-z]{2,4}$/", $address)) + return 1; + else + return 0; + } + + // returns true if the given string is a valid shortname + // (to check short blog names and nicknames) + // logic: starts and ends with a non space, can contain spaces in between + // min 2 chars + function _isValidShortName($name) { + if (eregi("^[a-z0-9]+$", $name)) + return 1; + else + return 0; + } + + + + // returns true if the given string is a valid display name + // (to check nicknames) + function _isValidDisplayName($name) { + if (eregi("^[a-z0-9]+[a-z0-9 ]*[a-z0-9]+$", $name)) + return 1; + else + return 0; + } + + function _doError($msg) { + ?> + + + + + Nucleus Install + + + +
+

Error!

+

+ Error message was: ""; +

+ +

+ Go Back +

+ + + + + + + + Nucleus Install + + + +
+

Errors!

+

+ Errors were found: +

+ + + +

+ Go Back +

+ + +
\ No newline at end of file