OSDN Git Service

sync with UTF-8
authorkimitake <kimitake@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Wed, 4 Apr 2007 07:52:08 +0000 (07:52 +0000)
committerkimitake <kimitake@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Wed, 4 Apr 2007 07:52:08 +0000 (07:52 +0000)
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk@247 1ca29b6e-896d-4ea0-84a5-967f57386b96

12 files changed:
euc/install.php
euc/install.sql
euc/nucleus/libs/ADMIN.php
euc/nucleus/libs/BODYACTIONS.php [new file with mode: 0644]
euc/nucleus/libs/BaseActions.php [new file with mode: 0644]
euc/nucleus/libs/COMMENTACTIONS.php [new file with mode: 0644]
euc/nucleus/libs/COMMENTS.php
euc/nucleus/libs/ENCAPSULATE.php [new file with mode: 0644]
euc/nucleus/libs/ITEMACTIONS.php [new file with mode: 0644]
euc/nucleus/libs/entity.php [new file with mode: 0644]
euc/nucleus/libs/mysql.php [new file with mode: 0644]
euc/nucleus/libs/showlist.php [new file with mode: 0644]

index d6ffea5..8af4d25 100755 (executable)
-<?php\r
-       /**\r
-         * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
-         * Copyright (C) 2002-2005 The Nucleus Group\r
-         *\r
-         * This program is free software; you can redistribute it and/or\r
-         * modify it under the terms of the GNU General Public License\r
-         * as published by the Free Software Foundation; either version 2\r
-         * of the License, or (at your option) any later version.\r
-         * (see nucleus/documentation/index.html#license for more info)\r
-         * This script will install the Nucleus tables in your SQL-database, and initialize the data in\r
-         * those tables.\r
-         *\r
-         * Below is a friendly way of letting users on non-php systems know that Nucleus won't run there.\r
-         *\r
-         * ?><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
-\r
-       /*\r
-               This part of the install.php code allows for customization of the install process.\r
-               When distributing plugins or skins together with a Nucleus installation, the\r
-               configuration below will instruct to install them\r
-\r
-               -- Start Of Configurable Part --\r
-       */\r
-\r
-               // array with names of plugins to install. Plugin files must be present in the nucleus/plugin/\r
-               // directory.\r
-               //\r
-               // example:\r
-               //     array('NP_TrackBack', 'NP_MemberGoodies')\r
-               $aConfPlugsToInstall = array('NP_SkinFiles');\r
-\r
-\r
-               // array with skins to install. skins must be present under the skins/ directory with\r
-               // a subdirectory having the same name that contains a skinbackup.xml file\r
-               //\r
-               // example:\r
-               //     array('base','rsd')\r
-               $aConfSkinsToImport = array('default');\r
-\r
-       /*\r
-               -- End Of Configurable Part --\r
-       */\r
-\r
-       // don't give warnings for uninitialized vars\r
-       error_reporting(E_ERROR | E_WARNING | E_PARSE);\r
-\r
-       // make sure there's no unnecessary escaping:\r
-       set_magic_quotes_runtime(0);\r
-\r
-  // if there are some plugins or skins to import, do not include vars\r
-  // in globalfunctions.php again... so set a flag\r
-       if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0)) {\r
-         global $CONF;\r
-         $CONF['installscript']=1;\r
-       }\r
-  if (phpversion() >= '4.1.0')\r
-         include_once('nucleus/libs/vars4.1.0.php');\r
-  else\r
-         include_once('nucleus/libs/vars4.0.6.php');\r
-\r
-       // check if mysql support is installed\r
-       if (!function_exists('mysql_query'))\r
-               _doError('Your PHP version does not have support for MySQL :(');\r
-\r
-       if (postVar('action') == 'go')\r
-               doInstall();\r
-       else\r
-               showInstallForm();\r
-       exit;\r
-\r
-       function showInstallForm() {\r
-\r
-               // 0. pre check if all necessary files exist\r
-               doCheckFiles();\r
-\r
-       ?>\r
-       <!DOCTYPE html\r
-       PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-       <html xmlns="http://www.w3.org/1999/xhtml">\r
-       <head>\r
-               <meta http-equiv="content-type" content="application/xhtml+xml; charset=EUC-JP" />\r
-               <title>Nucleus¤Î¥¤¥ó¥¹¥È¡¼¥ë</title>\r
-               <style type="text/css"><!--\r
-                       @import url('nucleus/documentation/styles/manual.css');\r
-               --></style>\r
-               <script type="text/javascript"><!--\r
-                       // function to make sure the submit button only gets pressed once\r
-                       var submitcount=0;\r
-                       function checkSubmit() {\r
-                               if (submitcount == 0) {\r
-                                       submitcount++;\r
-                                       return true;\r
-                               } else {\r
-                                       return false;\r
-                               }\r
-                       }\r
-               --></script>\r
-       </head>\r
-       <body>\r
-\r
-  <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
-\r
-       <form method="post" action="install.php">\r
-\r
-       <h1>Install Nucleus</h1>\r
-\r
-       <p>\r
-       ¤³¤Î¥¹¥¯¥ê¥×¥È¤ÏNucleus¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ò¼ê½õ¤±¤·¤Þ¤¹¡£MySQL¥Æ¡¼¥Ö¥ë¤Î¥»¥Ã¥È¥¢¥Ã¥×¤È¡¢<i>config.php</i>¤ËÆþÎϤ¹¤ë¤¿¤á¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡Êconfig.php¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò0666¤Ë¤·¤Æ¤ª¤±¤Ð¡¢¸å¼Ô¤Îºî¶È¤Ï¼«Æ°Åª¤Ë¹Ô¤ï¤ì¤Þ¤¹¡Ë¡£¤³¤ì¤ò¤Ê¤¹°Ù¤Ë¡¢¤¤¤¯¤Ä¤«¤Î¾ðÊó¤òÆþÎϤ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£\r
-       </p>\r
-\r
-       <p>\r
-       ¤¹¤Ù¤Æ¤ÎÍó¤ÎÆþÎϤ¬É¬ÍפǤ¹¡£¥ª¥×¥·¥ç¥ó¾ðÊó¤Ï¥¤¥ó¥¹¥È¡¼¥ë¤¬´°Î»¤·¤¿¤é¡¢Nucleus¤Î´ÉÍýÎΰ褫¤éÀßÄê²Äǽ¤Ç¤¹¡£\r
-       </p>\r
-\r
-       <h1>PHP &amp; MySQL Versions</h1>\r
-\r
-       <p>\r
-               °Ê²¼¤Ï¤¢¤Ê¤¿¤Î¥¦¥§¥Ö¥Û¥¹¥È¤Ë¤ª¤±¤ëPHP¥¤¥ó¥¿¡¼¥×¥ê¥¿¡¼¤ÈMySQL¥µ¡¼¥Ð¡¼¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤¹¡£Nucleus¤Î¥µ¥Ý¡¼¥È¥Õ¥©¡¼¥é¥à¤ËÌäÂê¤òÊó¹ð¤¹¤ë¤È¤­¤Ï¡¢¤³¤Î¾ðÊó¤ò½ñ¤­Åº¤¨¤Æ¤¯¤À¤µ¤¤¡£\r
-       </p>\r
-\r
-       <ul>\r
-               <li>PHP: <?php                  echo phpversion();\r
-                       $minVersion = '4.0.6';\r
-\r
-                       if (phpversion() < $minVersion)\r
-                               echo ' <span class="warning">Ãí°Õ: Nucleus¤ÎÆ°ºî¤Ë¤Ï¾¯¤Ê¤¯¤È¤â¥Ð¡¼¥¸¥ç¥ó ',$minVersion,' ¤¬É¬ÍפȤµ¤ì¤Þ¤¹</span>';\r
-               ?></li>\r
-               <li>MySQL: <?php\r
-                       // note: this piece of code is taken from phpMyAdmin\r
-\r
-                       $result = @mysql_query('SELECT VERSION() AS version');\r
-                       if ($result != FALSE && @mysql_num_rows($result) > 0) {\r
-                               $row   = mysql_fetch_array($result);\r
-                               $match = explode('.', $row['version']);\r
-                       } else {\r
-                               $result = @mysql_query('SHOW VARIABLES LIKE \'version\'');\r
-                               if ($result != FALSE && @mysql_num_rows($result) > 0){\r
-                                       $row   = mysql_fetch_row($result);\r
-                                       $match = explode('.', $row[1]);\r
-                               } else {\r
-                                       $match[0] = '?';\r
-                                       $match[1] = '?';\r
-                                       $match[2] = '?';\r
-                               }\r
-                       }\r
-\r
-                       if (!isset($match) || !isset($match[0])) {\r
-                               $match[0] = 3;\r
-                       }\r
-                       if (!isset($match[1])) {\r
-                               $match[1] = 21;\r
-                       }\r
-                       if (!isset($match[2])) {\r
-                               $match[2] = 0;\r
-                       }\r
-\r
-                       if ($match[0] != '?') {\r
-                               $match[0] = intval($match[0]);\r
-                               $match[1] = intval($match[1]);\r
-                       }\r
-\r
-                       $mysqlVersion = implode($match, '.');\r
-                       $minVersion = '3.23';\r
-\r
-                       echo $mysqlVersion;\r
-\r
-                       if ($mysqlVersion < $minVersion)\r
-                               echo ' <span class="warning">Ãí°Õ: Nucleus¤ÎÆ°ºî¤Ë¤Ï¾¯¤Ê¤¯¤È¤â¥Ð¡¼¥¸¥ç¥ó ',$minVersion,' ¤¬É¬ÍפȤµ¤ì¤Þ¤¹</span>';\r
-               ?></li>\r
-       </ul>\r
-\r
-<?php\r
-       // tell people how they can have their config file filled out automatically\r
-       if (@file_exists('config.php') && @!is_writable('config.php')) {\r
-?>\r
-       <h1><i>config.php</i>¤Î¼«Æ°¥¢¥Ã¥×¥Ç¡¼¥È</h1>\r
-\r
-       <p>\r
-       ¤â¤·<em>config.php</em>¤ò¼«Æ°Åª¤Ë¹¹¿·¤¹¤ë¤è¤¦¤Ë¤·¤¿¤¤¤Ê¤é¡¢½ñ¤­¹þ¤ß²Äǽ¤Ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£<em>config.php</em>¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò<strong>666</strong>¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£Nucleus¤Î¥¤¥ó¥¹¥È¡¼¥ëÀ®¸ù¸å¤Ë¡¢¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò<strong>444</strong>¤ËÌᤵ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡Ê<a href="nucleus/documentation/tips.html#filepermissions">¥Ñ¡¼¥ß¥Ã¥·¥ç¥óÊѹ¹¤Î´Ê°×¥¬¥¤¥É</a>¡Ë¡£\r
-       </p>\r
-\r
-       <p>\r
-       ¤â¤·¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤Ê¤¤¤È¤¤¤¦ÁªÂò¤ò¤·¤¿¡Ê¤¢¤ë¤¤¤Ï¹Ô¤¨¤Ê¤¤¡Ë¾ì¹ç¡§¤´¿´Çۤʤ¯¡£¥¤¥ó¥¹¥È¡¼¥ë¤Î²áÄø¤Ç<em>config.php</em>¤ÎÃæ¿È¤¬Ä󶡤µ¤ì¤Þ¤¹¡£¤Ç¤¹¤«¤é¡¢¤½¤ì¤ò¤´¼«¿È¤Ç¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£\r
-       </p>\r
-\r
-<?php } ?>\r
-\r
-       <h1>MySQL¤Î¥í¥°¥¤¥ó¥Ç¡¼¥¿</h1>\r
-\r
-       <p>\r
-       MySQL¤Î¥Ç¡¼¥¿¤ò°Ê²¼¤ËÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£¤½¤ì¤é¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¡¦¥Æ¡¼¥Ö¥ë¤òºîÀ®¤·¾ðÊó¤òÆþÎϤ¹¤ë¤¿¤á¤ËɬÍפʤâ¤Î¤Ç¤¹¡£¸å¤Ç¡¢<i>config.php</i>¤Ë¤âµ­Æþ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡Ê¾åµ­¤Î¼«Æ°¥¢¥Ã¥×¥Ç¡¼¥È¤òÍøÍѤ¹¤ë¾ì¹ç¡¢¤½¤Î¼ê½ç¤Ï¾Êά¤µ¤ì¤Þ¤¹¡Ë¡£\r
-       </p>\r
-\r
-       <p>\r
-       ¤â¤·¤³¤Î¾ðÊ󤬤狼¤é¤Ê¤±¤ì¤Ð¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô¤«¥Û¥¹¥Æ¥£¥ó¥°¸µ¤ËÏ¢Íí¤ò¤È¤Ã¤Æ¤¯¤À¤µ¤¤¡£¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢¥Û¥¹¥È̾¤Ï'localhost'¤Ç¤¹¡£¤â¤·Nucleus¤¬¤¢¤Ê¤¿¤Î¥µ¡¼¥Ð¤ÎPHPÀßÄ꤫¤é'default MySQL host'¤ò¸¡ÃΤ·¤¿¤Ê¤é¡¢'¥Û¥¹¥È̾'¤Ë´û¤Ëµ­Æþ¤µ¤ì¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¡£¤â¤Ã¤È¤â¡¢¤³¤Î¾ðÊó¤¬Àµ³Î¤Ç¤¢¤ë¤È¤¤¤¦ÊݾڤϤ¢¤ê¤Þ¤»¤ó¡£\r
-       </p>\r
-\r
-       <fieldset>\r
-               <legend>´ðËܤΥǡ¼¥¿¥Ù¡¼¥¹ÀßÄê</legend>\r
-               <table><tr>\r
-                       <td>¥Û¥¹¥È̾¡§</td>\r
-                       <td><input name="mySQL_host" value="<?php echo htmlspecialchars(@ini_get('mysql.default_host'))?>" /></td>\r
-               </tr><tr>\r
-                       <td>¥æ¡¼¥¶¡¼Ì¾¡§</td>\r
-                       <td><input name="mySQL_user" /></td>\r
-               </tr><tr>\r
-                       <td>¥Ñ¥¹¥ï¡¼¥É¡§</td>\r
-                       <td><input name="mySQL_password" type="password" /></td>\r
-               </tr><tr>\r
-                       <td>¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¡§</td>\r
-                       <td><input name="mySQL_database" /> (<input name="mySQL_create" value="1" type="checkbox" id="mySQL_create"><label for="mySQL_create" />¥Ç¡¼¥¿¥Ù¡¼¥¹¤òºîÀ®¤¹¤ëɬÍפ¬¤¢¤ë</label>)</td>\r
-               </tr></table>\r
-       </fieldset>\r
-\r
-       <fieldset>\r
-               <legend>¹âÅù¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹ÀßÄê</legend>\r
-               <table><tr>\r
-                       <td><input name="mySQL_usePrefix" value="1" type="checkbox" id="mySQL_usePrefix"><label for="mySQL_usePrefix" />¥Æ¡¼¥Ö¥ë¡¦¥×¥ê¥Õ¥£¥Ã¥¯¥¹¤òÍøÍÑ</label></td>\r
-                       <td><input name="mySQL_tablePrefix" value="" /></td>\r
-               </tr></table>\r
-               <p>°ì¤Ä¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÊ£¿ô¤ÎNucleus¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤ª¤ê¡¢¼«Ê¬¤¬²¿¤ò¤ä¤Ã¤Æ¤¤¤ë¤Î¤«Íý²ò¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤ò½ü¤¤¤Æ¤Ï¡¢<strong>¤³¤ì¤òÊѹ¹¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó</strong>¡£</p>\r
-               <p>Nucleus¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤¿¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Æ¡¼¥Ö¥ë¤Ï¡¢¤³¤Î¥×¥ê¥Õ¥£¥Ã¥¯¥¹¤¬Æ¬¤Ë¤Ä¤­¤Þ¤¹¡£</p>\r
-       </fieldset>\r
-\r
-       <h1>¥Ç¥£¥ì¥¯¥È¥ê¤ÈURL</h1>\r
-\r
-       <p>\r
-       ¤³¤Î¥¤¥ó¥¹¥È¡¼¥ë¥¹¥¯¥ê¥×¥È¤ÏNucleus¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÈURL¤ò¸«¤Ä¤±¤è¤¦¤È¤·¤Þ¤·¤¿¡£²¼¤ÎÃͤò¥Á¥§¥Ã¥¯¤·¤ÆɬÍפʤéÄûÀµ¤·¤Æ¤¯¤À¤µ¤¤¡£¥Õ¥¡¥¤¥ë¤Ø¤Î¥Ñ¥¹¤ÈURL¤Ï¥¹¥é¥Ã¥·¥å'/'¤Ç½ª¤ï¤é¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£\r
-       </p>\r
-\r
-       <fieldset>\r
-               <legend>URLs and directories</legend>\r
-               <table><tr>\r
-                       <td>Site <strong>URL</strong>:</td>\r
-                       <td>\r
-                                       <input name="IndexURL" size="60" value="<?php                                   $url = "http://" . serverVar('HTTP_HOST') . serverVar('PHP_SELF');\r
-                                       $url = str_replace("install.php",'',$url);\r
-                                       $url = str_replace("\\","/",$url);\r
-                                       // add slash at end if necessary\r
-                                       if (!endsWithSlash($url)) $url .= '/';\r
-                                       echo $url;\r
-                               ?>" />\r
-                       </td>\r
-               </tr><tr>\r
-                       <td>Admin-area <strong>URL</strong>:</td>\r
-                       <td><input name="AdminURL" size="60" value="<?php                                       if ($url) echo $url . 'nucleus/';\r
-                               ?>" />\r
-                       </td>\r
-               </tr><tr>\r
-                       <td>Admin-area <strong>path</strong>:</td>\r
-                       <td><input name="AdminPath" size="60" value="<?php                                      $path = str_replace("install.php",'',serverVar('SCRIPT_FILENAME'));\r
-                                       $path = str_replace("\\","/",$path);\r
-                                       // add slash at end if necessary\r
-                                       if (!endsWithSlash($path)) $path .= '/';\r
-                                       if($path) echo  $path . 'nucleus/';\r
-                               ?>" />\r
-                       </td>\r
-               </tr><tr>\r
-                       <td>Media files <strong>URL</strong>:</td>\r
-                       <td><input name="MediaURL" size="60" value="<?php                                       if ($url) echo $url . 'media/';\r
-                               ?>" />\r
-                       </td>\r
-               </tr><tr>\r
-                       <td>Media directory <strong>path</strong>:</td>\r
-                       <td><input name="MediaPath" size="60" value="<?php                                      $path = str_replace("install.php",'',serverVar('SCRIPT_FILENAME'));\r
-                                       $path = str_replace("\\","/",$path);\r
-                                       // add slash at end if necessary\r
-                                       if (!endsWithSlash($path)) $path .= '/';\r
-                                       if ($path) echo $path . 'media/';\r
-                               ?>" />\r
-                       </td>\r
-               </tr><tr>\r
-                       <td>Extra skin files <strong>URL</strong>:</td>\r
-                       <td><input name="SkinsURL" size="60" value="<?php                                       if ($url) echo $url . 'skins/';\r
-                               ?>" />\r
-                               <br />(¥¤¥ó¥Ý¡¼¥È¤µ¤ì¤¿¥¹¥­¥ó¤¬»ÈÍÑ)\r
-                       </td>\r
-               </tr><tr>\r
-                       <td>Extra skin files directory <strong>path</strong>:</td>\r
-                       <td><input name="SkinsPath" size="60" value="<?php                              $path = str_replace("install.php",'',serverVar('SCRIPT_FILENAME'));\r
-                               $path = str_replace("\\","/",$path);\r
-                               // add slash at end if necessary\r
-                               if (!endsWithSlash($path)) $path .= '/';\r
-                               if ($path) echo $path . 'skins/';\r
-                               ?>" />\r
-                               <br />(¥¤¥ó¥Ý¡¼¥È¤µ¤ì¤¿¥¹¥­¥ó¤Î¥Õ¥¡¥¤¥ëÎà¤òÃÖ¤¯¾ì½ê)\r
-                       </td>\r
-               </tr><tr>\r
-                       <td>Plugin files <strong>URL</strong>:</td>\r
-                       <td><input name="PluginURL" size="60" value="<?php                                      if ($url) echo $url . 'nucleus/plugins/';\r
-                               ?>" />\r
-                       </td>\r
-               </tr><tr>\r
-                       <td>Action <strong>URL</strong>:</td>\r
-                       <td><input name="ActionURL" size="60" value="<?php                                      if ($url) echo $url . 'action.php';\r
-                               ?>" />\r
-                               <br />(<tt>action.php</tt>¤Ø¤Îhttp://¤«¤é»Ï¤Þ¤ëURL)\r
-                       </td>\r
-               </tr></table>\r
-       </fieldset>\r
-\r
-       <p class="note">\r
-       <strong>ÉÕµ­:</strong> ÁêÂХѥ¹¤Ç¤Ï¤Ê¤¯<strong>ÀäÂХѥ¹¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤</strong>¡£Ä̾ÀäÂХѥ¹¤Ï<tt>/home/username/public_html/</tt>¤Î¤è¤¦¤Ê·Á¤ò¤È¤ê¤Þ¤¹¡£Unix¥·¥¹¥Æ¥à¡Ê¤Û¤È¤ó¤É¤Î¥µ¡¼¥Ð¡¼¤¬¤½¤¦¤Ç¤¹¡Ë¤Ë¤ª¤¤¤Æ¡¢¥Ñ¥¹¤Ï¥¹¥é¥Ã¥·¥å¤«¤é»Ï¤Þ¤ê¤Þ¤¹¡£¤â¤·¤³¤ì¤é¤Î¾ðÊóÆþÎϤËÌäÂ꤬À¸¤¸¤¿¤é¡¢¤¢¤Ê¤¿¤Î¥µ¡¼¥Ð´ÉÍý¼Ô¤Ë¤¿¤º¤Í¤ë¤Ù¤­¤Ç¤¹¡£\r
-       </p>\r
-\r
-       <h1>´ÉÍý¸¢¸Â¤ò¤â¤Ä¥æ¡¼¥¶¡¼</h1>\r
-\r
-       <p>°Ê²¼¤Ë¡¢¥µ¥¤¥È¤ÎºÇ½é¤Î¥æ¡¼¥¶¡¼¤òºîÀ®¤¹¤ë¤¿¤á¤Î¤¤¤¯¤Ä¤«¤Î¾ðÊó¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£</p>\r
-\r
-       <fieldset>\r
-               <legend>´ÉÍý¸¢¸Â¤ò»ý¤Ä¥æ¡¼¥¶¡¼</legend>\r
-               <table><tr>\r
-                       <td>ɽ¼¨¤µ¤ì¤ë̾Á°¡§</td>\r
-                       <td>\r
-                               <input name="User_name" value="" />\r
-                               <small>(µö²Ä¤µ¤ì¤ëʸ»ú¡§a-z ¤È 0-9¡¢ºÇ½é¤ÈºÇ¸å°Ê³°¤Î¥¹¥Ú¡¼¥¹)</small>\r
-                       </td>\r
-               </tr><tr>\r
-                       <td>ËÜ̾¡Ê¥Ï¥ó¥É¥ë̾¡Ë¡§</td>\r
-                       <td><input name="User_realname" value="" /></td>\r
-               </tr><tr>\r
-                       <td>¥Ñ¥¹¥ï¡¼¥É¡§</td>\r
-                       <td><input name="User_password" type="password" value="" /></td>\r
-               </tr><tr>\r
-                       <td>¥Ñ¥¹¥ï¡¼¥É¤Î³Îǧ¡§</td>\r
-                       <td><input name="User_password2" type="password" value="" /></td>\r
-               </tr><tr>\r
-                       <td>¥á¡¼¥ë¥¢¥É¥ì¥¹¡§</td>\r
-                       <td>\r
-                               <input name="User_email" value="" />\r
-                               <small>(ÍøÍѲÄǽ¤Ê¥á¡¼¥ë¥¢¥É¥ì¥¹¤òÆþ¤ì¤Æ¤¯¤À¤µ¤¤)</small>\r
-                       </td>\r
-               </tr></table>\r
-       </fieldset>\r
-\r
-       <h1>¥¦¥§¥Ö¥í¥°¤Î¥Ç¡¼¥¿</h1>\r
-\r
-       <p>°Ê²¼¤Ë¡¢¥Ç¥Õ¥©¥ë¥È¤Îweblog¤òºîÀ®¤¹¤ë¤¿¤á¤Ë¤¤¤¯¤Ä¤«¤Î¾ðÊó¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£¤³¤Îweblog¤Î̾Á°¤Ï¡¢¥µ¥¤¥È̾¤È¤·¤Æ¤âÍøÍѤµ¤ì¤Þ¤¹¡£</p>\r
-\r
-       <fieldset>\r
-               <legend>¥¦¥§¥Ö¥í¥°¤Î¥Ç¡¼¥¿</legend>\r
-               <table><tr>\r
-                       <td>Blog̾¡§</td>\r
-                       <td><input name="Blog_name" size="60" value="My Nucleus CMS" /></td>\r
-               </tr><tr>\r
-                       <td>Blog¤Îû½Ì̾¡§</td>\r
-                       <td>\r
-                               <input name="Blog_shortname" value="mynucleuscms" />\r
-                               <small>(µö²Ä¤µ¤ì¤ëʸ»ú¡§a-z ¤È 0-9¡¢¥¹¥Ú¡¼¥¹¤ÏÉÔ²Ä)</small>\r
-                       </td>\r
-               </tr></table>\r
-       </fieldset>\r
-\r
-       <h1>¥Ç¡¼¥¿¤ÎÁ÷¿®</h1>\r
-\r
-       <p>\r
-       ¾å¤Ë½ñ¤¤¤Æ¤­¤¿¥Ç¡¼¥¿¤¬Àµ¤·¤¤¤«³Î¤«¤á¤Æ¤¯¤À¤µ¤¤¡£¤è¤±¤ì¤Ð¥Ç¡¼¥¿¥Ù¡¼¥¹¡¦¥Æ¡¼¥Ö¥ë¤ÈºÇ½é¤Î¥Ç¡¼¥¿¤òÀßÄꤹ¤ë¤¿¤á¤Ë²¼¤Î¥Ü¥¿¥ó¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£¾¯¤·»þ´Ö¤¬¤«¤«¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¤´¿ÉÊú¤ò¡£<b>¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤Î¤Ï°ì²ó¤À¤±¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£</b>\r
-       </p>\r
-\r
-       <p>\r
-               <input name="action" value="go" type="hidden" />\r
-               <input type="submit" value="Nucleus CMS¤Î¥¤¥ó¥¹¥È¡¼¥ë" onclick="return checkSubmit();" />\r
-       </p>\r
-\r
-       </form>\r
-\r
-       </body>\r
-       </html>\r
-\r
-\r
-       <?php   }\r
-\r
-       function tableName($unPrefixed)\r
-       {\r
-               global $mysql_usePrefix, $mysql_prefix;\r
-               if ($mysql_usePrefix == 1)\r
-                       return $mysql_prefix . $unPrefixed;\r
-               else\r
-                       return $unPrefixed;\r
-       }\r
-\r
-       function doInstall() {\r
-               global $mysql_usePrefix, $mysql_prefix;\r
-\r
-               // 0. put all POST-vars into vars\r
-               $mysql_host             = postVar('mySQL_host');\r
-               $mysql_user             = postVar('mySQL_user');\r
-               $mysql_password         = postVar('mySQL_password');\r
-               $mysql_database         = postVar('mySQL_database');\r
-               $mysql_create           = postVar('mySQL_create');\r
-               $mysql_usePrefix        = postVar('mySQL_usePrefix');\r
-               $mysql_prefix           = postVar('mySQL_tablePrefix');\r
-               $config_indexurl        = postVar('IndexURL');\r
-               $config_adminurl        = postVar('AdminURL');\r
-               $config_adminpath       = postVar('AdminPath');\r
-               $config_mediaurl        = postVar('MediaURL');\r
-               $config_skinsurl        = postVar('SkinsURL');\r
-               $config_pluginurl       = postVar('PluginURL');\r
-               $config_actionurl       = postVar('ActionURL');\r
-               $config_mediapath       = postVar('MediaPath');\r
-               $config_skinspath       = postVar('SkinsPath');\r
-               $user_name                      = postVar('User_name');\r
-               $user_realname          = postVar('User_realname');\r
-               $user_password          = postVar('User_password');\r
-               $user_password2         = postVar('User_password2');\r
-               $user_email             = postVar('User_email');\r
-               $blog_name                      = postVar('Blog_name');\r
-               $blog_shortname         = postVar('Blog_shortname');\r
-               $config_adminemail      = $user_email;\r
-               $config_sitename        = $blog_name;\r
-\r
-\r
-               $config_indexurl        = str_replace("\\","/",$config_indexurl);\r
-               $config_adminurl        = str_replace("\\","/",$config_adminurl);\r
-               $config_mediaurl        = str_replace("\\","/",$config_mediaurl);\r
-               $config_skinsurl        = str_replace("\\","/",$config_skinsurl);\r
-               $config_pluginurl       = str_replace("\\","/",$config_pluginurl);\r
-               $config_actionurl       = str_replace("\\","/",$config_actionurl);\r
-               $config_adminpath       = str_replace("\\","/",$config_adminpath);\r
-               $config_skinspath       = str_replace("\\","/",$config_skinspath);\r
-\r
-               // 1. check all the data\r
-               $errors = array();\r
-\r
-               if (!$mysql_database)\r
-                       array_push($errors,"mySQL database name missing");\r
-               if (($mysql_usePrefix == 1) && (strlen($mysql_prefix) == 0))\r
-                       array_push($errors,"mySQL prefix was selected, but prefix is empty");\r
-               if (($mysql_usePrefix == 1) && (!eregi('^[a-zA-Z0-9_]+$', $mysql_prefix)))\r
-                       array_push($errors,"mySQL prefix should only contain characters from the ranges A-Z, a-z, 0-9 or underscores");\r
-               if (!endsWithSlash($config_indexurl) || !endsWithSlash($config_adminurl)\r
-                                                    || !endsWithSlash($config_mediaurl)\r
-                                                    || !endsWithSlash($config_pluginurl)\r
-                                                    || !endsWithSlash($config_skinsurl)\r
-                                                               // TODO: add action.php check\r
-                   )\r
-                       array_push($errors,"One of the URLs does not end with a slash, or action url does not end with 'action.php'");\r
-               if (!endsWithSlash($config_adminpath))\r
-                       array_push($errors,"The path of the administration area does not end with a slash");\r
-               if (!endsWithSlash($config_mediapath))\r
-                       array_push($errors,"The media path does not end with a slash");\r
-               if (!endsWithSlash($config_skinspath))\r
-                       array_push($errors,"The skins path does not end with a slash");\r
-               if (!is_dir($config_adminpath))\r
-                       array_push($errors,"The path of the administration area does not exist on your server");\r
-               if (!_isValidMailAddress($user_email))\r
-                       array_push($errors,"Invalid e-mail address given for user");\r
-               if (!_isValidDisplayName($user_name))\r
-                       array_push($errors,"User name is not a valid display name (allowed chars: a-zA-Z0-9 and spaces)");\r
-               if (!$user_password || !$user_password2)\r
-                       array_push($errors, "User password is empty");\r
-               if ($user_password != $user_password2)\r
-                       array_push($errors, "User password do not match");\r
-               if (!_isValidShortName($blog_shortname))\r
-                       array_push($errors, "Invalid short name given for blog (allowed chars: a-z0-9, no spaces)");\r
-               if (sizeof($errors) > 0)\r
-                       showErrorMessages($errors);\r
-\r
-               // 2. try to log in to mySQL\r
-               $connection = @mysql_connect($mysql_host, $mysql_user, $mysql_password);\r
-               if ($connection == false)\r
-                       _doError("Could not connect to mySQL server: " . mysql_error());\r
-\r
-               // 3. try to create database (if needed)\r
-               if ($mysql_create == 1) {\r
-                       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
-               }\r
-\r
-               // 4. try to select database\r
-               mysql_select_db($mysql_database) or _doError("Could not select database. Make sure it exists");\r
-\r
-               // 5. execute queries\r
-               $filename = "install.sql";\r
-               $fd = fopen ($filename, "r");\r
-               $queries = fread ($fd, filesize ($filename));\r
-               fclose ($fd);\r
-\r
-               $queries = split("(;\n|;\r)",$queries);\r
-\r
-               $aTableNames = array(\r
-                       'nucleus_actionlog',\r
-                       'nucleus_ban',\r
-                       'nucleus_blog',\r
-                       'nucleus_category',\r
-                       'nucleus_comment',\r
-                       'nucleus_config',\r
-                       'nucleus_item',\r
-                       'nucleus_karma',\r
-                       'nucleus_member',\r
-                       'nucleus_plugin',\r
-                       'nucleus_skin',\r
-                       'nucleus_template',\r
-                       'nucleus_team',\r
-                       'nucleus_activation',\r
-                       'nucleus_tickets'\r
-// these are unneeded (one of the replacements above takes care of them)\r
-//                     'nucleus_plugin_event',\r
-//                     'nucleus_plugin_option',\r
-//                     'nucleus_plugin_option_desc',\r
-//                     'nucleus_skin_desc',\r
-//                     'nucleus_template_desc',\r
-               );\r
-               $aTableNamesPrefixed = array(\r
-                       $mysql_prefix . 'nucleus_actionlog',\r
-                       $mysql_prefix . 'nucleus_ban',\r
-                       $mysql_prefix . 'nucleus_blog',\r
-                       $mysql_prefix . 'nucleus_category',\r
-                       $mysql_prefix . 'nucleus_comment',\r
-                       $mysql_prefix . 'nucleus_config',\r
-                       $mysql_prefix . 'nucleus_item',\r
-                       $mysql_prefix . 'nucleus_karma',\r
-                       $mysql_prefix . 'nucleus_member',\r
-                       $mysql_prefix . 'nucleus_plugin',\r
-                       $mysql_prefix . 'nucleus_skin',\r
-                       $mysql_prefix . 'nucleus_template',\r
-                       $mysql_prefix . 'nucleus_team',\r
-                       $mysql_prefix . 'nucleus_activation',\r
-                       $mysql_prefix . 'nucleus_tickets'\r
-// these are unneeded (one of the replacements above takes care of them)\r
-//                     $mysql_prefix . 'nucleus_plugin_event',\r
-//                     $mysql_prefix . 'nucleus_plugin_option',\r
-//                     $mysql_prefix . 'nucleus_plugin_option_desc',\r
-//                     $mysql_prefix . 'nucleus_skin_desc',\r
-//                     $mysql_prefix . 'nucleus_template_desc',\r
-               );\r
-\r
-               for ($idx = 0;$idx<sizeof($queries);$idx++) {\r
-                       $query = trim($queries[$idx]);\r
-                       // echo "QUERY = <small>" . htmlspecialchars($query) . "</small><p>";\r
-                       if ($query) {\r
-                               if ($mysql_usePrefix == 1)\r
-                                       $query = str_replace($aTableNames, $aTableNamesPrefixed, $query);\r
-                               mysql_query($query) or _doError("Error while executing query (<small>" . htmlspecialchars($query) . "</small>): " . mysql_error());\r
-                       }\r
-\r
-               }\r
-\r
-               // 6. update global settings\r
-               updateConfig('IndexURL',        $config_indexurl);\r
-               updateConfig('AdminURL',        $config_adminurl);\r
-               updateConfig('MediaURL',        $config_mediaurl);\r
-               updateConfig('SkinsURL',        $config_skinsurl);\r
-               updateConfig('PluginURL',       $config_pluginurl);\r
-               updateConfig('ActionURL',       $config_actionurl);\r
-               updateConfig('AdminEmail',      $config_adminemail);\r
-               updateConfig('SiteName',        $config_sitename);\r
-\r
-\r
-               // 7. update GOD member\r
-               $query =  'UPDATE ' . tableName('nucleus_member')\r
-                      . " SET mname='" . addslashes($user_name) . "',"\r
-                      . "     mrealname='". addslashes($user_realname) . "',"\r
-                      . "     mpassword='". md5(addslashes($user_password)) . "',"\r
-                      . "     murl='" . addslashes($config_indexurl) . "',"\r
-                      . "     memail='" . addslashes($user_email) . "',"\r
-                      . "     madmin=1,"\r
-                      . "     mcanlogin=1"\r
-                      . " WHERE mnumber=1";\r
-               mysql_query($query) or _doError("Error while setting member settings: " . mysql_error());\r
-\r
-               // 8. update weblog settings\r
-               $query =  'UPDATE ' . tableName('nucleus_blog')\r
-                      . " SET bname='" . addslashes($blog_name) . "',"\r
-                      . "     bshortname='". addslashes($blog_shortname) . "',"\r
-                      . "     burl='" . addslashes($config_indexurl) . "'"\r
-                      . " WHERE bnumber=1";\r
-               mysql_query($query) or _doError("Error while setting weblog settings: " . mysql_error());\r
-\r
-               // 9. update item date\r
-               $query =  'UPDATE ' . tableName('nucleus_item')\r
-                       . " SET itime='". date("Y-m-d H:i:s",time()) ."'"\r
-                       . " WHERE inumber=1";\r
-               mysql_query($query) or _doError("Error with query: " . mysql_error());\r
-\r
-               global $aConfPlugsToInstall, $aConfSkinsToImport;\r
-               $aSkinErrors = array();\r
-               $aPlugErrors = array();\r
-               if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0)) {\r
-                       // 10. set global variables\r
-                       global $MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD, $MYSQL_DATABASE, $MYSQL_PREFIX;\r
-                       $MYSQL_HOST = $mysql_host;\r
-                       $MYSQL_USER = $mysql_user;\r
-                       $MYSQL_PASSWORD = $mysql_password;\r
-                       $MYSQL_DATABASE = $mysql_database;\r
-                       $MYSQL_PREFIX = ($mysql_usePrefix == 1)?$mysql_prefix:'';\r
-                       global $DIR_NUCLEUS, $DIR_MEDIA, $DIR_SKINS, $DIR_PLUGINS, $DIR_LANG, $DIR_LIBS;\r
-                       $DIR_NUCLEUS = $config_adminpath;\r
-                       $DIR_MEDIA = $config_mediapath;\r
-                       $DIR_SKINS = $config_skinspath;\r
-                       $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';\r
-                       $DIR_LANG = $DIR_NUCLEUS . 'language/';\r
-                       $DIR_LIBS = $DIR_NUCLEUS . 'libs/';\r
-\r
-                       // close database connection (needs to be closed if we want to include globalfunctions.php)\r
-                       mysql_close();\r
-\r
-                       $manager = '';\r
-                       include_once($DIR_LIBS . 'globalfunctions.php');\r
-\r
-                       // 11. install custom skins\r
-                       $aSkinErrors = installCustomSkins($manager);\r
-\r
-                       // 12. install custom plugins\r
-                       $aPlugErrors = installCustomPlugs($manager);\r
-\r
-               }\r
-\r
-\r
-               // 12. Write config file ourselves (if possible)\r
-               $bConfigWritten = 0;\r
-               if (@file_exists('config.php') && is_writable('config.php') && $fp = @fopen('config.php', 'w')) {\r
-                       $config_data = "<" . "?php \n";\r
-                       $config_data .= "\n";\r
-                       $config_data .= "       // mySQL connection information\n";\r
-                       $config_data .= "       \$MYSQL_HOST = '" . $mysql_host . "';\n";\r
-                       $config_data .= "       \$MYSQL_USER = '" . $mysql_user . "';\n";\r
-                       $config_data .= "       \$MYSQL_PASSWORD = '" . $mysql_password . "';\n";\r
-                       $config_data .= "       \$MYSQL_DATABASE = '" . $mysql_database . "';\n";\r
-                       $config_data .= "       \$MYSQL_PREFIX = '" . (($mysql_usePrefix == 1)?$mysql_prefix:'') . "';\n";\r
-                       $config_data .= "\n";\r
-                       $config_data .= "       // main nucleus directory\n";\r
-                       $config_data .= "       \$DIR_NUCLEUS = '" . $config_adminpath . "';\n";\r
-                       $config_data .= "\n";\r
-                       $config_data .= "       // path to media dir\n";\r
-                       $config_data .= "       \$DIR_MEDIA = '" . $config_mediapath . "';\n";\r
-                       $config_data .= "\n";\r
-                       $config_data .= "       // extra skin files for imported skins\n";\r
-                       $config_data .= "       \$DIR_SKINS = '" . $config_skinspath . "';\n";\r
-                       $config_data .= "\n";\r
-                       $config_data .= "       // these dirs are normally sub dirs of the nucleus dir, but \n";\r
-                       $config_data .= "       // you can redefine them if you wish\n";\r
-                       $config_data .= "       \$DIR_PLUGINS = \$DIR_NUCLEUS . 'plugins/';\n";\r
-                       $config_data .= "       \$DIR_LANG = \$DIR_NUCLEUS . 'language/';\n";\r
-                       $config_data .= "       \$DIR_LIBS = \$DIR_NUCLEUS . 'libs/';\n";\r
-                       $config_data .= "\n";\r
-                       $config_data .= "       // include libs\n";\r
-                       $config_data .= "       include(\$DIR_LIBS.'globalfunctions.php');\n";\r
-                       $config_data .= "       if (!extension_loaded('mbstring')) {\n";\r
-                       $config_data .= "       include(\$DIR_LIBS.'mb_emulator/mb-emulator.php');\n";\r
-                       $config_data .= "       }\n";\r
-                       $config_data .= "?" . ">";\r
-\r
-                       $result = @fputs($fp, $config_data, strlen($config_data));\r
-                       fclose($fp);\r
-\r
-                       if ($result)\r
-                               $bConfigWritten = 1;\r
-               }\r
-\r
-               ?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-               <html xmlns="http://www.w3.org/1999/xhtml">\r
-               <head>\r
-                       <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />\r
-                       <title>Nucleus¤Î¥¤¥ó¥¹¥È¡¼¥ë</title>\r
-                       <style>\r
-                               @import url('nucleus/styles/manual.css');\r
-                       </style>\r
-               </head>\r
-               <body>\r
-               <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
-<?php\r
-       $aAllErrors = array_merge($aSkinErrors, $aPlugErrors);\r
-       if (count($aAllErrors) > 0) {\r
-               echo '<h1>Skin/Plugin Install errors</h1>';\r
-               echo '<ul><li>'.implode('</li><li>', $aAllErrors).'</li></ul>';\r
-       }\r
-\r
-       if (!$bConfigWritten) { ?>\r
-                       <h1>¥¤¥ó¥¹¥È¡¼¥ë¤Ï¤Û¤Ü´°Î»¤·¤Þ¤·¤¿¡ª</h1>\r
-                       <p>\r
-                       ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Æ¡¼¥Ö¥ë¤Î½é´üÃÍÆþÎϤ¬À®¸ù¤·¤Þ¤·¤¿¡£¸å¤Ï<i>config.php</i>¤ò½ñ¤­´¹¤¨¤ë¤À¤±¤Ç¤¹¡£°Ê²¼¤Ë½ñ¤­´¹¤¨¤ë¤Ù¤­ÆâÍƤòɽ¼¨¤·¤Þ¤¹¡Êmysql¤Î¥Ñ¥¹¥ï¡¼¥É¤Ï¥Þ¥¹¥¯¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤³¤Ï¼ÂºÝ¤Î¤â¤Î¤Ë½ñ¤­´¹¤¨¤Æ¤¯¤À¤µ¤¤¡Ë\r
-                       </p>\r
-\r
-                       <pre>\r
-&lt;?php\r
-       // mySQL connection information\r
-       $MYSQL_HOST = '<b><?php echo $mysql_host?></b>';\r
-       $MYSQL_USER = '<b><?php echo $mysql_user?></b>';\r
-       $MYSQL_PASSWORD = '<i><b>xxxxxxxxxxx</b></i>';\r
-       $MYSQL_DATABASE = '<b><?php echo $mysql_database?></b>';\r
-       $MYSQL_PREFIX = '<b><?php echo ($mysql_usePrefix == 1)?$mysql_prefix:''?></b>';\r
-\r
-       // main nucleus directory\r
-       $DIR_NUCLEUS = '<b><?php echo $config_adminpath?></b>';\r
-\r
-       // path to media dir\r
-       $DIR_MEDIA = '<b><?php echo $config_mediapath?></b>';\r
-\r
-       // extra skin files for imported skins\r
-       $DIR_SKINS = '<b><?php echo $config_skinspath?></b>';\r
-\r
-       // these dirs are normally sub dirs of the nucleus dir, but\r
-       // you can redefine them if you wish\r
-       $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';\r
-       $DIR_LANG = $DIR_NUCLEUS . 'language/';\r
-       $DIR_LIBS = $DIR_NUCLEUS . 'libs/';\r
-\r
-       // include libs\r
-       include($DIR_LIBS.'globalfunctions.php');\r
-       if (!extension_loaded('mbstring')) {\r
-               include($DIR_LIBS.'mb_emulator/mb-emulator.php');\r
-       }\r
-?&gt;\r
-                       </pre>\r
-\r
-                       <p>¤¢¤Ê¤¿¤Î¥³¥ó¥Ô¥å¡¼¥¿¾å¤Î¥Õ¥¡¥¤¥ë¤ò½ñ¤­´¹¤¨¤¿¤é¡¢FTP¤ò»È¤Ã¤Æ¥¦¥§¥Ö¥µ¡¼¥Ð¤Ë¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£ASCII¥â¡¼¥É¤ÇÁ÷¿®¤·¤Æ¥Õ¥¡¥¤¥ë¤ò¾å½ñ¤­¤·¤Þ¤¹¡£\r
-                       </p>\r
-\r
-                       <div class="note">\r
-                       <b>ÉÕµ­:</b> <i>config.php</i>¤ÎºÇ½é¤ä½ª¤ï¤ê¤Ë¥¹¥Ú¡¼¥¹¤ò¶õ¤±¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤·¤ç¤¦¡£¼Â¹Ô»þ¤Ë¥¨¥é¡¼¤ò°ú¤­µ¯¤³¤¹¸¶°ø¤È¤Ê¤ê¤Þ¤¹¡£\r
-                       <br />\r
-                       ¤·¤¿¤¬¤Ã¤Æ¡¢config.php¤ÎºÇ½é¤Îʸ»ú¤Ï "&lt;"¤ÇºÇ¸å¤Îʸ»ú¤Ï"&gt;"¤È¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£\r
-                       </div>\r
-\r
-<?php } else { ?>\r
-                       <h1>¥¤¥ó¥¹¥È¡¼¥ë¤Ï´°Î»¤·¤Þ¤·¤¿¡ª</h1>\r
-\r
-                       <p>Nucleus¤Ï¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¡¢<code>config.php</code>¤Ï¥¢¥Ã¥×¥Ç¡¼¥È¤µ¤ì¤Þ¤·¤¿¡£</p>\r
-\r
-                       <p>¥»¥­¥å¥ê¥Æ¥£¤Î¤¿¤á<code>config.php</code>¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò444¤ËÌ᤹¤³¤È¤ò˺¤ì¤Ê¤¤¤Ç¤¯¤À¤µ¤¤(<a href="nucleus/documentation/tips.html#filepermissions">¥Ñ¡¼¥ß¥Ã¥·¥ç¥óÊѹ¹¤Î´Ê°×¥¬¥¤¥É</a>)¡£</p>\r
-<?php } ?>\r
-                       <h1>¥¤¥ó¥¹¥È¡¼¥ë¥Õ¥¡¥¤¥ë¤Îºï½ü</h1>\r
-\r
-                       <p>¥¦¥§¥Ö¥µ¡¼¥Ð¤«¤é¼¡¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤¡§</p>\r
-\r
-                       <ul>\r
-                               <li><b>install.sql</b>¡§¥Æ¡¼¥Ö¥ë¤Î¹½Â¤¤òÆâÊñ¤¹¤ë¥Õ¥¡¥¤¥ë</li>\r
-                               <li><b>install.php</b>¡§¤³¤Î¥Õ¥¡¥¤¥ë</li>\r
-                       </ul>\r
-\r
-                       <p>¤â¤·¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢´ÉÍýÎΰè¤ò³«¤¯¤³¤È¤¬½ÐÍè¤Þ¤»¤ó¡£</p>\r
-\r
-                       <h1>¥¦¥§¥Ö¥µ¥¤¥È¤Î³Îǧ</h1>\r
-                       <p>\r
-                       ¥¦¥§¥Ö¥µ¥¤¥È¤ò»È¤¦½àÈ÷¤¬À°¤¤¤Þ¤·¤¿¡£\r
-                       <ul>\r
-                               <li><a href="<?php echo $config_adminurl?>">´ÉÍýÎΰè¤Ë¥í¥°¥¤¥ó¤·¤Æ¥µ¥¤¥È¤ÎÀßÄê¤ò¹Ô¤¦</a></li>\r
-                               <li><a href="<?php echo $config_indexurl?>">¤¹¤°¤Ë¥µ¥¤¥È¤Ø¹Ô¤Ã¤Æ¤ß¤ë</a></li>\r
-                       </ul>\r
-                       </p>\r
-\r
-               </body>\r
-               </html>\r
-               <?php\r
-       }\r
-\r
-\r
-       function installCustomPlugs(&$manager) {\r
-               global $aConfPlugsToInstall, $DIR_LIBS;\r
-\r
-               $aErrors = array();\r
-\r
-               if (count($aConfPlugsToInstall) == 0)\r
-                       return $aErrors;\r
-\r
-               $numCurrent = mysql_num_rows(sql_query('SELECT * FROM '.sql_table('plugin')));\r
-\r
-               foreach ($aConfPlugsToInstall as $plugName) {\r
-                       // do this before calling getPlugin (in case the plugin id is used there)\r
-                       $query = 'INSERT INTO '.sql_table('plugin').' (porder, pfile) VALUES ('.(++$numCurrent).',"'.addslashes($plugName).'")';\r
-                       sql_query($query);\r
-\r
-                       // get and install the plugin\r
-                       $plugin =& $manager->getPlugin($plugName);\r
-                       if (!$plugin) {\r
-                               sql_query('DELETE FROM ' . sql_table('plugin') . ' WHERE pfile=\''. addslashes($plugName).'\'');\r
-                               $numCurrent--;\r
-                               array_push($aErrors, 'Unable to install plugin ' . $plugName);\r
-                               continue;\r
-                       }\r
-                       $plugin->install();\r
-               }\r
-\r
-               // SYNC PLUGIN EVENT LIST\r
-               sql_query('DELETE FROM '.sql_table('plugin_event'));\r
-               // loop over all installed plugins\r
-               $res = sql_query('SELECT pid, pfile FROM '.sql_table('plugin'));\r
-               while($o = mysql_fetch_object($res)) {\r
-                       $pid = $o->pid;\r
-                       $plug =& $manager->getPlugin($o->pfile);\r
-                       if ($plug)\r
-                       {\r
-                               $eventList = $plug->getEventList();\r
-                               foreach ($eventList as $eventName) \r
-                                       sql_query('INSERT INTO '.sql_table('plugin_event').' (pid, event) VALUES ('.$pid.', \''.$eventName.'\')');\r
-                       }\r
-               }\r
-\r
-               return $aErrors;\r
-       }\r
-\r
-       function installCustomSkins(&$manager) {\r
-               global $aConfSkinsToImport, $DIR_LIBS, $DIR_SKINS;\r
-\r
-               $aErrors = array();\r
-\r
-               if (count($aConfSkinsToImport) == 0)\r
-                       return $aErrors;\r
-\r
-               // load skinie class\r
-               include_once($DIR_LIBS . 'skinie.php');\r
-\r
-               $importer = new SKINIMPORT();\r
-\r
-               foreach ($aConfSkinsToImport as $skinName) {\r
-                       $importer->reset();\r
-\r
-                       $skinFile = $DIR_SKINS . $skinName . '/skinbackup.xml';\r
-                       if (!@file_exists($skinFile)) {\r
-                               array_push($aErrors, 'Unable to import ' . $skinFile . ' : file does not exist');\r
-                               continue;\r
-                       }\r
-                       $error = $importer->readFile($skinFile);\r
-                       if ($error) {\r
-                               array_push($aErrors, 'Unable to import ' . $skinName . ' : ' . $error);\r
-                               continue;\r
-                       }\r
-                       $error = $importer->writeToDatabase(1);\r
-                       if ($error) {\r
-                               array_push($aErrors, 'Unable to import ' . $skinName . ' : ' . $error);\r
-                               continue;\r
-                       }\r
-               }\r
-\r
-               return $aErrors;\r
-       }\r
-\r
-       // give an error if one or more nucleus are not accessible\r
-       function doCheckFiles() {\r
-               $missingfiles = array();\r
-\r
-               if (!is_readable('install.sql'))\r
-                       array_push($missingfiles, "File <b>install.sql</b> is missing or not readable");\r
-               if (!is_readable('index.php'))\r
-                       array_push($missingfiles, "File <b>index.php</b> is missing or not readable");\r
-               if (!is_readable('action.php'))\r
-                       array_push($missingfiles, "File <b>action.php</b> is missing or not readable");\r
-               if (!is_readable('nucleus/index.php'))\r
-                       array_push($missingfiles, "File <b>nucleus/index.php</b> is missing or not readable");\r
-               if (!is_readable('nucleus/libs/globalfunctions.php'))\r
-                       array_push($missingfiles, "File <b>nucleus/libs/globalfunctions.php</b> is missing or not readable");\r
-               if (!is_readable('nucleus/libs/ADMIN.php'))\r
-                       array_push($missingfiles, "File <b>nucleus/libs/ADMIN.php</b> is missing or not readable");\r
-               if (!is_readable('nucleus/libs/BLOG.php'))\r
-                       array_push($missingfiles, "File <b>nucleus/libs/BLOG.php</b> is missing or not readable");\r
-               if (!is_readable('nucleus/libs/COMMENT.php'))\r
-                       array_push($missingfiles, "File <b>nucleus/libs/COMMENT.php</b> is missing or not readable");\r
-               if (!is_readable('nucleus/libs/COMMENTS.php'))\r
-                       array_push($missingfiles, "File <b>nucleus/libs/COMMENTS.php</b> is missing or not readable");\r
-               if (!is_readable('nucleus/libs/ITEM.php'))\r
-                       array_push($missingfiles, "File <b>nucleus/libs/ITEM.php</b> is missing or not readable");\r
-               if (!is_readable('nucleus/libs/MEMBER.php'))\r
-                       array_push($missingfiles, "File <b>nucleus/libs/MEMBER.php</b> is missing or not readable");\r
-               if (!is_readable('nucleus/libs/SKIN.php'))\r
-                       array_push($missingfiles, "File <b>nucleus/libs/SKIN.php</b> is missing or not readable");\r
-               if (!is_readable('nucleus/libs/TEMPLATE.php'))\r
-                       array_push($missingfiles, "File <b>nucleus/libs/TEMPLATE.php</b> is missing or not readable");\r
-               if (!is_readable('nucleus/libs/MEDIA.php'))\r
-                       array_push($missingfiles, "File <b>nucleus/libs/MEDIA.php</b> is missing or not readable");\r
-               if (!is_readable('nucleus/libs/ACTIONLOG.php'))\r
-                       array_push($missingfiles, "File <b>nucleus/libs/ACTIONLOG.php</b> is missing or not readable");\r
-               if (!is_readable('nucleus/media.php'))\r
-                       array_push($missingfiles, "File <b>nucleus/media.php</b> is missing or not readable");\r
-\r
-\r
-               if (sizeof($missingfiles) > 0)\r
-                       showErrorMessages($missingfiles);\r
-\r
-\r
-       }\r
-\r
-       function updateConfig($name, $val) {\r
-               $name = addslashes($name);\r
-               $val = trim(addslashes($val));\r
-\r
-               $query = 'UPDATE ' . tableName('nucleus_config')\r
-                      . " SET value='$val'"\r
-                      . " WHERE name='$name'";\r
-\r
-               mysql_query($query) or _doError("Query error while trying to update config: " . mysql_error());\r
-               return mysql_insert_id();\r
-       }\r
-\r
-       function endsWithSlash($s) {\r
-               return (strrpos($s,'/') == strlen($s) - 1);\r
-       }\r
-\r
-       /**\r
-         * Checks if email address is valid\r
-         */\r
-       function _isValidMailAddress($address) {\r
-               if (preg_match("/^[a-zA-Z0-9\._-]+@+[A-Za-z0-9\._-]+\.+[A-Za-z]{2,4}$/", $address))\r
-                       return 1;\r
-               else\r
-                       return 0;\r
-       }\r
-\r
-       // returns true if the given string is a valid shortname\r
-       // (to check short blog names and nicknames)\r
-       // logic: starts and ends with a non space, can contain spaces in between\r
-       //        min 2 chars\r
-       function _isValidShortName($name) {\r
-               if (eregi("^[a-z0-9]+$", $name))\r
-                       return 1;\r
-               else\r
-                       return 0;\r
-       }\r
-\r
-\r
-\r
-       // returns true if the given string is a valid display name\r
-       // (to check nicknames)\r
-       function _isValidDisplayName($name) {\r
-               if (eregi("^[a-z0-9]+[a-z0-9 ]*[a-z0-9]+$", $name))\r
-                       return 1;\r
-               else\r
-                       return 0;\r
-       }\r
-\r
-       function _doError($msg) {\r
-               ?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-               <html xmlns="http://www.w3.org/1999/xhtml">\r
-               <head>\r
-                       <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />\r
-                       <title>Nucleus Install</title>\r
-                       <style>\r
-                               @import url('nucleus/styles/manual.css');\r
-                       </style>\r
-               </head>\r
-               <body>\r
-                 <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
-                       <h1>Error!</h1>\r
-                       <p>\r
-                       Error message was: "<?php echo $msg?>";\r
-                       </p>\r
-\r
-                       <p>\r
-                       <a href="install.php" onclick="history.back();return false;">Go Back</a>\r
-                       </p>\r
-               </body>\r
-               </html>\r
-               <?php           exit;\r
-       }\r
-\r
-       function showErrorMessages($errors) {\r
-               ?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-               <html xmlns="http://www.w3.org/1999/xhtml">\r
-               <head>\r
-                       <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />\r
-                       <title>Nucleus Install</title>\r
-                       <style>\r
-                               @import url('nucleus/styles/manual.css');\r
-                       </style>\r
-               </head>\r
-               <body>\r
-                 <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
-                       <h1>Errors!</h1>\r
-                       <p>\r
-                       Errors were found:\r
-                       </p>\r
-\r
-                       <ul>\r
-                       <?php   while($msg = array_shift($errors))\r
-                                       echo "<li>$msg</li>";\r
-                       ?>\r
-                       </ul>\r
-\r
-                       <p>\r
-                       <a href="install.php" onclick="history.back();return false;">Go Back</a>\r
-                       </p>\r
-               </body>\r
-               </html>\r
-               <?php           exit;\r
-       }\r
-\r
-\r
-       /* for the non-php systems that decide to show the contents:\r
-          ?></div><?php        */\r
-\r
-?>\r
+<?php
+/*
+ * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
+ * Copyright (C) 2002-2007 The Nucleus Group
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * (see nucleus/documentation/index.html#license for more info)
+ * This script will install the Nucleus tables in your SQL-database, and initialize the data in
+ * those tables.
+ *
+ * Below is a friendly way of letting users on non-php systems know that Nucleus won't run there.
+ * ?><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
+ */
+
+/**
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2007 The Nucleus Group
+ * @version $Id: install.php,v 1.5 2007-04-04 07:52:04 kimitake Exp $
+ * $NucleusJP: install.php,v 1.7 2007/02/04 06:28:44 kimitake Exp $
+ */
+
+/*
+       This part of the install.php code allows for customization of the install process.
+       When distributing plugins or skins together with a Nucleus installation, the
+       configuration below will instruct to install them
+
+       -- Start Of Configurable Part --
+*/
+
+// array with names of plugins to install. Plugin files must be present in the nucleus/plugin/
+// directory.
+//
+// example:
+//     array('NP_TrackBack', 'NP_MemberGoodies')
+$aConfPlugsToInstall = array('NP_SkinFiles');
+
+
+// array with skins to install. skins must be present under the skins/ directory with
+// a subdirectory having the same name that contains a skinbackup.xml file
+//
+// example:
+//     array('base','rsd')
+$aConfSkinsToImport = array('default');
+
+/*
+       -- End Of Configurable Part --
+*/
+
+// don't give warnings for uninitialized vars
+error_reporting(E_ERROR | E_WARNING | E_PARSE);
+
+// make sure there's no unnecessary escaping:
+set_magic_quotes_runtime(0);
+
+// if there are some plugins or skins to import, do not include vars
+// in globalfunctions.php again... so set a flag
+if ((count($aConfPlugsToInstall) > 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');
+}
+
+include_once('nucleus/libs/mysql.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();
+
+       ?>
+       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+       <html xmlns="http://www.w3.org/1999/xhtml">
+       <head>
+               <meta http-equiv="content-type" content="application/xhtml+xml; charset=EUC-JP" />
+               <title>Nucleus¤Î¥¤¥ó¥¹¥È¡¼¥ë</title>
+               <style type="text/css"><!--
+                       @import url('nucleus/documentation/styles/manual.css');
+               --></style>
+               <script type="text/javascript"><!--
+                       var submitcount = 0;
+
+                       // function to make sure the submit button only gets pressed once
+                       function checkSubmit() {
+                               if (submitcount == 0) {
+                                       submitcount++;
+                                       return true;
+                               } else {
+                                       return false;
+                               }
+                       }
+               --></script>
+       </head>
+       <body>
+               <div style="text-align:center"><img src="./nucleus/styles/logo.gif" /></div> <!-- Nucleus logo -->
+               <form method="post" action="install.php">
+
+               <h1>Install Nucleus</h1>
+
+               <p>¤³¤Î¥¹¥¯¥ê¥×¥È¤ÏNucleus¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ò¼ê½õ¤±¤·¤Þ¤¹¡£MySQL¥Æ¡¼¥Ö¥ë¤Î¥»¥Ã¥È¥¢¥Ã¥×¤È¡¢<i>config.php</i>¤ËÆþÎϤ¹¤ë¤¿¤á¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡Êconfig.php¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò0666¤Ë¤·¤Æ¤ª¤±¤Ð¡¢¸å¼Ô¤Îºî¶È¤Ï¼«Æ°Åª¤Ë¹Ô¤ï¤ì¤Þ¤¹¡Ë¡£¤³¤ì¤ò¤Ê¤¹°Ù¤Ë¡¢¤¤¤¯¤Ä¤«¤Î¾ðÊó¤òÆþÎϤ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£</p>
+
+               <p>¤¹¤Ù¤Æ¤ÎÍó¤ÎÆþÎϤ¬É¬ÍפǤ¹¡£¥ª¥×¥·¥ç¥ó¾ðÊó¤Ï¥¤¥ó¥¹¥È¡¼¥ë¤¬´°Î»¤·¤¿¤é¡¢Nucleus¤Î´ÉÍýÎΰ褫¤éÀßÄê²Äǽ¤Ç¤¹¡£</p>
+
+               <h1>PHP &amp; MySQL Versions</h1>
+
+               <p>°Ê²¼¤Ï¤¢¤Ê¤¿¤Î¥¦¥§¥Ö¥Û¥¹¥È¤Ë¤ª¤±¤ëPHP¥¤¥ó¥¿¡¼¥×¥ê¥¿¡¼¤ÈMySQL¥µ¡¼¥Ð¡¼¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤¹¡£Nucleus¤Î¥µ¥Ý¡¼¥È¥Õ¥©¡¼¥é¥à¤ËÌäÂê¤òÊó¹ð¤¹¤ë¤È¤­¤Ï¡¢¤³¤Î¾ðÊó¤ò½ñ¤­Åº¤¨¤Æ¤¯¤À¤µ¤¤¡£</p>
+
+               <ul>
+                       <li>PHP:
+
+<?php
+       echo phpversion();
+       $minVersion = '4.0.6';
+
+       if (phpversion() < $minVersion) {
+               echo ' <span class="warning">Ãí°Õ: Nucleus¤ÎÆ°ºî¤Ë¤Ï¾¯¤Ê¤¯¤È¤â¥Ð¡¼¥¸¥ç¥ó ',$minVersion,' ¤¬É¬ÍפȤµ¤ì¤Þ¤¹</span>';
+       }
+?>
+
+                       </li>
+                       <li>MySQL:
+
+<?php
+       // note: this piece of code is taken from phpMyAdmin
+       $result = @mysql_query('SELECT VERSION() AS version');
+
+       if ($result != FALSE && @mysql_num_rows($result) > 0) {
+               $row = mysql_fetch_array($result);
+               $match = explode('.', $row['version']);
+       } else {
+               $result = @mysql_query('SHOW VARIABLES LIKE \'version\'');
+
+               if ($result != FALSE && @mysql_num_rows($result) > 0) {
+                       $row = mysql_fetch_row($result);
+                       $match = explode('.', $row[1]);
+               } else {
+                       $match[0] = '?';
+                       $match[1] = '?';
+                       $match[2] = '?';
+               }
+       }
+
+       if (!isset($match) || !isset($match[0]) ) {
+               $match[0] = 3;
+       }
+
+       if (!isset($match[1]) ) {
+               $match[1] = 21;
+       }
+
+       if (!isset($match[2]) ) {
+               $match[2] = 0;
+       }
+
+       if ($match[0] != '?') {
+               $match[0] = intval($match[0]);
+               $match[1] = intval($match[1]);
+       }
+
+       $mysqlVersion = implode($match, '.');
+       $minVersion = '3.23';
+
+       echo $mysqlVersion;
+
+       if ($mysqlVersion < $minVersion) {
+               echo ' <span class="warning">Ãí°Õ: Nucleus¤ÎÆ°ºî¤Ë¤Ï¾¯¤Ê¤¯¤È¤â¥Ð¡¼¥¸¥ç¥ó ',$minVersion,' ¤¬É¬ÍפȤµ¤ì¤Þ¤¹</span>';
+       }
+?>
+
+                       </li>
+               </ul>
+
+<?php
+       // tell people how they can have their config file filled out automatically
+       if (@file_exists('config.php') && @!is_writable('config.php') ) {
+?>
+
+               <h1><i>config.php</i>¤Î¼«Æ°¥¢¥Ã¥×¥Ç¡¼¥È</h1>
+
+               <p>¤â¤·<em>config.php</em>¤ò¼«Æ°Åª¤Ë¹¹¿·¤¹¤ë¤è¤¦¤Ë¤·¤¿¤¤¤Ê¤é¡¢½ñ¤­¹þ¤ß²Äǽ¤Ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£<em>config.php</em>¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò<strong>666</strong>¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£Nucleus¤Î¥¤¥ó¥¹¥È¡¼¥ëÀ®¸ù¸å¤Ë¡¢¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò<strong>444</strong>¤ËÌᤵ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡Ê<a href="nucleus/documentation/tips.html#filepermissions">¥Ñ¡¼¥ß¥Ã¥·¥ç¥óÊѹ¹¤Î´Ê°×¥¬¥¤¥É</a>¡Ë¡£</p>
+
+               <p>¤â¤·¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤Ê¤¤¤È¤¤¤¦ÁªÂò¤ò¤·¤¿¡Ê¤¢¤ë¤¤¤Ï¹Ô¤¨¤Ê¤¤¡Ë¾ì¹ç¡§¤´¿´Çۤʤ¯¡£¥¤¥ó¥¹¥È¡¼¥ë¤Î²áÄø¤Ç<em>config.php</em>¤ÎÃæ¿È¤¬Ä󶡤µ¤ì¤Þ¤¹¡£¤Ç¤¹¤«¤é¡¢¤½¤ì¤ò¤´¼«¿È¤Ç¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£</p>
+
+<?php } ?>
+
+               <h1>MySQL¤Î¥í¥°¥¤¥ó¥Ç¡¼¥¿</h1>
+
+               <p>MySQL¤Î¥Ç¡¼¥¿¤ò°Ê²¼¤ËÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£¤½¤ì¤é¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¡¦¥Æ¡¼¥Ö¥ë¤òºîÀ®¤·¾ðÊó¤òÆþÎϤ¹¤ë¤¿¤á¤ËɬÍפʤâ¤Î¤Ç¤¹¡£¸å¤Ç¡¢<i>config.php</i>¤Ë¤âµ­Æþ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡Ê¾åµ­¤Î¼«Æ°¥¢¥Ã¥×¥Ç¡¼¥È¤òÍøÍѤ¹¤ë¾ì¹ç¡¢¤½¤Î¼ê½ç¤Ï¾Êά¤µ¤ì¤Þ¤¹¡Ë¡£</p>
+
+               <p>¤â¤·¤³¤Î¾ðÊ󤬤狼¤é¤Ê¤±¤ì¤Ð¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô¤«¥Û¥¹¥Æ¥£¥ó¥°¸µ¤ËÏ¢Íí¤ò¤È¤Ã¤Æ¤¯¤À¤µ¤¤¡£¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢¥Û¥¹¥È̾¤Ï'localhost'¤Ç¤¹¡£¤â¤·Nucleus¤¬¤¢¤Ê¤¿¤Î¥µ¡¼¥Ð¤ÎPHPÀßÄ꤫¤é'default MySQL host'¤ò¸¡ÃΤ·¤¿¤Ê¤é¡¢'¥Û¥¹¥È̾'¤Ë´û¤Ëµ­Æþ¤µ¤ì¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¡£¤â¤Ã¤È¤â¡¢¤³¤Î¾ðÊó¤¬Àµ³Î¤Ç¤¢¤ë¤È¤¤¤¦ÊݾڤϤ¢¤ê¤Þ¤»¤ó¡£</p>
+
+               <fieldset>
+                       <legend>´ðËܤΥǡ¼¥¿¥Ù¡¼¥¹ÀßÄê</legend>
+                       <table>
+                               <tr>
+                                       <td>¥Û¥¹¥È̾¡§</td>
+                                       <td><input name="mySQL_host" value="<?php echo htmlspecialchars(@ini_get('mysql.default_host') )?>" /></td>
+                               </tr>
+                               <tr>
+                                       <td>¥æ¡¼¥¶¡¼Ì¾¡§</td>
+                                       <td><input name="mySQL_user" /></td>
+                               </tr>
+                               <tr>
+                                       <td>¥Ñ¥¹¥ï¡¼¥É¡§</td>
+                                       <td><input name="mySQL_password" type="password" /></td>
+                               </tr>
+                               <tr>
+                                       <td>¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¡§</td>
+                                       <td><input name="mySQL_database" /> (<input name="mySQL_create" value="1" type="checkbox" id="mySQL_create"><label for="mySQL_create" />¥Ç¡¼¥¿¥Ù¡¼¥¹¤òºîÀ®¤¹¤ëɬÍפ¬¤¢¤ë</label>)</td>
+                               </tr>
+                       </table>
+               </fieldset>
+
+               <fieldset>
+                       <legend>¹âÅù¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹ÀßÄê</legend>
+                       <table>
+                               <tr>
+                                       <td><input name="mySQL_usePrefix" value="1" type="checkbox" id="mySQL_usePrefix"><label for="mySQL_usePrefix" />¥Æ¡¼¥Ö¥ë¡¦¥×¥ê¥Õ¥£¥Ã¥¯¥¹¤òÍøÍÑ</label></td>
+                                       <td><input name="mySQL_tablePrefix" value="" /></td>
+                               </tr>
+                       </table>
+
+                       <p>°ì¤Ä¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÊ£¿ô¤ÎNucleus¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤ª¤ê¡¢¼«Ê¬¤¬²¿¤ò¤ä¤Ã¤Æ¤¤¤ë¤Î¤«Íý²ò¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤ò½ü¤¤¤Æ¤Ï¡¢<strong>¤³¤ì¤òÊѹ¹¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó</strong>¡£</p>
+                       <p>Nucleus¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤¿¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Æ¡¼¥Ö¥ë¤Ï¡¢¤³¤Î¥×¥ê¥Õ¥£¥Ã¥¯¥¹¤¬Æ¬¤Ë¤Ä¤­¤Þ¤¹¡£</p>
+               </fieldset>
+
+       <h1>¥Ç¥£¥ì¥¯¥È¥ê¤ÈURL</h1>
+
+       <p>¤³¤Î¥¤¥ó¥¹¥È¡¼¥ë¥¹¥¯¥ê¥×¥È¤ÏNucleus¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÈURL¤ò¸«¤Ä¤±¤è¤¦¤È¤·¤Þ¤·¤¿¡£²¼¤ÎÃͤò¥Á¥§¥Ã¥¯¤·¤ÆɬÍפʤéÄûÀµ¤·¤Æ¤¯¤À¤µ¤¤¡£¥Õ¥¡¥¤¥ë¤Ø¤Î¥Ñ¥¹¤ÈURL¤Ï¥¹¥é¥Ã¥·¥å'/'¤Ç½ª¤ï¤é¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£</p>
+
+<?php
+
+       // no need to this all! dirname(__FILE__) is all we need -- moraes
+       /*
+       // discover full path
+       $fullPath = serverVar('PATH_TRANSLATED');
+
+       if ($fullPath == '') {
+               $fullPath = serverVar('SCRIPT_FILENAME');
+       }
+
+       $basePath = str_replace('install.php', '', $fullPath);
+       $basePath = replaceDoubleBackslash($basePath);
+       $basePath = replaceDoubleBackslash($basePath);
+
+       // add slash at end if necessary
+       if (!endsWithSlash($basePath) ) {
+               $basePath .= '/';
+       }
+       */
+
+       $basePath = dirname(__FILE__) . '/';
+?>
+
+               <fieldset>
+                       <legend>URLs and directories</legend>
+                       <table>
+                               <tr>
+                                       <td>Site <strong>URL</strong>:</td>
+                                       <td><input name="IndexURL" size="60" value="<?php
+                                               $url = 'http://' . serverVar('HTTP_HOST') . serverVar('PHP_SELF');
+                                               $url = str_replace('install.php', '', $url);
+                                               $url = replaceDoubleBackslash($url);
+
+                                               // add slash at end if necessary
+                                               if (!endsWithSlash($url) ) {
+                                                       $url .= '/';
+                                               }
+
+                                               echo $url; ?>" /></td>
+                               </tr>
+                               <tr>
+                                       <td>Admin-area <strong>URL</strong>:</td>
+                                       <td><input name="AdminURL" size="60" value="<?php
+                                               if ($url) {
+                                                       echo $url, 'nucleus/';
+                                               } ?>" /></td>
+                               </tr>
+                               <tr>
+                                       <td>Admin-area <strong>path</strong>:</td>
+                                       <td><input name="AdminPath" size="60" value="<?php
+                                               if($basePath) {
+                                                       echo $basePath, 'nucleus/';
+                                               } ?>" /></td>
+                               </tr>
+                               <tr>
+                                       <td>Media files <strong>URL</strong>:</td>
+                                       <td><input name="MediaURL" size="60" value="<?php
+                                               if ($url) {
+                                                       echo $url, 'media/';
+                                               } ?>" /></td>
+                               </tr>
+                               <tr>
+                                       <td>Media directory <strong>path</strong>:</td>
+                                       <td><input name="MediaPath" size="60" value="<?php
+                                               if ($basePath) {
+                                                       echo $basePath, 'media/';
+                                               } ?>" /></td>
+                               </tr>
+                               <tr>
+                                       <td>Extra skin files <strong>URL</strong>:</td>
+                                       <td><input name="SkinsURL" size="60" value="<?php
+                                               if ($url) {
+                                                       echo $url, 'skins/';
+                                               } ?>" />
+                                               <br />(¥¤¥ó¥Ý¡¼¥È¤µ¤ì¤¿¥¹¥­¥ó¤¬»ÈÍÑ)
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td>Extra skin files directory <strong>path</strong>:</td>
+                                       <td><input name="SkinsPath" size="60" value="<?php
+                                               if ($basePath) {
+                                                       echo $basePath, 'skins/';
+                                               } ?>" />
+                                               <br />(¥¤¥ó¥Ý¡¼¥È¤µ¤ì¤¿¥¹¥­¥ó¤Î¥Õ¥¡¥¤¥ëÎà¤òÃÖ¤¯¾ì½ê)
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td>Plugin files <strong>URL</strong>:</td>
+                                       <td><input name="PluginURL" size="60" value="<?php
+                                               if ($url) {
+                                                       echo $url, 'nucleus/plugins/';
+                                               } ?>" /></td>
+                               </tr>
+                               <tr>
+                                       <td>Action <strong>URL</strong>:</td>
+                                       <td><input name="ActionURL" size="60" value="<?php
+                                               if ($url) {
+                                                       echo $url, 'action.php';
+                                               } ?>" />
+                                               <br />(<tt>action.php</tt>¤Ø¤Îhttp://¤«¤é»Ï¤Þ¤ëURL)
+                                       </td>
+                               </tr>
+                       </table>
+               </fieldset>
+
+               <p class="note"><strong>ÉÕµ­:</strong> ÁêÂХѥ¹¤Ç¤Ï¤Ê¤¯<strong>ÀäÂХѥ¹¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤</strong>¡£Ä̾ÀäÂХѥ¹¤Ï<tt>/home/username/public_html/</tt>¤Î¤è¤¦¤Ê·Á¤ò¤È¤ê¤Þ¤¹¡£Unix¥·¥¹¥Æ¥à¡Ê¤Û¤È¤ó¤É¤Î¥µ¡¼¥Ð¡¼¤¬¤½¤¦¤Ç¤¹¡Ë¤Ë¤ª¤¤¤Æ¡¢¥Ñ¥¹¤Ï¥¹¥é¥Ã¥·¥å¤«¤é»Ï¤Þ¤ê¤Þ¤¹¡£¤â¤·¤³¤ì¤é¤Î¾ðÊóÆþÎϤËÌäÂ꤬À¸¤¸¤¿¤é¡¢¤¢¤Ê¤¿¤Î¥µ¡¼¥Ð´ÉÍý¼Ô¤Ë¤¿¤º¤Í¤ë¤Ù¤­¤Ç¤¹¡£</p>
+
+               <h1>´ÉÍý¸¢¸Â¤ò¤â¤Ä¥æ¡¼¥¶¡¼</h1>
+
+               <p>°Ê²¼¤Ë¡¢¥µ¥¤¥È¤ÎºÇ½é¤Î¥æ¡¼¥¶¡¼¤òºîÀ®¤¹¤ë¤¿¤á¤Î¤¤¤¯¤Ä¤«¤Î¾ðÊó¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£</p>
+
+               <fieldset>
+                       <legend>´ÉÍý¸¢¸Â¤ò»ý¤Ä¥æ¡¼¥¶¡¼</legend>
+                       <table>
+                               <tr>
+                                       <td>ɽ¼¨¤µ¤ì¤ë̾Á°¡§</td>
+                                       <td><input name="User_name" value="" /> <small>(µö²Ä¤µ¤ì¤ëʸ»ú¡§a-z ¤È 0-9¡¢ºÇ½é¤ÈºÇ¸å°Ê³°¤Î¥¹¥Ú¡¼¥¹)</small></td>
+                               </tr>
+                               <tr>
+                                       <td>ËÜ̾¡Ê¥Ï¥ó¥É¥ë̾¡Ë¡§</td>
+                                       <td><input name="User_realname" value="" /></td>
+                               </tr>
+                               <tr>
+                                       <td>¥Ñ¥¹¥ï¡¼¥É¡§</td>
+                                       <td><input name="User_password" type="password" value="" /></td>
+                               </tr>
+                               <tr>
+                                       <td>¥Ñ¥¹¥ï¡¼¥É¤Î³Îǧ¡§</td>
+                                       <td><input name="User_password2" type="password" value="" /></td>
+                               </tr>
+                               <tr>
+                                       <td>¥á¡¼¥ë¥¢¥É¥ì¥¹¡§</td>
+                                       <td><input name="User_email" value="" /> <small>(ÍøÍѲÄǽ¤Ê¥á¡¼¥ë¥¢¥É¥ì¥¹¤òÆþ¤ì¤Æ¤¯¤À¤µ¤¤)</small></td>
+                               </tr>
+                       </table>
+               </fieldset>
+
+               <h1>¥¦¥§¥Ö¥í¥°¤Î¥Ç¡¼¥¿</h1>
+
+               <p>°Ê²¼¤Ë¡¢¥Ç¥Õ¥©¥ë¥È¤Îweblog¤òºîÀ®¤¹¤ë¤¿¤á¤Ë¤¤¤¯¤Ä¤«¤Î¾ðÊó¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£¤³¤Îweblog¤Î̾Á°¤Ï¡¢¥µ¥¤¥È̾¤È¤·¤Æ¤âÍøÍѤµ¤ì¤Þ¤¹¡£</p>
+
+               <fieldset>
+                       <legend>¥¦¥§¥Ö¥í¥°¤Î¥Ç¡¼¥¿</legend>
+                       <table>
+                               <tr>
+                                       <td>Blog̾¡§</td>
+                                       <td><input name="Blog_name" size="60" value="My Nucleus CMS" /></td>
+                               </tr>
+                               <tr>
+                                       <td>Blog¤Îû½Ì̾¡§</td>
+                                       <td><input name="Blog_shortname" value="mynucleuscms" /> <small>(µö²Ä¤µ¤ì¤ëʸ»ú¡§a-z ¤È 0-9¡¢¥¹¥Ú¡¼¥¹¤ÏÉÔ²Ä)</small></td>
+                               </tr>
+                       </table>
+               </fieldset>
+
+               <h1>¥Ç¡¼¥¿¤ÎÁ÷¿®</h1>
+
+               <p>¾å¤Ë½ñ¤¤¤Æ¤­¤¿¥Ç¡¼¥¿¤¬Àµ¤·¤¤¤«³Î¤«¤á¤Æ¤¯¤À¤µ¤¤¡£¤è¤±¤ì¤Ð¥Ç¡¼¥¿¥Ù¡¼¥¹¡¦¥Æ¡¼¥Ö¥ë¤ÈºÇ½é¤Î¥Ç¡¼¥¿¤òÀßÄꤹ¤ë¤¿¤á¤Ë²¼¤Î¥Ü¥¿¥ó¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£¾¯¤·»þ´Ö¤¬¤«¤«¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¤´¿ÉÊú¤ò¡£<b>¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤Î¤Ï°ì²ó¤À¤±¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£</b></p>
+
+               <p><input name="action" value="go" type="hidden" /> <input type="submit" value="Nucleus CMS¤Î¥¤¥ó¥¹¥È¡¼¥ë" onclick="return checkSubmit();" /></p>
+
+               </form>
+       </body>
+</html>
+
+<?php }
+
+function tableName($unPrefixed) {
+       global $mysql_usePrefix, $mysql_prefix;
+
+       if ($mysql_usePrefix == 1) {
+               return $mysql_prefix . $unPrefixed;
+       } else {
+               return $unPrefixed;
+       }
+}
+
+function doInstall() {
+       global $mysql_usePrefix, $mysql_prefix;
+
+       // 0. put all POST-vars into vars
+       $mysql_host = postVar('mySQL_host');
+       $mysql_user = postVar('mySQL_user');
+       $mysql_password = postVar('mySQL_password');
+       $mysql_database = postVar('mySQL_database');
+       $mysql_create = postVar('mySQL_create');
+       $mysql_usePrefix = postVar('mySQL_usePrefix');
+       $mysql_prefix = postVar('mySQL_tablePrefix');
+       $config_indexurl = postVar('IndexURL');
+       $config_adminurl = postVar('AdminURL');
+       $config_adminpath = postVar('AdminPath');
+       $config_mediaurl = postVar('MediaURL');
+       $config_skinsurl = postVar('SkinsURL');
+       $config_pluginurl = postVar('PluginURL');
+       $config_actionurl = postVar('ActionURL');
+       $config_mediapath = postVar('MediaPath');
+       $config_skinspath = postVar('SkinsPath');
+       $user_name = postVar('User_name');
+       $user_realname = postVar('User_realname');
+       $user_password = postVar('User_password');
+       $user_password2 = postVar('User_password2');
+       $user_email = postVar('User_email');
+       $blog_name = postVar('Blog_name');
+       $blog_shortname = postVar('Blog_shortname');
+       $config_adminemail = $user_email;
+       $config_sitename = $blog_name;
+
+       $config_indexurl = replaceDoubleBackslash($config_indexurl);
+       $config_adminurl = replaceDoubleBackslash($config_adminurl);
+       $config_mediaurl = replaceDoubleBackslash($config_mediaurl);
+       $config_skinsurl = replaceDoubleBackslash($config_skinsurl);
+       $config_pluginurl = replaceDoubleBackslash($config_pluginurl);
+       $config_actionurl = replaceDoubleBackslash($config_actionurl);
+       $config_adminpath = replaceDoubleBackslash($config_adminpath);
+       $config_skinspath = replaceDoubleBackslash($config_skinspath);
+
+       // 1. check all the data
+       $errors = array();
+
+       if (!$mysql_database) {
+               array_push($errors, 'mySQL database name missing');
+       }
+
+       if (($mysql_usePrefix == 1) && (strlen($mysql_prefix) == 0) ) {
+               array_push($errors, 'mySQL prefix was selected, but prefix is empty');
+       }
+
+       if (($mysql_usePrefix == 1) && (!eregi('^[a-zA-Z0-9_]+$', $mysql_prefix) ) ) {
+               array_push($errors, 'mySQL prefix should only contain characters from the ranges A-Z, a-z, 0-9 or underscores');
+       }
+
+       // TODO: add action.php check
+       if (!endsWithSlash($config_indexurl) || !endsWithSlash($config_adminurl) || !endsWithSlash($config_mediaurl) || !endsWithSlash($config_pluginurl) || !endsWithSlash($config_skinsurl) ) {
+               array_push($errors, 'One of the URLs does not end with a slash, or action url does not end with \'action.php\'');
+       }
+
+       if (!endsWithSlash($config_adminpath) ) {
+               array_push($errors, 'The path of the administration area does not end with a slash');
+       }
+
+       if (!endsWithSlash($config_mediapath) ) {
+               array_push($errors, 'The media path does not end with a slash');
+       }
+
+       if (!endsWithSlash($config_skinspath) ) {
+               array_push($errors, 'The skins path does not end with a slash');
+       }
+
+       if (!is_dir($config_adminpath) ) {
+               array_push($errors, 'The path of the administration area does not exist on your server');
+       }
+
+       if (!_isValidMailAddress($user_email) ) {
+               array_push($errors, 'Invalid e-mail address given for user');
+       }
+
+       if (!_isValidDisplayName($user_name) ) {
+               array_push($errors, 'User name is not a valid display name (allowed chars: a-zA-Z0-9 and spaces)');
+       }
+
+       if (!$user_password || !$user_password2) {
+               array_push($errors, 'User password is empty');
+       }
+
+       if ($user_password != $user_password2) {
+               array_push($errors, 'User password do not match');
+       }
+
+       if (!_isValidShortName($blog_shortname) ) {
+               array_push($errors, 'Invalid short name given for blog (allowed chars: a-z0-9, no spaces)');
+       }
+
+       if (sizeof($errors) > 0) {
+               showErrorMessages($errors);
+       }
+
+       // 2. try to log in to mySQL
+       global $MYSQL_CONN;
+       $MYSQL_CONN = @mysql_connect($mysql_host, $mysql_user, $mysql_password);
+
+       if ($MYSQL_CONN == 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',
+
+       $count = count($queries);
+
+       for ($idx = 0; $idx < $count; $idx++) {
+               $query = trim($queries[$idx]);
+               // echo "QUERY = <small>" . htmlspecialchars($query) . "</small><p>";
+
+               if ($query) {
+
+                       if ($mysql_usePrefix == 1) {
+                                       $query = str_replace($aTableNames, $aTableNamesPrefixed, $query);
+                       }
+
+                       mysql_query($query) or _doError('Error while executing query (<small>' . htmlspecialchars($query) . '</small>): ' . 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\n";
+               //$config_data .= "\n"; (extraneous, just added extra \n to previous line
+               $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;
+               }
+       }
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />
+       <title>Nucleus¤Î¥¤¥ó¥¹¥È¡¼¥ë</title>
+       <style>@import url('nucleus/styles/manual.css');</style>
+</head>
+<body>
+       <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->
+
+<?php
+       $aAllErrors = array_merge($aSkinErrors, $aPlugErrors);
+
+       if (count($aAllErrors) > 0) {
+               echo '<h1>Skin/Plugin Install errors</h1>';
+               echo '<ul><li>' . implode('</li><li>', $aAllErrors) . '</li></ul>';
+       }
+
+       if (!$bConfigWritten) { ?>
+               <h1>¥¤¥ó¥¹¥È¡¼¥ë¤Ï¤Û¤Ü´°Î»¤·¤Þ¤·¤¿¡ª</h1>
+
+               <p>¥Ç¡¼¥¿¥Ù¡¼¥¹¥Æ¡¼¥Ö¥ë¤Î½é´üÃÍÆþÎϤ¬À®¸ù¤·¤Þ¤·¤¿¡£¸å¤Ï<i>config.php</i>¤ò½ñ¤­´¹¤¨¤ë¤À¤±¤Ç¤¹¡£°Ê²¼¤Ë½ñ¤­´¹¤¨¤ë¤Ù¤­ÆâÍƤòɽ¼¨¤·¤Þ¤¹¡Êmysql¤Î¥Ñ¥¹¥ï¡¼¥É¤Ï¥Þ¥¹¥¯¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤³¤Ï¼ÂºÝ¤Î¤â¤Î¤Ë½ñ¤­´¹¤¨¤Æ¤¯¤À¤µ¤¤¡Ë</p>
+
+               <pre><code>&lt;?php
+       // mySQL connection information
+       $MYSQL_HOST = '<b><?php echo $mysql_host?></b>';
+       $MYSQL_USER = '<b><?php echo $mysql_user?></b>';
+       $MYSQL_PASSWORD = '<i><b>xxxxxxxxxxx</b></i>';
+       $MYSQL_DATABASE = '<b><?php echo $mysql_database?></b>';
+       $MYSQL_PREFIX = '<b><?php echo ($mysql_usePrefix == 1)?$mysql_prefix:''?></b>';
+
+       // main nucleus directory
+       $DIR_NUCLEUS = '<b><?php echo $config_adminpath?></b>';
+
+       // path to media dir
+       $DIR_MEDIA = '<b><?php echo $config_mediapath?></b>';
+
+       // extra skin files for imported skins
+       $DIR_SKINS = '<b><?php echo $config_skinspath?></b>';
+
+       // 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');
+       }
+?&gt;</code></pre>
+
+       <p>¤¢¤Ê¤¿¤Î¥³¥ó¥Ô¥å¡¼¥¿¾å¤Î¥Õ¥¡¥¤¥ë¤ò½ñ¤­´¹¤¨¤¿¤é¡¢FTP¤ò»È¤Ã¤Æ¥¦¥§¥Ö¥µ¡¼¥Ð¤Ë¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£ASCII¥â¡¼¥É¤ÇÁ÷¿®¤·¤Æ¥Õ¥¡¥¤¥ë¤ò¾å½ñ¤­¤·¤Þ¤¹¡£</p>
+
+       <div class="note">
+               <b>ÉÕµ­:</b> <i>config.php</i>¤ÎºÇ½é¤ä½ª¤ï¤ê¤Ë¥¹¥Ú¡¼¥¹¤ò¶õ¤±¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤·¤ç¤¦¡£¼Â¹Ô»þ¤Ë¥¨¥é¡¼¤ò°ú¤­µ¯¤³¤¹¸¶°ø¤È¤Ê¤ê¤Þ¤¹¡£<br />
+               ¤·¤¿¤¬¤Ã¤Æ¡¢config.php¤ÎºÇ½é¤Îʸ»ú¤Ï "&lt;"¤ÇºÇ¸å¤Îʸ»ú¤Ï"&gt;"¤È¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
+       </div>
+
+<?php } else { ?>
+
+       <h1>¥¤¥ó¥¹¥È¡¼¥ë¤Ï´°Î»¤·¤Þ¤·¤¿¡ª</h1>
+
+       <p>Nucleus¤Ï¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¡¢<code>config.php</code>¤Ï¥¢¥Ã¥×¥Ç¡¼¥È¤µ¤ì¤Þ¤·¤¿¡£</p>
+
+       <p>¥»¥­¥å¥ê¥Æ¥£¤Î¤¿¤á<code>config.php</code>¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò444¤ËÌ᤹¤³¤È¤ò˺¤ì¤Ê¤¤¤Ç¤¯¤À¤µ¤¤(<a href="nucleus/documentation/tips.html#filepermissions">¥Ñ¡¼¥ß¥Ã¥·¥ç¥óÊѹ¹¤Î´Ê°×¥¬¥¤¥É</a>)¡£</p>
+
+<?php } ?>
+
+       <h1>¥¤¥ó¥¹¥È¡¼¥ë¥Õ¥¡¥¤¥ë¤Îºï½ü</h1>
+
+       <p>¥¦¥§¥Ö¥µ¡¼¥Ð¤«¤é¼¡¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤¡§</p>
+
+       <ul>
+               <li><b>install.sql</b>¡§¥Æ¡¼¥Ö¥ë¤Î¹½Â¤¤òÆâÊñ¤¹¤ë¥Õ¥¡¥¤¥ë</li>
+               <li><b>install.php</b>¡§¤³¤Î¥Õ¥¡¥¤¥ë</li>
+       </ul>
+
+       <p>¤â¤·¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢´ÉÍýÎΰè¤ò³«¤¯¤³¤È¤¬½ÐÍè¤Þ¤»¤ó¡£</p>
+
+       <h1>¥¦¥§¥Ö¥µ¥¤¥È¤Î³Îǧ</h1>
+
+       <p>¥¦¥§¥Ö¥µ¥¤¥È¤ò»È¤¦½àÈ÷¤¬À°¤¤¤Þ¤·¤¿¡£
+               <ul>
+                       <li><a href="<?php echo $config_adminurl?>">´ÉÍýÎΰè¤Ë¥í¥°¥¤¥ó¤·¤Æ¥µ¥¤¥È¤ÎÀßÄê¤ò¹Ô¤¦</a></li>
+                       <li><a href="<?php echo $config_indexurl?>">¤¹¤°¤Ë¥µ¥¤¥È¤Ø¹Ô¤Ã¤Æ¤ß¤ë</a></li>
+               </ul>
+       </p>
+
+</body>
+</html>
+
+<?php
+}
+
+function installCustomPlugs(&$manager) {
+       global $aConfPlugsToInstall, $DIR_LIBS;
+
+       $aErrors = array();
+
+       if (count($aConfPlugsToInstall) == 0) {
+               return $aErrors;
+       }
+
+       $res = sql_query('SELECT * FROM ' . sql_table('plugin') );
+       $numCurrent = mysql_num_rows($res);
+
+       foreach ($aConfPlugsToInstall as $plugName) {
+               // do this before calling getPlugin (in case the plugin id is used there)
+               $query = 'INSERT INTO ' . sql_table('plugin') . ' (porder, pfile) VALUES (' . (++$numCurrent) . ', "' . addslashes($plugName) . '")';
+               sql_query($query);
+
+               // get and install the plugin
+               $plugin =& $manager->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();
+       $files = array(
+               'install.sql',
+               'index.php',
+               'action.php',
+               'nucleus/index.php',
+               'nucleus/libs/globalfunctions.php',
+               'nucleus/libs/ADMIN.php',
+               'nucleus/libs/BLOG.php',
+               'nucleus/libs/COMMENT.php',
+               'nucleus/libs/COMMENTS.php',
+               'nucleus/libs/ITEM.php',
+               'nucleus/libs/MEMBER.php',
+               'nucleus/libs/SKIN.php',
+               'nucleus/libs/TEMPLATE.php',
+               'nucleus/libs/MEDIA.php',
+               'nucleus/libs/ACTIONLOG.php',
+               'nucleus/media.php'
+               );
+
+       $count = count($files);
+
+       for ($i = 0; $i < $count; $i++) {
+               if (!is_readable($files[$i]) ) {
+                       array_push($missingfiles, 'File <b>' . $files[$i] . '</b> is missing or not readable.');
+               }
+       }
+
+// The above code replaces several if statements of the form:
+
+//     if (!is_readable('install.sql') ) {
+//             array_push($missingfiles, 'File <b>install.sql</b> is missing or not readable');
+//     }
+
+       if (count($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 replaceDoubleBackslash($input) {
+       return str_replace('\\', '/', $input);
+}
+
+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) {
+       ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+       <title>Nucleus Install</title>
+       <style>@import url('nucleus/styles/manual.css');</style>
+</head>
+<body>
+       <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->
+       <h1>Error!</h1>
+
+       <p>Error message was: "<?php echo $msg?>";</p>
+
+       <p><a href="install.php" onclick="history.back();return false;">Go Back</a></p>
+</body>
+</html>
+
+<?php
+       exit;
+}
+
+function showErrorMessages($errors) {
+       ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+       <title>Nucleus Install</title>
+       <style>@import url('nucleus/styles/manual.css');</style>
+</head>
+<body>
+       <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->
+       <h1>Errors!</h1>
+
+       <p>Errors were found:</p>
+
+       <ul>
+
+<?php
+       while($msg = array_shift($errors) ) {
+               echo '<li>', $msg, '</li>';
+       }
+?>
+
+       </ul>
+
+       <p><a href="install.php" onclick="history.back();return false;">Go Back</a></p>
+</body>
+</html>
+
+<?php
+       exit;
+}
+
+/* for the non-php systems that decide to show the contents:
+?></div><?php  */
+
+?>
index 6606992..b8457ba 100755 (executable)
 CREATE TABLE `nucleus_actionlog` (
-
   `timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
-
   `message` varchar(255) NOT NULL default ''
-
 ) TYPE=MyISAM;
 
-
-
 CREATE TABLE `nucleus_activation` (
-
   `vkey` varchar(40) NOT NULL default '',
-
   `vtime` datetime NOT NULL default '0000-00-00 00:00:00',
-
   `vmember` int(11) NOT NULL default '0',
-
   `vtype` varchar(15) NOT NULL default '',
-
   `vextra` varchar(128) NOT NULL default '',
-
   PRIMARY KEY  (`vkey`)
-
 ) TYPE=MyISAM;
 
-
-
 CREATE TABLE `nucleus_ban` (
-
   `iprange` varchar(15) NOT NULL default '',
-
   `reason` varchar(255) NOT NULL default '',
-
   `blogid` int(11) NOT NULL default '0'
-
 ) TYPE=MyISAM;
 
-
-
 CREATE TABLE `nucleus_blog` (
-
   `bnumber` int(11) NOT NULL auto_increment,
-
   `bname` varchar(60) NOT NULL default '',
-
   `bshortname` varchar(15) NOT NULL default '',
-
   `bdesc` varchar(200) default NULL,
-
   `bcomments` tinyint(2) NOT NULL default '1',
-
   `bmaxcomments` int(11) NOT NULL default '0',
-
   `btimeoffset` decimal(3,1) NOT NULL default '0.0',
-
   `bnotify` varchar(60) default NULL,
-
   `burl` varchar(100) default NULL,
-
   `bupdate` varchar(60) default NULL,
-
   `bdefskin` int(11) NOT NULL default '1',
-
   `bpublic` tinyint(2) NOT NULL default '1',
-
   `bsendping` tinyint(2) NOT NULL default '0',
-
   `bconvertbreaks` tinyint(2) NOT NULL default '1',
-
   `bdefcat` int(11) default NULL,
-
   `bnotifytype` int(11) NOT NULL default '15',
-
   `ballowpast` tinyint(2) NOT NULL default '0',
-
   `bincludesearch` tinyint(2) NOT NULL default '0',
-
+  `breqemail` TINYINT( 2 ) DEFAULT '0' NOT NULL,
   PRIMARY KEY  (`bnumber`),
-
   UNIQUE KEY `bnumber` (`bnumber`),
-
   UNIQUE KEY `bshortname` (`bshortname`)
-
 ) TYPE=MyISAM;
 
-
-
-INSERT INTO `nucleus_blog` VALUES (1, 'My Nucleus CMS', 'mynucleuscms', '', 1, 0, 0.0, '', 'http://localhost:8080/nucleus/', '', 5, 1, 0, 1, 1, 1, 1, 0);
-
-
+INSERT INTO `nucleus_blog` VALUES (1, 'My Nucleus CMS', 'mynucleuscms', '', 1, 0, 0.0, '', 'http://localhost:8080/nucleus/', '', 5, 1, 0, 1, 1, 1, 1, 0, 0);
 
 CREATE TABLE `nucleus_category` (
-
   `catid` int(11) NOT NULL auto_increment,
-
   `cblog` int(11) NOT NULL default '0',
-
   `cname` varchar(200) default NULL,
-
   `cdesc` varchar(200) default NULL,
-
   PRIMARY KEY  (`catid`)
-
 ) TYPE=MyISAM;
 
-
-
 INSERT INTO `nucleus_category` VALUES (1, 1, 'General', 'Items that do not fit in other categories');
 
-
-
 CREATE TABLE `nucleus_comment` (
-
   `cnumber` int(11) NOT NULL auto_increment,
-
   `cbody` text NOT NULL,
-
   `cuser` varchar(40) default NULL,
-
   `cmail` varchar(100) default NULL,
-
+  `cemail` VARCHAR( 100 ),
   `cmember` int(11) default NULL,
-
   `citem` int(11) NOT NULL default '0',
-
   `ctime` datetime NOT NULL default '0000-00-00 00:00:00',
-
   `chost` varchar(60) default NULL,
-
   `cip` varchar(15) NOT NULL default '',
-
   `cblog` int(11) NOT NULL default '0',
-
   PRIMARY KEY  (`cnumber`),
-
   UNIQUE KEY `cnumber` (`cnumber`),
-
   KEY `citem` (`citem`),
-
   FULLTEXT KEY `cbody` (`cbody`)
-
 ) TYPE=MyISAM;
 
-
-
 CREATE TABLE `nucleus_config` (
-
   `name` varchar(20) NOT NULL default '',
-
   `value` varchar(128) default NULL,
-
   PRIMARY KEY  (`name`)
-
 ) TYPE=MyISAM;
 
-
-
 INSERT INTO `nucleus_config` VALUES ('DefaultBlog', '1');
-
 INSERT INTO `nucleus_config` VALUES ('AdminEmail', 'example@example.org');
-
 INSERT INTO `nucleus_config` VALUES ('IndexURL', 'http://localhost:8080/nucleus/');
-
 INSERT INTO `nucleus_config` VALUES ('Language', 'japanese-euc');
-
 INSERT INTO `nucleus_config` VALUES ('SessionCookie', '');
-
 INSERT INTO `nucleus_config` VALUES ('AllowMemberCreate', '');
-
 INSERT INTO `nucleus_config` VALUES ('AllowMemberMail', '1');
-
 INSERT INTO `nucleus_config` VALUES ('SiteName', 'My Nucleus CMS');
-
 INSERT INTO `nucleus_config` VALUES ('AdminURL', 'http://localhost:8080/nucleus/nucleus/');
-
 INSERT INTO `nucleus_config` VALUES ('NewMemberCanLogon', '1');
-
 INSERT INTO `nucleus_config` VALUES ('DisableSite', '');
-
 INSERT INTO `nucleus_config` VALUES ('DisableSiteURL', 'http://www.this-page-intentionally-left-blank.org/');
-
 INSERT INTO `nucleus_config` VALUES ('LastVisit', '');
-
 INSERT INTO `nucleus_config` VALUES ('MediaURL', 'http://localhost:8080/nucleus/media/');
-
 INSERT INTO `nucleus_config` VALUES ('AllowedTypes', 'jpg,jpeg,gif,mpg,mpeg,avi,mov,mp3,swf,png');
-
 INSERT INTO `nucleus_config` VALUES ('AllowLoginEdit', '');
-
 INSERT INTO `nucleus_config` VALUES ('AllowUpload', '1');
-
 INSERT INTO `nucleus_config` VALUES ('DisableJsTools', '2');
-
 INSERT INTO `nucleus_config` VALUES ('CookiePath', '/');
-
 INSERT INTO `nucleus_config` VALUES ('CookieDomain', '');
-
 INSERT INTO `nucleus_config` VALUES ('CookieSecure', '');
-
 INSERT INTO `nucleus_config` VALUES ('CookiePrefix', '');
-
 INSERT INTO `nucleus_config` VALUES ('MediaPrefix', '1');
-
 INSERT INTO `nucleus_config` VALUES ('MaxUploadSize', '1048576');
-
 INSERT INTO `nucleus_config` VALUES ('NonmemberMail', '');
-
 INSERT INTO `nucleus_config` VALUES ('PluginURL', 'http://localhost:8080/nucleus/nucleus/plugins/');
-
 INSERT INTO `nucleus_config` VALUES ('ProtectMemNames', '1');
-
 INSERT INTO `nucleus_config` VALUES ('BaseSkin', '5');
-
 INSERT INTO `nucleus_config` VALUES ('SkinsURL', 'http://localhost:8080/nucleus/skins/');
-
 INSERT INTO `nucleus_config` VALUES ('ActionURL', 'http://localhost:8080/nucleus/action.php');
-
 INSERT INTO `nucleus_config` VALUES ('URLMode', 'normal');
-
-INSERT INTO `nucleus_config` VALUES ('DatabaseVersion', '310');
-
-
+INSERT INTO `nucleus_config` VALUES ('DatabaseVersion', '330');
 
 CREATE TABLE `nucleus_item` (
-
   `inumber` int(11) NOT NULL auto_increment,
-
   `ititle` varchar(160) default NULL,
-
   `ibody` text NOT NULL,
-
   `imore` text,
-
   `iblog` int(11) NOT NULL default '0',
-
   `iauthor` int(11) NOT NULL default '0',
-
   `itime` datetime NOT NULL default '0000-00-00 00:00:00',
-
   `iclosed` tinyint(2) NOT NULL default '0',
-
   `idraft` tinyint(2) NOT NULL default '0',
-
   `ikarmapos` int(11) NOT NULL default '0',
-
   `icat` int(11) default NULL,
-
   `ikarmaneg` int(11) NOT NULL default '0',
-
   PRIMARY KEY  (`inumber`),
-
   UNIQUE KEY `inumber` (`inumber`),
-
   KEY `itime` (`itime`),
-
   FULLTEXT KEY `ibody` (`ibody`,`ititle`,`imore`)
-
 ) TYPE=MyISAM PACK_KEYS=0;
 
-
-
-INSERT INTO `nucleus_item` VALUES (1, 'Nucleus CMS ¥Ð¡¼¥¸¥ç¥ó3.2¤Ø¤è¤¦¤³¤½', '¥¦¥§¥Ö¥Ú¡¼¥¸¤ÎºîÀ®¤òÊä½õ¤¹¤ëÀѤßÌÚ¤¬¤³¤³¤Ë¤¢¤ê¤Þ¤¹¡£¤½¤ì¤Ï¿´Ìö¤ëblog¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¤·¡¢´Ñ¤ë¤â¤Î¤òϤޤ»¤ë²È²¤Î¥Ú¡¼¥¸¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¤·¡¢¼Â¤ê¿¤­¼ñÌ£¤Î¥µ¥¤¥È¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£¤¢¤ë¤¤¤Ï¸½ºß¤Î¤¢¤Ê¤¿¤Ë¤ÏÁÛÁü¤¬¤Ä¤«¤Ê¤¤¤â¤Î¤Ë¤Ê¤ë¤³¤È¤À¤Ã¤Æ¤¢¤ë¤Ç¤·¤ç¤¦¡£<br />\r\n<br />\r\nÍÑÅÓ¤¬»×¤¤¤Ä¤­¤Þ¤»¤ó¤Ç¤·¤¿¤«¡©¡¡¤½¤ì¤Ê¤é¤³¤³¤ØÍè¤ÆÀµ²ò¤Ç¤¹¡¢¤Ê¤¼¤Ê¤é¤¢¤Ê¤¿Æ±Íͻ䤿¤Á¤Ë¤â¤ï¤«¤é¤Ê¤¤¤Î¤Ç¤¹¤«¤é¡£', '<b>Read Me</b><br />\r\n<br />\r\n¤³¤ì¤Ï¥µ¥¤¥È¤Ë¤ª¤±¤ëºÇ½é¤Î¥¨¥ó¥È¥ê¡¼¤Ç¤¹¡£¥¹¥¿¡¼¥È¤òÀÚ¤ê¤ä¤¹¤¤¤è¤¦¤Ë¡¢¥ê¥ó¥¯¤È¾ðÊó¤òÆþ¤ì¤Æ¤ª¤­¤Þ¤·¤¿¡£<br />\r\n<br />\r\n¤³¤Îµ­»ö¤òºï½ü¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¤¬¡¢¤É¤Á¤é¤Ë¤»¤èµ­»ö¤òÄɲ䷤Ƥ¤¤¯¤³¤È¤Ë¤è¤Ã¤Æ¤ä¤¬¤Æ¥á¥¤¥ó¥Ú¡¼¥¸¤«¤é¤Ï¸«¤¨¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£Nucleus¤ò°·¤¦¤¦¤Á¤ËÀ¸¤¸¤¿¥á¥â¤ò¥³¥á¥ó¥È¤È¤·¤ÆÄɲä·¡¢¾­Í襢¥¯¥»¥¹¤Ç¤­¤ë¤è¤¦¤Ë¤³¤Î¥Ú¡¼¥¸¤ò¥Ö¥Ã¥¯¥Þ¡¼¥¯¤·¤Æ¤ª¤¯¤Î¤â¼ê¤Ç¤¹¡£<br />\r\n<br />\r\n<b>¥ê¥ó¥¯</b><br />\r\n<br />\r\nNucleus CMS¤Î<a href="http://nucleuscms.org">ËܲÈ</a>¤È<a href="http://japan.nucleuscms.org">ÆüËܸì¸ø¼°</a>¥Ú¡¼¥¸¡£<br />\r\n<br />\r\nNucleus CMS¤ÎSourceForge<a href="http://sourceforge.net/projects/nucleuscms/">¥×¥í¥¸¥§¥¯¥È</a>¥Ú¡¼¥¸¡£<br />\r\n<br />\r\nNucleus CMS¤Î¥×¥é¥°¥¤¥ó<a href="http://wakka.xiffy.nl/Plugin/">ÁÒ¸Ë</a>¤È<a href="http://japan.nucleuscms.org/wakka/CategorizedPlugin">ÆüËܸì¤Î¥ê¥¹¥È</a>¥Ú¡¼¥¸¡£<br />\r\n<br />\r\n<b>¥É¥­¥å¥á¥ó¥È - <a href="http://docs.nucleuscms.org/">docs.nucleuscms.org</a></b><br />\r\n<br />\r\nNucleus¤Î<a href="http://japan.nucleuscms.org/faq.php">FAQ¡Ê¤è¤¯¤¢¤ë¼ÁÌ佸¡Ë</a>¡Ê<a href="http://nucleuscms.org/faq.php">¸¶Ê¸</a>¡Ë¥Ú¡¼¥¸¡£<br />\r\n<br />\r\n¥¤¥ó¥¹¥È¡¼¥ëÊýË¡Åù¤Ï<a href="nucleus/documentation/">¥æ¡¼¥¶¡¼¸þ¤±</a>¤È<a href="nucleus/documentation/devdocs/">³«È¯¼Ô¸þ¤±</a>ʸ½ñ¤¬¥Õ¥¡¥¤¥ë¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£<br />\r\n<br />\r\n¥Ý¥Ã¥×¥¢¥Ã¥×<a href="./nucleus/documentation/help.html">¥Ø¥ë¥×</a>¤¬´ÉÍý¥¨¥ê¥¢¤Î¤¤¤¿¤ë¤È¤³¤í¤Ë¤¢¤ê¡¢¥µ¥¤¥È¤Î¥«¥¹¥¿¥Þ¥¤¥º¤ä¥Ç¥¶¥¤¥ó¤ò¼ê½õ¤±¤·¤Æ¤¯¤ì¤ë¤³¤È¤Ç¤·¤ç¤¦¡£<br />\r\n<br />\r\n°ìÅÙÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¥É¥­¥å¥á¥ó¥È¤ËÌܤòÄ̤·¤¿¤é¡¢<a href="http://wiki.nucleuscms.org/">Wiki</a>¡Ê<a href="http://japan.nucleuscms.org/wakka/Nucleus">ÆüËÜÈÇ</a>¡Ë¤òˬ¤ì¤Æ¤¯¤À¤µ¤¤¡£¥æ¡¼¥¶¡¼¤Î½ñ¤¤¤¿¥Ï¥¦¥Ä¡¼¤ä¾®µ»¤¬·ÇºÜ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£<br />\r\n<br />\r\n<b>¥µ¥Ý¡¼¥È</b><br />\r\n<br />\r\n<a href="http://forum.nucleuscms.org/">forum.nucleuscms.org</a>¡ÊËܲȡË<br />\r\n<a href="http://japan.nucleuscms.org/bb/">japan.nucleuscms.org/bb/</a>¡ÊÆüËÜÈÇ¡Ë<br />\r\n<br />\r\n<a href="http://forum.nucleuscms.org/groupcp.php?g=3">moderators</a>¤È¥µ¥Ý¡¼¥È¥Õ¥©¡¼¥é¥à¤Ç³èÆ°¤¹¤ëÁ´¤Æ¤Î¥Ü¥é¥ó¥Æ¥£¥¢¤Ë´¶¼Õ¤·¤Þ¤¹¡£<br />\r\n<br />\r\n- <a href="http://edmondhui.homeip.net/blog/">admun</a> - Ottawa, ON, Canada                <br />\r\n- <a href="http://www.tamizhan.com/">anand</a> - Bangalore, India<br />\r\n- <a href="http://hcgtv.com">hcgtv</a> - Miami, Florida, USA<br />\r\n- <a href="http://www.adrenalinsports.nl/">ikeizer</a> - Maastricht<br />\r\n- <a href="http://www.tipos.com.br/">moraes</a> - Brazil<br />\r\n- <a href="http://roelg.nl/">roel </a>- The Netherlands<br />\r\n- <a href="http://budts.be/weblog/">TeRanEX </a>- Ekeren, Antwerp, Belgium<br />\r\n- <a href="http://www.trentadams.com/">Trent </a>- Alberta, Canada<br />\r\n- <a href="http://xiffy.nl/weblog/">xiffy </a>- Deventer<br />\r\n<br />\r\n¤â¤·¼ê½õ¤±¤¬É¬Íפʤ顢1400¤òĶ¤¨¤ëÅÐÏ¿¥æ¡¼¥¶¡¼¤Î¤¤¤ë»ä¤¿¤Á¤Î¥Õ¥©¡¼¥é¥à¤Ë»²²Ã¤·¤Æ¤¯¤À¤µ¤¤¡£23,000¤òĶ¤¨¤ëÅê¹Æ¤µ¤ì¤¿µ­»ö¤ò¸¡º÷¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤ª¤ê¤Þ¤¹¤Î¤Ç¡¢µá¤á¤ëÅú¤¨¤Ë¿ô²ó¤Î¥¯¥ê¥Ã¥¯¤Ç¤¿¤É¤êÃ失¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£<br />\r\n<br />\r\n<b>Personalization - <a href="http://skins.nucleuscms.org/">skins.nucleuscms.org</a></b><br />\r\n<br />\r\n¥Þ¥ë¥Á¥¦¥§¥Ö¥í¥°¤È¥¹¥­¥ó/¥Æ¥ó¥×¥ì¡¼¥È¤ÎÁȤ߹ç¤ï¤»¤Ï¶¯ÎϤÊÁê¾è¸ú²Ì¤òÀ¸¤ß½Ð¤·¤Þ¤¹¡£¸Ä¿ÍŪ¤Ê¥µ¥¤¥ÈºîÀ®¡¢Í§¿Í¤ä¿ÆÀ̤¢¤ë¤¤¤Ï¥¯¥é¥¤¥¢¥ó¥È¤ËÂФ¹¤ë¥µ¥¤¥È¥Ç¥¶¥¤¥ó¤¤¤º¤ì¤ËÂФ·¤Æ¤â¤Ç¤¹¡£<br />\r\n<br />\r\n636¤ÎÅÐÏ¿¤µ¤ì¤¿<a href="http://nucleuscms.org/sites.php">Nucleus¤Ç±¿ÍѤµ¤ì¤Æ¤¤¤ë¥µ¥¤¥È</a>¡Ê<a href="http://japan.nucleuscms.org/sites.php">ÆüËÜÈÇ</a>¡Ë¤ÎÃ椫¤éÆÿ§¤¢¤ë¥µ¥¤¥È¤ò¥µ¥ó¥×¥ë¤È¤·¤Æ¤´¾Ò²ð¤·¤Þ¤¹¡£<br />\r\n<br />\r\nThe Zen of Nucleus<br />\r\n- <a href="http://beefcake.nl/">beefcake.nl</a> - Beefcake | Nuke the whales!<br />\r\n- <a href="http://www.leng-lui.com//">leng-lui.com</a> - Leng-Lui.com - v7.0: "Memento"<br />\r\n<br />\r\nPersonal blogs<br />\r\n- <a href="http://bloggard.com/">bloggard.com</a> - The Adventures of Bloggard<br />\r\n- <a href="http://battleangel.org/">battleangel.org</a> - Giving meaning to the meaningless<br />\r\n- <a href="http://www.yetanotherblog.de/">yetanotherblog.de</a> - Yet Another Blog<br />\r\n<br />\r\nMulti user blogs<br />\r\n- <a href="http://tipos.com.br/">tipos.com.br</a> - Blogging community<br />\r\n<br />\r\nHobby, Travel and News sites<br />\r\n- <a href="http://adrenalinsports.nl/">adrenalinsports.nl</a> - Extreme sports<br />\r\n- <a href="http://hsbluebird.com/">hsbluebird.com</a> - Hot Springs, Montana''s Online Resource <br />\r\n- <a href="http://groningen-info.de/">groningen-info.de</a> - Neues aus Groningen. Fr Leute aus Duitsland.<br />\r\n- <a href="http://www.americandaily.com/">americandaily.com</a> - American Daily - Home<br />\r\n<br />\r\n<b>Nucleus Developer Network - <a href="http://dev.nucleuscms.org/">dev.nucleuscms.org</a></b><br />\r\n<br />\r\nThe NUDN is a hub for developer sites and programming resources.<br />\r\n<br />\r\nNUDN satellite sites, handles, location and UTC offset:<br />\r\n- <a href="http://karma.nucleuscms.org/">karma</a> - Izegem +02<br />\r\n- <a href="http://hcgtv.net/">hcgtv</a> - Miami -05<br />\r\n- <a href="http://edmondhui.homeip.net/blog/nudn.php">admun</a> - Ottawa -04<br />\r\n- <a href="http://dev.budts.be/nucleus/">TeRanEX</a> - Ekeren +02<br />\r\n<br />\r\nSourceforge.net graciously hosts our <a href="http://sourceforge.net/projects/nucleuscms/">CVS repository</a>.<br />\r\n<br />\r\nWant to play around or test changes, visit our demo site at <a href="http://demo.nucleuscms.org/">demo.nucleuscms.org</a>.<br />\r\n<br />\r\nNot sure what plugins to use, visit the <a href="http://showcase.trentadams.com/">showcase site</a> where you can see plugins at play in their native habitat.<br />\r\n<br />\r\nThen visit the plugin repository at <a href="http://plugins.nucleuscms.org/">plugins.nucleuscms.org</a> for download and installation instructions.<br />\r\n<br />\r\n<b>´óÉÕ¼Ô°ìÍ÷</b><br />\r\n<br />\r\n°Ê²¼¤Î<a href="http://nucleuscms.org/donators.php">ÁÇÀ²¤é¤·¤¤¿Í¡¹</a>¤Ë¤è¤ë<a href="http://nucleuscms.org/donate.php">±ç½õ</a>´¶¼Õ¤òÊû¤²¤Þ¤¹¡£<em>¤¢¤ê¤¬¤È¤¦¡ª</em><br />\r\n<br />\r\n- <a href="http://reddustrec.net/">dkex</a><br />\r\n- <a href="http://www.uncoverthenet.com/">Uncover the Net</a><br />\r\n- <a href="http://www.webatlas.org/">Web Atlas</a><br />\r\n- <a href="http://www.ipnlighting.com/">IPN Lighting</a><br />\r\n- <a href="http://blog.datoka.jp/">Yu (blog.datoka.jp)</a><br />\r\n- <a href="http://www.thegadgetreview.com/">Sony Gadgets and Reviews</a><br />\r\n- <a href="http://sites.proliphus.com/blueZhift/blog/">Thomas McKibben</a><br />\r\n- <a href="http://cheapweb.us/">CheapWeb.us</a><br />\r\n- Robert Seyfriedsberger<br />\r\n- <a href="http://www.toxicologie.nl/">Toxicologie.nl</a><br />\r\n- Gordon Shum<br />\r\n- <a href="http://www.subsim.com/">Neal Stevens</a><br />\r\n- <a href="http://www.GamblingHelper.com/">GamblingHelper</a><br />\r\n- Oliver Kirstein<br />\r\n- <a href="http://www.dominiek.be/">Dominiek</a><br />\r\n- <a href="http://www.aardschok.net/">Aardschok</a><br />\r\n- <a href="http://www.nieuwevoordeur.be/">nieuwevoordeur.be</a><br />\r\n- <a href="http://www.scene24.net/">Scene24</a><br />\r\n- <a href="http://www.eug.be/">Eug''s Weblog</a><br />\r\n- <a href="http://www.bloggard.com/">The Adventures of Bloggard</a><br />\r\n- <a href="http://www.voltos.com/">Arthur Cronos from Voltos</a><br />\r\n- <a href="http://www.webmaster-toolkit.com/">Free Webmaster Tools and Resources</a><br />\r\n- <a href="http://www.domilog.be/">Domi''s Weblog</a><br />\r\n- Infodoma                <br />\r\n- <a href="http://carvingcode.com/">carvingCode.com</a><br />\r\n- <a href="http://www.traweb.com/">Traweb</a><br />\r\n- <a href="http://gene.mm2u.com/">Gene''s MoBlog</a><br />\r\n- <a href="http://interfacethis.com/">InterfaceThis</a><br />\r\n- <a href="http://www.thefinsters.com/flog/">The Finster Log</a><br />\r\n- <a href="http://www.mrhop.com/">Hop Nguyen</a><br />\r\n- <a href="http://www.zwavel.com/~zwavelaars" title="Zwavelaars">Zwavelaars</a><br />\r\n- <a href="http://beefcake.nl/">Joaquin Scholten</a>      <br />\r\n- <a href="http://www.roelgroeneveld.com/">Roel Groeneveld</a><br />\r\n- <a href="http://lvb.net/">LVBlog</a><br />\r\n- <a href="http://xandermol.com/">Xander Mol</a><br />\r\n- Danilo Massa<br />\r\n- <a href="http://01FTP.com/">01FTP.com</a><br />\r\n- <a href="http://www.adrenalinsports.nl/">Irmo Keizer</a><br />\r\n- <a href="http://www.jasonkrogh.com/">Jason Krogh</a><br />\r\n- <a href="http://www.higuchi.com/">Osamu Higuchi</a><br />\r\n- <a href="http://www.trentadams.com/">Trent Adams</a><br />\r\n- <a href="http://www.ppcw.net/">Arne Hess</a><br />\r\n- <a href="http://hsbluebird.com/">The Bluebird</a><br />\r\n- Rainer Bickel<br />\r\n- Fritz Elfers<br />\r\n- <a href="http://www.european-wall-tapestries.com/">European Wall Tapestries</a><br />\r\n- <a href="http://www.jamier.net/">Jamie R. Rytlewski</a><br />\r\n- Madolyn Piper<br />\r\n- <a href="http://www.batteryvalues.com/">Battery Values</a><br />\r\n- <a href="http://www.mixburnrip.de/">Janko Roettgers</a><br />\r\n- Lukas Loesche<br />\r\n- <a href="http://www.seobook.com/">SEO Book</a><br />\r\n- <a href="http://www.brandweerdematen.nl/">Brandweer de Maten</a><br />\r\n- Andy Fuchs<br />\r\n- <a href="http://www.sumoforce.com/">Sumoforce</a><br />\r\n- <a href="http://love.silverindigo.com/">Al''ky''mie</a><br />\r\n- <a href="http://www.pejo.us/">Peter Johnson</a><br />\r\n- <a href="http://www.triv.nl/">TriV Internet Solutions</a><br />\r\n- <a href="http://www.torontomusicians.org/nucleus/">Margaret Stowe</a><br />\r\n- <a href="http://www.zenkey.org/">zenkey dot org</a><br />\r\n- <a href="http://www.golb.org/">Blots of Info</a><br />\r\n- <a href="http://www.zonderpartij.be/">Rudi De Kerpel</a><br />\r\n- <a href="http://staylorx.com/">Steve Taylor</a><br />\r\n- <a href="http://lmhcave.com/">Malcolm Farnsworth</a><br />\r\n- Birgit Kellner<br />\r\n- <a href="http://www.tobiasly.com/">Toby Johnson</a><br />\r\n- <a href="http://www.kapingamarangi.be/">Kapingamarangi</a><br />\r\n- <a href="http://www.pallalink.net/">Pallalink</a><br />\r\n- <a href="http://publiustx.net/">PubliusTX Weblog</a><br />\r\n- <a href="http://www.reductioadabsurdum.net/">Reductio Ad Absurdum</a><br />\r\n- <a href="http://www.gagaweb.org/">GagaWeb</a><br />\r\n- <a href="http://www.videokid.be/">Videokid</a><br />\r\n- Jon Marr<br />\r\n- <a href="http://www.docblog.org/">Luigi Cristiano</a><br />\r\n- J Keith Lehman<br />\r\n- Bohemian Cachet<br />\r\n- Jesus Mourazos<br />\r\n- <a href="http://ltp-design.com/">Stephen Jones</a><br />\r\n- <a href="http://oha.nu/">One-Handed Apps</a><br />\r\n- Alwin Hawkins<br />\r\n- <a href="http://jstigall.bloomington.in.us">Justin Stigall</a><br />\r\n- <a href="http://www.itismylife.com/">It is my life</a><br />\r\n- Greg Morrill<br />\r\n- <a href="http://www.dutchsubmarines.com/">Dutch Submarines</a><br />\r\n- <a href="http://www.7thwatch.com/">Seventh Watch Design Studios</a>                <br />\r\n- <a href="http://www.macnet2.com/">MacNetv2</a>      <br />\r\n- Richard Noordhof<br />\r\n- <a href="http://www.jamier.net/">Jamie Rytlewski</a><br />\r\n<br />\r\nNucleus¤¬µ¤¤ËÆþ¤ê¤Þ¤·¤¿¤«¡©¡¡<a href="http://www.hotscripts.com/Detailed/13368.html?RID=nucleus@demuynck.org">HotScripts</a>¤ä<a href="http://www.opensourcecms.com/index.php?option=content&task=view&id=145">opensourceCMS</a>¤Ç¤ÎÅêɼ¤ò¤ª´ê¤¤¤·¤Þ¤¹¡£<br />\r\n<br />\r\n<b>¥é¥¤¥»¥ó¥¹</b><br />\r\n<br />\r\n»ä¤¿¤Á¤¬¥Õ¥ê¡¼¡¦¥½¥Õ¥È¥¦¥§¥¢¤Ë¤Ä¤¤¤Æ¸ý¤Ë¤¹¤ë¾ì¹ç¤Ï¼«Í³¤Î¤³¤È¤Ë¸ÀµÚ¤·¤Æ¤¤¤ë¤Î¤Ç¤¢¤Ã¤Æ¡¢²Á³Ê¤Î¤³¤È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£»ä¤¿¤Á¤Î<a href="http://www.gnu.org/licenses/gpl.html">°ìÈ̸øÍ­»ÈÍѵöÂú½ñ</a>¡Ê<a href="http://www.gnu.org/licenses/gpl.ja.html">ÆüËܸìÌõ</a>¤È<a href="http://www.atmarkit.co.jp/aig/03linux/gpl.html">³µÍ×</a>¡Ë¤Ï¡¢¥Õ¥ê¡¼¡¦¥½¥Õ¥È¥¦¥§¥¢¤ÎÊ£À½Êª¤ò¼«Í³¤ËÈÒÉۤǤ­¤ë¤³¤È(¤½¤·¤Æ¡¢Ë¾¤à¤Ê¤é¤³¤Î¥µ¡¼¥Ó¥¹¤ËÂФ·¤ÆÂвÁ¤òÀÁµá¤Ç¤­¤ë¤³¤È)¡¢¥½¡¼¥¹¡¦¥³¡¼¥É¤ò¼ÂºÝ¤Ë¼õ¤±¼è¤ë¤«´õ˾¤·¤µ¤¨¤¹¤ì¤ÐÆþ¼ê¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¤³¤È¡¢Æþ¼ê¤·¤¿¥½¥Õ¥È¥¦¥§¥¢¤òÊѹ¹¤·¤¿¤ê¿·¤·¤¤¥Õ¥ê¡¼¡¦¥×¥í¥°¥é¥à¤Î°ìÉô¤È¤·¤Æ»ÈÍѤǤ­¤ë¤³¤È¡¢°Ê¾å¤Î³ÆÆâÍƤò¹Ô¤Ê¤¦¤³¤È¤¬¤Ç¤­¤ë¤È¤¤¤¦¤³¤È¤ò¥æ¡¼¥¶¼«¿È¤¬ÃΤäƤ¤¤ë¤³¤È¤ò¼Â¸½¤Ç¤­¤ë¤è¤¦¤Ë¥Ç¥¶¥¤¥ó¤µ¤ì¤Æ¤¤¤Þ¤¹¡£', 1, 1, '2005-02-16 22:57:54', 0, 0, 0, 1, 0);
-
-
+INSERT INTO `nucleus_item` VALUES (1, 'Nucleus CMS ¥Ð¡¼¥¸¥ç¥ó3.3¤Ø¤è¤¦¤³¤½',
+'¥¦¥§¥Ö¥Ú¡¼¥¸¤ÎºîÀ®¤òÊä½õ¤¹¤ëÀѤßÌÚ¤¬¤³¤³¤Ë¤¢¤ê¤Þ¤¹¡£¤½¤ì¤Ï¿´Ìö¤ëblog¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¤·¡¢´Ñ¤ë¤â¤Î¤òϤޤ»¤ë²È²¤Î¥Ú¡¼¥¸¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¤·¡¢¼Â¤ê¿¤­¼ñÌ£¤Î¥µ¥¤¥È¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£¤¢¤ë¤¤¤Ï¸½ºß¤Î¤¢¤Ê¤¿¤Ë¤ÏÁÛÁü¤¬¤Ä¤«¤Ê¤¤¤â¤Î¤Ë¤Ê¤ë¤³¤È¤À¤Ã¤Æ¤¢¤ë¤Ç¤·¤ç¤¦¡£<br />\r\n<br />\r\nÍÑÅÓ¤¬»×¤¤¤Ä¤­¤Þ¤»¤ó¤Ç¤·¤¿¤«¡©¡¡¤½¤ì¤Ê¤é¤³¤³¤ØÍè¤ÆÀµ²ò¤Ç¤¹¡£¤Ê¤¼¤Ê¤é¤¢¤Ê¤¿Æ±Íͻ䤿¤Á¤Ë¤â¤ï¤«¤é¤Ê¤¤¤Î¤Ç¤¹¤«¤é¡£',
+'¤³¤ì¤Ï¥µ¥¤¥È¤Ë¤ª¤±¤ëºÇ½é¤Î¥¨¥ó¥È¥ê¡¼¤Ç¤¹¡£¥¹¥¿¡¼¥È¤òÀÚ¤ê¤ä¤¹¤¤¤è¤¦¤Ë¡¢¥ê¥ó¥¯¤È¾ðÊó¤òÆþ¤ì¤Æ¤ª¤­¤Þ¤·¤¿¡£<br />\r\n<br />\r\n¤³¤Îµ­»ö¤òºï½ü¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¤¬¡¢¤É¤Á¤é¤Ë¤»¤èµ­»ö¤òÄɲ䷤Ƥ¤¤¯¤³¤È¤Ë¤è¤Ã¤Æ¤ä¤¬¤Æ¥á¥¤¥ó¥Ú¡¼¥¸¤«¤é¤Ï¸«¤¨¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£Nucleus¤ò°·¤¦¤¦¤Á¤ËÀ¸¤¸¤¿¥á¥â¤ò¥³¥á¥ó¥È¤È¤·¤ÆÄɲä·¡¢¾­Í襢¥¯¥»¥¹¤Ç¤­¤ë¤è¤¦¤Ë¤³¤Î¥Ú¡¼¥¸¤ò¥Ö¥Ã¥¯¥Þ¡¼¥¯¤·¤Æ¤ª¤¯¤Î¤â¼ê¤Ç¤¹¡£<br />\r\n<br />\r\n<b>¥ê¥ó¥¯</b><br />\r\n<br />\r\nNucleus CMS¤Î<a href="http://nucleuscms.org">ËܲÈ</a>¤È<a href="http://japan.nucleuscms.org">ÆüËܸì¸ø¼°</a>¥Ú¡¼¥¸¡£<br />\r\n<br />\r\nNucleus CMS¤ÎSourceForge<a href="http://sourceforge.net/projects/nucleuscms/">¥×¥í¥¸¥§¥¯¥È</a>¥Ú¡¼¥¸¡£<br />\r\n<br />\r\nNucleus CMS¤Î¥×¥é¥°¥¤¥ó<a href="http://wakka.xiffy.nl/Plugin/">ÁÒ¸Ë</a>¤È<a href="http://japan.nucleuscms.org/wakka/CategorizedPlugin">ÆüËܸì¤Î¥ê¥¹¥È</a>¥Ú¡¼¥¸¡£<br />\r\n<br />\r\n<b>¥É¥­¥å¥á¥ó¥È - <a href="http://docs.nucleuscms.org/">docs.nucleuscms.org</a></b><br />\r\n<br />\r\nNucleus¤Î<a href="http://japan.nucleuscms.org/faq.php">FAQ¡Ê¤è¤¯¤¢¤ë¼ÁÌ佸¡Ë</a>¡Ê<a href="http://nucleuscms.org/faq.php">¸¶Ê¸</a>¡Ë¥Ú¡¼¥¸¡£<br />\r\n<br />\r\n¥¤¥ó¥¹¥È¡¼¥ëÊýË¡Åù¤Ï<a href="nucleus/documentation/">¥æ¡¼¥¶¡¼¸þ¤±</a>¤È<a href="nucleus/documentation/devdocs/">³«È¯¼Ô¸þ¤±</a>ʸ½ñ¤¬¥Õ¥¡¥¤¥ë¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£<br />\r\n<br />\r\n¥Ý¥Ã¥×¥¢¥Ã¥×<a href="./nucleus/documentation/help.html">¥Ø¥ë¥×</a>¤¬´ÉÍý¥¨¥ê¥¢¤Î¤¤¤¿¤ë¤È¤³¤í¤Ë¤¢¤ê¡¢¥µ¥¤¥È¤Î¥«¥¹¥¿¥Þ¥¤¥º¤ä¥Ç¥¶¥¤¥ó¤ò¼ê½õ¤±¤·¤Æ¤¯¤ì¤ë¤³¤È¤Ç¤·¤ç¤¦¡£<br />\r\n<br />\r\n°ìÅÙÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¥É¥­¥å¥á¥ó¥È¤ËÌܤòÄ̤·¤¿¤é¡¢<a href="http://wiki.nucleuscms.org/">Wiki</a>¡Ê<a href="http://japan.nucleuscms.org/wakka/Nucleus">ÆüËÜÈÇ</a>¡Ë¤òˬ¤ì¤Æ¤¯¤À¤µ¤¤¡£¥æ¡¼¥¶¡¼¤Î½ñ¤¤¤¿¥Ï¥¦¥Ä¡¼¤ä¾®µ»¤¬·ÇºÜ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£<br />\r\n<br />\r\n<b>¥µ¥Ý¡¼¥È</b><br />\r\n<br />\r\n<a href="http://forum.nucleuscms.org/">forum.nucleuscms.org</a>¡ÊËܲȡË<br />\r\n<a href="http://japan.nucleuscms.org/bb/">japan.nucleuscms.org/bb/</a>¡ÊÆüËÜÈÇ¡Ë<br />\r\n<br />\r\n<a href="http://forum.nucleuscms.org/groupcp.php?g=3">moderators</a>¤È¥µ¥Ý¡¼¥È¥Õ¥©¡¼¥é¥à¤Ç³èÆ°¤¹¤ëÁ´¤Æ¤Î¥Ü¥é¥ó¥Æ¥£¥¢¤Ë´¶¼Õ¤·¤Þ¤¹¡£<br />\r\n<br />\r\n- <a href="http://edmondhui.homeip.net/blog/">admun</a> - Ottawa, ON, Canada                 <br />\r\n- <a href="http://www.tamizhan.com/">anand</a> - Bangalore, India<br />\r\n- <a href="http://hcgtv.com">hcgtv</a> - Miami, Florida, USA<br />\r\n- <a href="http://www.adrenalinsports.nl/">ikeizer</a> - Maastricht<br />\r\n- <a href="http://www.tipos.com.br/">moraes</a> - Brazil<br />\r\n- <a href="http://roelg.nl/">roel </a>- The Netherlands<br />\r\n- <a href="http://budts.be/weblog/">TeRanEX </a>- Ekeren, Antwerp, Belgium<br />\r\n- <a href="http://www.trentadams.com/">Trent </a>- Alberta, Canada<br />\r\n- <a href="http://xiffy.nl/weblog/">xiffy </a>- Deventer<br />\r\n<br />\r\n¤â¤·¼ê½õ¤±¤¬É¬Íפʤ顢1400¤òĶ¤¨¤ëÅÐÏ¿¥æ¡¼¥¶¡¼¤Î¤¤¤ë»ä¤¿¤Á¤Î¥Õ¥©¡¼¥é¥à¤Ë»²²Ã¤·¤Æ¤¯¤À¤µ¤¤¡£23,000¤òĶ¤¨¤ëÅê¹Æ¤µ¤ì¤¿µ­»ö¤ò¸¡º÷¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤ª¤ê¤Þ¤¹¤Î¤Ç¡¢µá¤á¤ëÅú¤¨¤Ë¿ô²ó¤Î¥¯¥ê¥Ã¥¯¤Ç¤¿¤É¤êÃ失¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£<br />\r\n<br />\r\n<b>Personalization - <a href="http://skins.nucleuscms.org/">skins.nucleuscms.org</a></b><br />\r\n<br />\r\n¥Þ¥ë¥Á¥¦¥§¥Ö¥í¥°¤È¥¹¥­¥ó/¥Æ¥ó¥×¥ì¡¼¥È¤ÎÁȤ߹ç¤ï¤»¤Ï¶¯ÎϤÊÁê¾è¸ú²Ì¤òÀ¸¤ß½Ð¤·¤Þ¤¹¡£¸Ä¿ÍŪ¤Ê¥µ¥¤¥ÈºîÀ®¡¢Í§¿Í¤ä¿ÆÀ̤¢¤ë¤¤¤Ï¥¯¥é¥¤¥¢¥ó¥È¤ËÂФ¹¤ë¥µ¥¤¥È¥Ç¥¶¥¤¥ó¤¤¤º¤ì¤ËÂФ·¤Æ¤â¤Ç¤¹¡£<br />\r\n<br />\r\n636¤ÎÅÐÏ¿¤µ¤ì¤¿<a href="http://nucleuscms.org/sites.php">Nucleus¤Ç±¿ÍѤµ¤ì¤Æ¤¤¤ë¥µ¥¤¥È</a>¡Ê<a href="http://japan.nucleuscms.org/sites.php">ÆüËÜÈÇ</a>¡Ë¤ÎÃ椫¤éÆÿ§¤¢¤ë¥µ¥¤¥È¤ò¥µ¥ó¥×¥ë¤È¤·¤Æ¤´¾Ò²ð¤·¤Þ¤¹¡£<br />\r\n<br />\r\nThe Zen of Nucleus<br />\r\n- <a href="http://beefcake.nl/">beefcake.nl</a> - Beefcake | Nuke the whales!<br />\r\n- <a href="http://www.leng-lui.com//">leng-lui.com</a> - Leng-Lui.com - v7.0: "Memento"<br />\r\n<br />\r\nPersonal blogs<br />\r\n- <a href="http://bloggard.com/">bloggard.com</a> - The Adventures of Bloggard<br />\r\n- <a href="http://battleangel.org/">battleangel.org</a> - Giving meaning to the meaningless<br />\r\n- <a href="http://www.yetanotherblog.de/">yetanotherblog.de</a> - Yet Another Blog<br />\r\n<br />\r\nMulti user blogs<br />\r\n- <a href="http://tipos.com.br/">tipos.com.br</a> - Blogging community<br />\r\n<br />\r\nHobby, Travel and News sites<br />\r\n- <a href="http://adrenalinsports.nl/">adrenalinsports.nl</a> - Extreme sports<br />\r\n- <a href="http://hsbluebird.com/">hsbluebird.com</a> - Hot Springs, Montana''s Online Resource <br />\r\n- <a href="http://groningen-info.de/">groningen-info.de</a> - Neues aus Groningen. Fr Leute aus Duitsland.<br />\r\n- <a href="http://www.americandaily.com/">americandaily.com</a> - American Daily - Home<br />\r\n<br />\r\n<b>Nucleus Developer Network - <a href="http://dev.nucleuscms.org/">dev.nucleuscms.org</a></b><br />\r\n<br />\r\nThe NUDN is a hub for developer sites and programming resources.<br />\r\n<br />\r\nNUDN satellite sites, handles, location and UTC offset:<br />\r\n- <a href="http://karma.nucleuscms.org/">karma</a> - Izegem +02<br />\r\n- <a href="http://hcgtv.net/">hcgtv</a> - Miami -05<br />\r\n- <a href="http://edmondhui.homeip.net/blog/nudn.php">admun</a> - Ottawa -04<br />\r\n- <a href="http://dev.budts.be/nucleus/">TeRanEX</a> - Ekeren +02<br />\r\n<br />\r\nSourceforge.net graciously hosts our <a href="http://sourceforge.net/projects/nucleuscms/">CVS repository</a>.<br />\r\n<br />\r\nWant to play around or test changes, visit our demo site at <a href="http://demo.nucleuscms.org/">demo.nucleuscms.org</a>.<br />\r\n<br />\r\nNot sure what plugins to use, visit the <a href="http://showcase.trentadams.com/">showcase site</a> where you can see plugins at play in their native habitat.<br />\r\n<br />\r\nThen visit the plugin repository at <a href="http://plugins.nucleuscms.org/">plugins.nucleuscms.org</a> for download and installation instructions.<br />\r\n<br />\r\n<b>´óÉÕ¼Ô°ìÍ÷</b><br />\r\n<br />\r\n°Ê²¼¤Î<a href="http://nucleuscms.org/donators.php">ÁÇÀ²¤é¤·¤¤¿Í¡¹</a>¤Ë¤è¤ë<a href="http://nucleuscms.org/donate.php">±ç½õ</a>´¶¼Õ¤òÊû¤²¤Þ¤¹¡£<em>¤¢¤ê¤¬¤È¤¦¡ª</em><br />\r\n<br />\r\n- <a href="http://reddustrec.net/">dkex</a><br />\r\n- <a href="http://www.uncoverthenet.com/">Uncover the Net</a><br />\r\n- <a href="http://www.webatlas.org/">Web Atlas</a><br />\r\n- <a href="http://www.ipnlighting.com/">IPN Lighting</a><br />\r\n- <a href="http://blog.datoka.jp/">Yu (blog.datoka.jp)</a><br />\r\n- <a href="http://www.thegadgetreview.com/">Sony Gadgets and Reviews</a><br />\r\n- <a href="http://sites.proliphus.com/blueZhift/blog/">Thomas McKibben</a><br />\r\n- <a href="http://cheapweb.us/">CheapWeb.us</a><br />\r\n- Robert Seyfriedsberger<br />\r\n- <a href="http://www.toxicologie.nl/">Toxicologie.nl</a><br />\r\n- Gordon Shum<br />\r\n- <a href="http://www.subsim.com/">Neal Stevens</a><br />\r\n- <a href="http://www.GamblingHelper.com/">GamblingHelper</a><br />\r\n- Oliver Kirstein<br />\r\n- <a href="http://www.dominiek.be/">Dominiek</a><br />\r\n- <a href="http://www.aardschok.net/">Aardschok</a><br />\r\n- <a href="http://www.nieuwevoordeur.be/">nieuwevoordeur.be</a><br />\r\n- <a href="http://www.scene24.net/">Scene24</a><br />\r\n- <a href="http://www.eug.be/">Eug''s Weblog</a><br />\r\n- <a href="http://www.bloggard.com/">The Adventures of Bloggard</a><br />\r\n- <a href="http://www.voltos.com/">Arthur Cronos from Voltos</a><br />\r\n- <a href="http://www.webmaster-toolkit.com/">Free Webmaster Tools and Resources</a><br />\r\n- <a href="http://www.domilog.be/">Domi''s Weblog</a><br />\r\n- Infodoma                <br />\r\n- <a href="http://carvingcode.com/">carvingCode.com</a><br />\r\n- <a href="http://www.traweb.com/">Traweb</a><br />\r\n- <a href="http://gene.mm2u.com/">Gene''s MoBlog</a><br />\r\n- <a href="http://interfacethis.com/">InterfaceThis</a><br />\r\n- <a href="http://www.thefinsters.com/flog/">The Finster Log</a><br />\r\n- <a href="http://www.mrhop.com/">Hop Nguyen</a><br />\r\n- <a href="http://www.zwavel.com/~zwavelaars" title="Zwavelaars">Zwavelaars</a><br />\r\n- <a href="http://beefcake.nl/">Joaquin Scholten</a>      <br />\r\n- <a href="http://www.roelgroeneveld.com/">Roel Groeneveld</a><br />\r\n- <a href="http://lvb.net/">LVBlog</a><br />\r\n- <a href="http://xandermol.com/">Xander Mol</a><br />\r\n- Danilo Massa<br />\r\n- <a href="http://01FTP.com/">01FTP.com</a><br />\r\n- <a href="http://www.adrenalinsports.nl/">Irmo Keizer</a><br />\r\n- <a href="http://www.jasonkrogh.com/">Jason Krogh</a><br />\r\n- <a href="http://www.higuchi.com/">Osamu Higuchi</a><br />\r\n- <a href="http://www.trentadams.com/">Trent Adams</a><br />\r\n- <a href="http://www.ppcw.net/">Arne Hess</a><br />\r\n- <a href="http://hsbluebird.com/">The Bluebird</a><br />\r\n- Rainer Bickel<br />\r\n- Fritz Elfers<br />\r\n- <a href="http://www.european-wall-tapestries.com/">European Wall Tapestries</a><br />\r\n- <a href="http://www.jamier.net/">Jamie R. Rytlewski</a><br />\r\n- Madolyn Piper<br />\r\n- <a href="http://www.batteryvalues.com/">Battery Values</a><br />\r\n- <a href="http://www.mixburnrip.de/">Janko Roettgers</a><br />\r\n- Lukas Loesche<br />\r\n- <a href="http://www.seobook.com/">SEO Book</a><br />\r\n- <a href="http://www.brandweerdematen.nl/">Brandweer de Maten</a><br />\r\n- Andy Fuchs<br />\r\n- <a href="http://www.sumoforce.com/">Sumoforce</a><br />\r\n- <a href="http://love.silverindigo.com/">Al''ky''mie</a><br />\r\n- <a href="http://www.pejo.us/">Peter Johnson</a><br />\r\n- <a href="http://www.triv.nl/">TriV Internet Solutions</a><br />\r\n- <a href="http://www.torontomusicians.org/nucleus/">Margaret Stowe</a><br />\r\n- <a href="http://www.zenkey.org/">zenkey dot org</a><br />\r\n- <a href="http://www.golb.org/">Blots of Info</a><br />\r\n- <a href="http://www.zonderpartij.be/">Rudi De Kerpel</a><br />\r\n- <a href="http://staylorx.com/">Steve Taylor</a><br />\r\n- <a href="http://lmhcave.com/">Malcolm Farnsworth</a><br />\r\n- Birgit Kellner<br />\r\n- <a href="http://www.tobiasly.com/">Toby Johnson</a><br />\r\n- <a href="http://www.kapingamarangi.be/">Kapingamarangi</a><br />\r\n- <a href="http://www.pallalink.net/">Pallalink</a><br />\r\n- <a href="http://publiustx.net/">PubliusTX Weblog</a><br />\r\n- <a href="http://www.reductioadabsurdum.net/">Reductio Ad Absurdum</a><br />\r\n- <a href="http://www.gagaweb.org/">GagaWeb</a><br />\r\n- <a href="http://www.videokid.be/">Videokid</a><br />\r\n- Jon Marr<br />\r\n- <a href="http://www.docblog.org/">Luigi Cristiano</a><br />\r\n- J Keith Lehman<br />\r\n- Bohemian Cachet<br />\r\n- Jesus Mourazos<br />\r\n- <a href="http://ltp-design.com/">Stephen Jones</a><br />\r\n- <a href="http://oha.nu/">One-Handed Apps</a><br />\r\n- Alwin Hawkins<br />\r\n- <a href="http://jstigall.bloomington.in.us">Justin Stigall</a><br />\r\n- <a href="http://www.itismylife.com/">It is my life</a><br />\r\n- Greg Morrill<br />\r\n- <a href="http://www.dutchsubmarines.com/">Dutch Submarines</a><br />\r\n- <a href="http://www.7thwatch.com/">Seventh Watch Design Studios</a>                <br />\r\n- <a href="http://www.macnet2.com/">MacNetv2</a>      <br />\r\n- Richard Noordhof<br />\r\n- <a href="http://www.jamier.net/">Jamie Rytlewski</a><br />\r\n<br />\r\nNucleus¤¬µ¤¤ËÆþ¤ê¤Þ¤·¤¿¤«¡©¡¡<a href="http://www.hotscripts.com/Detailed/13368.html?RID=nucleus@demuynck.org">HotScripts</a>¤ä<a href="http://www.opensourcecms.com/index.php?option=content&task=view&id=145">opensourceCMS</a>¤Ç¤ÎÅêɼ¤ò¤ª´ê¤¤¤·¤Þ¤¹¡£<br />\r\n<br />\r\n<b>¥é¥¤¥»¥ó¥¹</b><br />\r\n<br />\r\n»ä¤¿¤Á¤¬¥Õ¥ê¡¼¡¦¥½¥Õ¥È¥¦¥§¥¢¤Ë¤Ä¤¤¤Æ¸ý¤Ë¤¹¤ë¾ì¹ç¤Ï¼«Í³¤Î¤³¤È¤Ë¸ÀµÚ¤·¤Æ¤¤¤ë¤Î¤Ç¤¢¤Ã¤Æ¡¢²Á³Ê¤Î¤³¤È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£»ä¤¿¤Á¤Î<a href="http://www.gnu.org/licenses/gpl.html">°ìÈ̸øÍ­»ÈÍѵöÂú½ñ</a>¡Ê<a href="http://www.gnu.org/licenses/gpl.ja.html">ÆüËܸìÌõ</a>¤È<a href="http://www.atmarkit.co.jp/aig/03linux/gpl.html">³µÍ×</a>¡Ë¤Ï¡¢¥Õ¥ê¡¼¡¦¥½¥Õ¥È¥¦¥§¥¢¤ÎÊ£À½Êª¤ò¼«Í³¤ËÈÒÉۤǤ­¤ë¤³¤È(¤½¤·¤Æ¡¢Ë¾¤à¤Ê¤é¤³¤Î¥µ¡¼¥Ó¥¹¤ËÂФ·¤ÆÂвÁ¤òÀÁµá¤Ç¤­¤ë¤³¤È)¡¢¥½¡¼¥¹¡¦¥³¡¼¥É¤ò¼ÂºÝ¤Ë¼õ¤±¼è¤ë¤«´õ˾¤·¤µ¤¨¤¹¤ì¤ÐÆþ¼ê¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¤³¤È¡¢Æþ¼ê¤·¤¿¥½¥Õ¥È¥¦¥§¥¢¤òÊѹ¹¤·¤¿¤ê¿·¤·¤¤¥Õ¥ê¡¼¡¦¥×¥í¥°¥é¥à¤Î°ìÉô¤È¤·¤Æ»ÈÍѤǤ­¤ë¤³¤È¡¢°Ê¾å¤Î³ÆÆâÍƤò¹Ô¤Ê¤¦¤³¤È¤¬¤Ç¤­¤ë¤È¤¤¤¦¤³¤È¤ò¥æ¡¼¥¶¼«¿È¤¬ÃΤäƤ¤¤ë¤³¤È¤ò¼Â¸½¤Ç¤­¤ë¤è¤¦¤Ë¥Ç¥¶¥¤¥ó¤µ¤ì¤Æ¤¤¤Þ¤¹¡£', 1, 1, '2005-02-16 22:57:54', 0, 0, 0, 1, 0);
 
 CREATE TABLE `nucleus_karma` (
-
   `itemid` int(11) NOT NULL default '0',
-
   `ip` char(15) NOT NULL default ''
-
 ) TYPE=MyISAM;
 
-
-
 CREATE TABLE `nucleus_member` (
-
   `mnumber` int(11) NOT NULL auto_increment,
-
   `mname` varchar(16) NOT NULL default '',
-
   `mrealname` varchar(60) default NULL,
-
   `mpassword` varchar(40) NOT NULL default '',
-
   `memail` varchar(60) default NULL,
-
   `murl` varchar(100) default NULL,
-
   `mnotes` varchar(100) default NULL,
-
   `madmin` tinyint(2) NOT NULL default '0',
-
   `mcanlogin` tinyint(2) NOT NULL default '1',
-
   `mcookiekey` varchar(40) default NULL,
-
   `deflang` varchar(20) NOT NULL default '',
-
   PRIMARY KEY  (`mnumber`),
-
   UNIQUE KEY `mname` (`mname`),
-
   UNIQUE KEY `mnumber` (`mnumber`)
-
 ) TYPE=MyISAM;
 
-
-
-INSERT INTO `nucleus_member` VALUES (1, 'God', 'God', '714d82a0a84f9c6e3495fe2aa5618627', 'example@example.org', 'http://localhost:8080/nucleus/', '', 1, 1, '2b0b7cec42e697b5aae52461b2398e44', '');
-
-
+INSERT INTO `nucleus_member` VALUES (1, 'example', 'example', '1a79a4d60de6718e8e5b326e338ae533', 'example@example.org', 'http://localhost:8080/nucleus/', '', 1, 1, 'd767aefc60415859570d64c649257f19', '');
 
 CREATE TABLE `nucleus_plugin` (
-
   `pid` int(11) NOT NULL auto_increment,
-
   `pfile` varchar(40) NOT NULL default '',
-
   `porder` int(11) NOT NULL default '0',
-
   PRIMARY KEY  (`pid`),
-
   KEY `pid` (`pid`),
-
   KEY `porder` (`porder`)
-
 ) TYPE=MyISAM;
 
-
-
 CREATE TABLE `nucleus_plugin_event` (
-
   `pid` int(11) NOT NULL default '0',
-
   `event` varchar(40) default NULL,
-
   KEY `pid` (`pid`)
-
 ) TYPE=MyISAM;
 
-
-
 CREATE TABLE `nucleus_plugin_option` (
-
   `ovalue` text NOT NULL,
-
   `oid` int(11) NOT NULL auto_increment,
-
   `ocontextid` int(11) NOT NULL default '0',
-
   PRIMARY KEY  (`oid`,`ocontextid`)
-
 ) TYPE=MyISAM;
 
-
-
 CREATE TABLE `nucleus_plugin_option_desc` (
-
   `oid` int(11) NOT NULL auto_increment,
-
   `opid` int(11) NOT NULL default '0',
-
   `oname` varchar(20) NOT NULL default '',
-
   `ocontext` varchar(20) NOT NULL default '',
-
   `odesc` varchar(255) default NULL,
-
   `otype` varchar(20) default NULL,
-
   `odef` text,
-
   `oextra` text,
-
   PRIMARY KEY  (`opid`,`oname`,`ocontext`),
-
   UNIQUE KEY `oid` (`oid`)
-
 ) TYPE=MyISAM;
 
-
-
 CREATE TABLE `nucleus_skin` (
-
   `sdesc` int(11) NOT NULL default '0',
-
   `stype` varchar(20) NOT NULL default '',
-
   `scontent` text NOT NULL,
-
   PRIMARY KEY  (`sdesc`,`stype`)
-
 ) TYPE=MyISAM;
 
-
-
-INSERT INTO `nucleus_skin` VALUES (2, 'index', '<?xml version="1.0" encoding="UTF-8"?>\r\n<feed version="0.3" xmlns="http://purl.org/atom/ns#">\r\n    <title><%blogsetting(name)%></title>\r\n    <link rel="alternate" type="text/html" href="<%blogsetting(url)%>" />\r\n    <generator url="http://nucleuscms.org/"><%version%></generator>\r\n    <modified><%blog(feeds/atom/modified,1)%></modified>\r\n    <%blog(feeds/atom/entries,10)%>\r\n</feed>');
-
+INSERT INTO `nucleus_skin` VALUES (2, 'index', '<?xml version="1.0" encoding="UTF-8"?>\n\n<feed xml:lang="ja" xmlns="http://www.w3.org/2005/Atom\">\n    <title><%blogsetting(name)%></title>\n    <id><%blogsetting(url)%>:<%blogsetting(id)%></id>\n\n    <link rel="alternate" type="text/html" href="<%blogsetting(url)%>" />\n    <link rel="self" type="application/atom+xml" href="<%blogsetting(url)%><%self%>" />\n    <generator uri="http://nucleuscms.org/"><%version%></generator>\n    <updated><%blog(feeds/atom/modified,1)%></updated>\n\n    <%blog(feeds/atom/entries,10)%>\n</feed>');
 INSERT INTO `nucleus_skin` VALUES (4, 'index', '<?xml version="1.0"?>\r\n<rsd version="1.0">\r\n <service>\r\n  <engineName><%version%></engineName>\r\n  <engineLink>http://nucleuscms.org/</engineLink>\r\n  <homepageLink><%sitevar(url)%></homepageLink>\r\n  <apis>\r\n   <api name="MetaWeblog" preferred="true" apiLink="<%adminurl%>xmlrpc/server.php" blogID="<%blogsetting(id)%>">\r\n    <docs>http://nucleuscms.org/documentation/devdocs/xmlrpc.html</docs>\r\n   </api>\r\n   <api name="Blogger" preferred="false" apiLink="<%adminurl%>xmlrpc/server.php" blogID="<%blogsetting(id)%>">\r\n    <docs>http://nucleuscms.org/documentation/devdocs/xmlrpc.html</docs>\r\n   </api>\r\n  </apis>\r\n </service>\r\n</rsd>');
-
-INSERT INTO `nucleus_skin` VALUES (3, 'index', '<?xml version="1.0" encoding="UTF-8"?>\r\n<rss version="2.0">\r\n  <channel>\r\n    <title><%blogsetting(name)%></title>\r\n    <link><%blogsetting(url)%></link>\r\n    <description><%blogsetting(desc)%></description>\r\n    <!-- optional tags -->\r\n    <language>ja</language>           <!-- valid langugae goes here -->\r\n    <generator><%version%></generator>\r\n    <copyright>\8e©</copyright>             <!-- Copyright notice -->\r\n    <category>Weblog</category>\r\n    <docs>http://backend.userland.com/rss</docs>\r\n    <image>\r\n      <url><%blogsetting(url)%>/nucleus/nucleus2.gif</url>\r\n      <title><%blogsetting(name)%></title>\r\n      <link><%blogsetting(url)%></link>\r\n    </image>\r\n    <%blog(feeds/rss20,10)%>\r\n  </channel>\r\n</rss>');
-
-
+INSERT INTO `nucleus_skin` VALUES (3, 'index', '<?xml version="1.0" encoding="UTF-8"?>\r\n<rss version="2.0">\r\n  <channel>\r\n    <title><%blogsetting(name)%></title>\r\n    <link><%blogsetting(url)%></link>\r\n    <description><%blogsetting(desc)%></description>\r\n    <language>ja</language>\r\n    <generator><%version%></generator>\r\n    <copyright>&#169;</copyright>\r\n    <category>Weblog</category>\r\n    <docs>http://backend.userland.com/rss</docs>\r\n    <image>\r\n      <url><%adminurl%>nucleus2.gif</url>\r\n      <title><%blogsetting(name)%></title>\r\n      <link><%blogsetting(url)%></link>\r\n    </image>\r\n    <%blog(feeds/rss20,10)%>\r\n  </channel>\r\n</rss>');
 
 CREATE TABLE `nucleus_skin_desc` (
-
   `sdnumber` int(11) NOT NULL auto_increment,
-
   `sdname` varchar(20) NOT NULL default '',
-
   `sddesc` varchar(200) default NULL,
-
   `sdtype` varchar(40) NOT NULL default 'text/html',
-
   `sdincmode` varchar(10) NOT NULL default 'normal',
-
   `sdincpref` varchar(50) NOT NULL default '',
-
   PRIMARY KEY  (`sdnumber`),
-
   UNIQUE KEY `sdname` (`sdname`),
-
   UNIQUE KEY `sdnumber` (`sdnumber`)
-
 ) TYPE=MyISAM;
 
-
-
-INSERT INTO `nucleus_skin_desc` VALUES (2, 'feeds/atom', 'Atom 0.3 weblog syndication', 'application/atom+xml', 'normal', '');
-
+INSERT INTO `nucleus_skin_desc` VALUES (2, 'feeds/atom', 'Atom 1.0 weblog syndication', 'application/atom+xml', 'normal', '');
 INSERT INTO `nucleus_skin_desc` VALUES (3, 'feeds/rss20', 'RSS 2.0 syndication of weblogs', 'text/xml', 'normal', '');
-
 INSERT INTO `nucleus_skin_desc` VALUES (4, 'xml/rsd', 'RSD (Really Simple Discovery) information for weblog clients', 'text/xml', 'normal', '');
-
 INSERT INTO `nucleus_skin_desc` VALUES (5, 'default', 'Nucleus CMS default skin', 'text/html', 'skindir', 'default/');
 
-
-
 CREATE TABLE `nucleus_team` (
-
   `tmember` int(11) NOT NULL default '0',
-
   `tblog` int(11) NOT NULL default '0',
-
   `tadmin` tinyint(2) NOT NULL default '0',
-
   PRIMARY KEY  (`tmember`,`tblog`)
-
 ) TYPE=MyISAM;
 
-
-
 INSERT INTO `nucleus_team` VALUES (1, 1, 1);
 
-
-
 CREATE TABLE `nucleus_template` (
-
   `tdesc` int(11) NOT NULL default '0',
-
   `tpartname` varchar(20) NOT NULL default '',
-
   `tcontent` text NOT NULL,
-
   PRIMARY KEY  (`tdesc`,`tpartname`)
-
 ) TYPE=MyISAM;
 
-
-
-INSERT INTO `nucleus_template` VALUES (3, 'ITEM', '<item>\r\n <title><![CDATA[<%title%>]]></title>\r\n <link><%blogurl%>index.php?itemid=<%itemid%></link>\r\n<description><![CDATA[<%body%><%more%>]]></description>\r\n <category><%category%></category>\r\n<comments><%blogurl%>index.php?itemid=<%itemid%></comments>\r\n <pubDate><%date(rfc822)%></pubDate>\r\n</item>');
-
+INSERT INTO `nucleus_template` VALUES (3, 'ITEM', '<item>\r\n <title><%title(xml)%></title>\r\n <link><%blogurl%>?itemid=<%itemid%></link>\r\n<description><![CDATA[<%body%><%more%>]]></description>\r\n <category><%category%></category>\r\n<comments><%blogurl%>?itemid=<%itemid%></comments>\r\n <pubDate><%date(rfc822)%></pubDate>\r\n</item>');
 INSERT INTO `nucleus_template` VALUES (3, 'EDITLINK', '<a href="<%editlink%>" onclick="<%editpopupcode%>">edit</a>');
-
-INSERT INTO `nucleus_template` VALUES (4, 'ITEM', '<%date(utc)%>');
-
-INSERT INTO `nucleus_template` VALUES (5, 'ITEM', '<entry>\r\n <title type="text/html" mode="escaped"><![CDATA[<%title%>]]></title>\r\n <link rel="alternate" type="text/html" href="<%blogurl%>index.php?itemid=<%itemid%>" />\r\n <author>\r\n  <name><%author%></name>\r\n </author>\r\n <modified><%date(utc)%></modified>\r\n <issued><%date(iso8601)%></issued>\r\n <content type="text/html" mode="escaped"><![CDATA[<%body%><%more%>]]></content>\r\n <id><%blogurl%>:<%blogid%>:<%itemid%></id>\r\n</entry>');
-
 INSERT INTO `nucleus_template` VALUES (3, 'FORMAT_DATE', '%Y-%m-%d');
-
 INSERT INTO `nucleus_template` VALUES (3, 'FORMAT_TIME', '%H:%M:%S');
+INSERT INTO `nucleus_template` VALUES (4, 'ITEM', '<%date(utc)%>');
+INSERT INTO `nucleus_template` VALUES (5, 'ITEM', '<entry>\r\n <title type="text/html" mode="escaped"><![CDATA[<%title%>]]></title>\r\n <link rel="alternate" type="text/html" href="<%blogurl%>?itemid=<%itemid%>" />\r\n <author>\r\n  <name><%author%></name>\r\n </author>\r\n <modified><%date(utc)%></modified>\r\n <issued><%date(iso8601)%></issued>\r\n <content type="text/html" mode="escaped"><![CDATA[<%body%><%more%>]]></content>\r\n <id><%blogurl%>:<%blogid%>:<%itemid%></id>\r\n</entry>');
 
-
-
-
+INSERT INTO `nucleus_template` VALUES (5, 'POPUP_CODE', '<%media%>');
+INSERT INTO `nucleus_template` VALUES (5, 'IMAGE_CODE', '<%image%>');
+INSERT INTO `nucleus_template` VALUES (5, 'MEDIA_CODE', '<%media%>');
+INSERT INTO `nucleus_template` VALUES (3, 'POPUP_CODE', '<%image%>');
+INSERT INTO `nucleus_template` VALUES (3, 'MEDIA_CODE', '<%media%>');
+INSERT INTO `nucleus_template` VALUES (3, 'IMAGE_CODE', '<%media%>');
 
 CREATE TABLE `nucleus_template_desc` (
-
   `tdnumber` int(11) NOT NULL auto_increment,
-
   `tdname` varchar(20) NOT NULL default '',
-
   `tddesc` varchar(200) default NULL,
-
   PRIMARY KEY  (`tdnumber`),
-
   UNIQUE KEY `tdnumber` (`tdnumber`),
-
   UNIQUE KEY `tdname` (`tdname`)
-
 ) TYPE=MyISAM;
 
-
-
 INSERT INTO `nucleus_template_desc` VALUES (4, 'feeds/atom/modified', 'Atom feeds: Inserts last modification date');
-
 INSERT INTO `nucleus_template_desc` VALUES (5, 'feeds/atom/entries', 'Atom feeds: Feed items');
-
 INSERT INTO `nucleus_template_desc` VALUES (3, 'feeds/rss20', 'Used for RSS 2.0 syndication of your blog');
-
 INSERT INTO `nucleus_template_desc` VALUES (8, 'default/index', 'Nucleus CMS default index template');
-
 INSERT INTO `nucleus_template_desc` VALUES (9, 'default/item', 'Nucleus CMS default item template');
 
-
-
-
-
 CREATE TABLE `nucleus_tickets` (
-
   `ticket` varchar(40) NOT NULL default '',
-
   `ctime` datetime NOT NULL default '0000-00-00 00:00:00',
-
   `member` int(11) NOT NULL default '0',
-
   PRIMARY KEY  (`ticket`,`member`)
-
 ) TYPE=MyISAM;
-
-
-
-
-
index 998fb71..e6be5f3 100755 (executable)
@@ -1,35 +1,48 @@
 <?php
+/*
+ * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
+ * Copyright (C) 2002-2007 The Nucleus Group
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * (see nucleus/documentation/index.html#license for more info)
+ */
 /**
-  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
-  * Copyright (C) 2002-2005 The Nucleus Group
-  *
-  * This program is free software; you can redistribute it and/or
-  * modify it under the terms of the GNU General Public License
-  * as published by the Free Software Foundation; either version 2
-  * of the License, or (at your option) any later version.
-  * (see nucleus/documentation/index.html#license for more info)
-  *
-  * The code for the Nucleus admin area
-  *
-  * $Id: ADMIN.php,v 1.9 2007-03-22 08:32:11 kimitake Exp $
-  * $NucleusJP: ADMIN.php,v 1.8 2005/08/13 07:21:33 kimitake Exp $
-  */
+ * The code for the Nucleus admin area
+ *
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2007 The Nucleus Group
+ * @version $Id: ADMIN.php,v 1.10 2007-04-04 07:52:08 kimitake Exp $
+ * @version $NucleusJP: ADMIN.php,v 1.20 2007/03/22 03:30:14 kmorimatsu Exp $
+ */
+
+if ( !function_exists('requestVar') ) exit;
+require_once dirname(__FILE__) . '/showlist.php';
 
+/**
+ * Builds the admin area and executes admin actions
+ */
 class ADMIN {
 
-       // action currently being executed ($action=xxxx -> action_xxxx method)
+       /**
+        * @var string $action action currently being executed ($action=xxxx -> action_xxxx method)
+        */
        var $action;
 
+       /**
+        * Class constructor
+        */
        function ADMIN() {
 
        }
 
        /**
-         * Executes an action
-         *
-         * @param $action
-         *             action to be performed
-         */
+        * Executes an action
+        *
+        * @param string $action action to be performed
+        */
        function action($action) {
                global $CONF, $manager;
 
@@ -39,7 +52,7 @@ class ADMIN {
                        '' => 'overview'
                );
 
-               if ($alias[$action])
+               if (isset($alias[$action]))
                        $action = $alias[$action];
 
                $methodName = 'action_' . $action;
@@ -49,7 +62,7 @@ class ADMIN {
                // check ticket. All actions need a ticket, unless they are considered to be safe (a safe action
                // is an action that requires user interaction before something is actually done)
                // all safe actions are in this array:
-               $aActionsNotToCheck = array('showlogin', 'login', 'overview', 'itemlist', 'blogcommentlist', 'bookmarklet', 'blogsettings', 'banlist', 'deleteblog', 'editmembersettings', 'browseownitems', 'browseowncomments', 'createitem', 'itemedit', 'itemmove', 'categoryedit', 'categorydelete', 'manage', 'actionlog', 'settingsedit', 'backupoverview', 'pluginlist', 'createnewlog', 'usermanagement', 'skinoverview', 'templateoverview', 'skinieoverview', 'itemcommentlist', 'commentedit', 'commentdelete', 'banlistnewfromitem', 'banlistdelete', 'itemdelete', 'manageteam', 'teamdelete', 'banlistnew', 'memberedit', 'memberdelete', 'pluginhelp', 'pluginoptions', 'plugindelete', 'skinedittype', 'skindelete', 'skinedit', 'templateedit', 'templatedelete', 'activate');
+               $aActionsNotToCheck = array('showlogin', 'login', 'overview', 'itemlist', 'blogcommentlist', 'bookmarklet', 'blogsettings', 'banlist', 'deleteblog', 'editmembersettings', 'browseownitems', 'browseowncomments', 'createitem', 'itemedit', 'itemmove', 'categoryedit', 'categorydelete', 'manage', 'actionlog', 'settingsedit', 'backupoverview', 'pluginlist', 'createnewlog', 'usermanagement', 'skinoverview', 'templateoverview', 'skinieoverview', 'itemcommentlist', 'commentedit', 'commentdelete', 'banlistnewfromitem', 'banlistdelete', 'itemdelete', 'manageteam', 'teamdelete', 'banlistnew', 'memberedit', 'memberdelete', 'pluginhelp', 'pluginoptions', 'plugindelete', 'skinedittype', 'skinremovetype', 'skindelete', 'skinedit', 'templateedit', 'templatedelete', 'activate');
 /*
                // the rest of the actions needs to be checked
                $aActionsToCheck = array('additem', 'itemupdate', 'itemmoveto', 'categoryupdate', 'categorydeleteconfirm', 'itemdeleteconfirm', 'commentdeleteconfirm', 'teamdeleteconfirm', 'memberdeleteconfirm', 'templatedeleteconfirm', 'skindeleteconfirm', 'banlistdeleteconfirm', 'plugindeleteconfirm', 'batchitem', 'batchcomment', 'batchmember', 'batchcategory', 'batchteam', 'regfile', 'commentupdate', 'banlistadd', 'changemembersettings', 'clearactionlog', 'settingsupdate', 'blogsettingsupdate', 'categorynew', 'teamchangeadmin', 'teamaddmember', 'memberadd', 'addnewlog', 'addnewlog2', 'backupcreate', 'backuprestore', 'pluginup', 'plugindown', 'pluginupdate', 'pluginadd', 'pluginoptionsupdate', 'skinupdate', 'skinclone', 'skineditgeneral', 'templateclone', 'templatenew', 'templateupdate', 'skinieimport', 'skinieexport', 'skiniedoimport', 'skinnew', 'deleteblogconfirm', 'sendping', 'rawping', 'activatesetpwd');
@@ -63,16 +76,21 @@ class ADMIN {
                if (method_exists($this, $methodName))
                        call_user_func(array(&$this, $methodName));
                else
-                       $this->error(_BADACTION . " ($action)");
+                       $this->error(_BADACTION . htmlspecialchars(" ($action)"));
 
        }
 
-
+       /**
+        * @todo document this
+        */
        function action_showlogin() {
                global $error;
                $this->action_login($error);
        }
 
+       /**
+        * @todo document this
+        */
        function action_login($msg = '', $passvars = 1) {
                global $member;
 
@@ -116,8 +134,9 @@ class ADMIN {
 
 
        /**
-         * provides a screen with the overview of the actions available
-         */
+        * provides a screen with the overview of the actions available
+        * @todo document parameter
+        */
        function action_overview($msg = '') {
                global $member;
 
@@ -186,11 +205,17 @@ class ADMIN {
                $this->pagefoot();
        }
 
-       // returns a link to a weblog (takes BLOG object as parameter)
+       /**
+        * Returns a link to a weblog
+        * @param object BLOG
+        */
        function bloglink(&$blog) {
-               return '<a href="'.htmlspecialchars($blog->getURL()).'" title="'._BLOGLIST_TT_VISIT.'">'.$blog->getName() .'</a>';
+               return '<a href="'.htmlspecialchars($blog->getURL()).'" title="'._BLOGLIST_TT_VISIT.'">'. htmlspecialchars( $blog->getName() ) .'</a>';
        }
 
+       /**
+        * @todo document this
+        */
        function action_manage($msg = '') {
                global $member;
 
@@ -229,6 +254,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_itemlist($blogid = '') {
                global $member, $manager;
 
@@ -278,7 +306,7 @@ class ADMIN {
                $template['content'] = 'itemlist';
                $template['now'] = $blog->getCorrectTime(time());
 
-
+               $manager->loadClass("ENCAPSULATE");
                $navList =& new NAVLIST('itemlist', $start, $amount, 0, 1000, $blogid, $search, 0);
                $navList->showBatchList('item',$query,'table',$template);
 
@@ -286,7 +314,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
-
+       /**
+        * @todo document this
+        */
        function action_batchitem() {
                global $member, $manager;
 
@@ -334,7 +364,7 @@ class ADMIN {
                                        $error = $this->moveOneItem($itemid, $destCatid);
                                        break;
                                default:
-                                       $error = _BATCH_UNKNOWN . $action;
+                                       $error = _BATCH_UNKNOWN . htmlspecialchars($action);
                        }
 
                        echo '<b>',($error ? $error : _BATCH_SUCCESS),'</b>';
@@ -349,6 +379,9 @@ class ADMIN {
 
        }
 
+       /**
+        * @todo document this
+        */
        function action_batchcomment() {
                global $member;
 
@@ -387,7 +420,7 @@ class ADMIN {
                                        $error = $this->deleteOneComment($commentid);
                                        break;
                                default:
-                                       $error = _BATCH_UNKNOWN . $action;
+                                       $error = _BATCH_UNKNOWN . htmlspecialchars($action);
                        }
 
                        echo '<b>',($error ? $error : _BATCH_SUCCESS),'</b>';
@@ -402,6 +435,9 @@ class ADMIN {
 
        }
 
+       /**
+        * @todo document this
+        */
        function action_batchmember() {
                global $member;
 
@@ -451,7 +487,7 @@ class ADMIN {
                                                sql_query('UPDATE ' . sql_table('member') .' SET madmin=0 WHERE mnumber='.$memberid);
                                        break;
                                default:
-                                       $error = _BATCH_UNKNOWN . $action;
+                                       $error = _BATCH_UNKNOWN . htmlspecialchars($action);
                        }
 
                        echo '<b>',($error ? $error : _BATCH_SUCCESS),'</b>';
@@ -466,7 +502,9 @@ class ADMIN {
 
        }
 
-
+       /**
+        * @todo document this
+        */
        function action_batchteam() {
                global $member;
 
@@ -519,7 +557,7 @@ class ADMIN {
                                                sql_query('UPDATE '.sql_table('team').' SET tadmin=0 WHERE tblog='.$blogid.' and tmember='.$memberid);
                                        break;
                                default:
-                                       $error = _BATCH_UNKNOWN . $action;
+                                       $error = _BATCH_UNKNOWN . htmlspecialchars($action);
                        }
 
                        echo '<b>',($error ? $error : _BATCH_SUCCESS),'</b>';
@@ -534,8 +572,9 @@ class ADMIN {
 
        }
 
-
-
+       /**
+        * @todo document this
+        */
        function action_batchcategory() {
                global $member, $manager;
 
@@ -582,7 +621,7 @@ class ADMIN {
                                        $error = $this->moveOneCategory($catid, $destBlogId);
                                        break;
                                default:
-                                       $error = _BATCH_UNKNOWN . $action;
+                                       $error = _BATCH_UNKNOWN . htmlspecialchars($action);
                        }
 
                        echo '<b>',($error ? 'Error: '.$error : _BATCH_SUCCESS),'</b>';
@@ -596,6 +635,9 @@ class ADMIN {
 
        }
 
+       /**
+        * @todo document this
+        */
        function batchMoveSelectDestination($type, $ids) {
                global $manager;
                $this->pagehead();
@@ -626,6 +668,9 @@ class ADMIN {
                exit;
        }
 
+       /**
+        * @todo document this
+        */
        function batchMoveCategorySelectDestination($type, $ids) {
                global $manager;
                $this->pagehead();
@@ -656,6 +701,9 @@ class ADMIN {
                exit;
        }
 
+       /**
+        * @todo document this
+        */
        function batchAskDeleteConfirmation($type, $ids) {
                global $manager;
 
@@ -694,21 +742,24 @@ class ADMIN {
 
 
        /**
-         * Inserts a HTML select element with choices for all categories to which the current
-         * member has access
-         */
+        * Inserts a HTML select element with choices for all categories to which the current
+        * member has access
+        * @see function selectBlog
+        */
        function selectBlogCategory($name, $selected = 0, $tabindex = 0, $showNewCat = 0, $iForcedBlogInclude = -1) {
                ADMIN::selectBlog($name, 'category', $selected, $tabindex, $showNewCat, $iForcedBlogInclude);
        }
 
        /**
-         * Inserts a HTML select element with choices for all blogs to which the user has access
-         *             mode = 'blog' => shows blognames and values are blogids
-         *             mode = 'category' => show category names and values are catids
-         *
-         * @param $iForcedBlogInclude
-         *             ID of a blog that always needs to be included, without checking if the member is on the blog team (-1 = none)
-         */
+        * Inserts a HTML select element with choices for all blogs to which the user has access
+        *              mode = 'blog' => shows blognames and values are blogids
+        *              mode = 'category' => show category names and values are catids
+        *
+        * @param $iForcedBlogInclude
+        *              ID of a blog that always needs to be included, without checking if the
+        *              member is on the blog team (-1 = none)
+        * @todo document parameters
+        */
        function selectBlog($name, $mode='blog', $selected = 0, $tabindex = 0, $showNewCat = 0, $iForcedBlogInclude = -1) {
                global $member, $CONF;
 
@@ -776,8 +827,11 @@ class ADMIN {
 
        }
 
+       /**
+        * @todo document this
+        */
        function action_browseownitems() {
-               global $member;
+               global $member, $manager;
 
                $this->pagehead();
 
@@ -811,7 +865,8 @@ class ADMIN {
                $template['content'] = 'itemlist';
                $template['now'] = time();
 
-               $navList =& new NAVLIST('browseownitems', $start, $amount, 0, 1000, $blogid, $search, 0);
+               $manager->loadClass("ENCAPSULATE");
+               $navList =& new NAVLIST('browseownitems', $start, $amount, 0, 1000, /*$blogid*/ 0, $search, 0);
                $navList->showBatchList('item',$query,'table',$template);
 
                $this->pagefoot();
@@ -819,10 +874,11 @@ class ADMIN {
        }
 
        /**
-         * Show all the comments for a given item
-         */
+        * Show all the comments for a given item
+        * @param int $itemid
+        */
        function action_itemcommentlist($itemid = '') {
-               global $member;
+               global $member, $manager;
 
                if ($itemid == '')
                        $itemid = intRequestVar('itemid');
@@ -862,6 +918,7 @@ class ADMIN {
                $template['content'] = 'commentlist';
                $template['canAddBan'] = $member->blogAdminRights(getBlogIDFromItemID($itemid));
 
+               $manager->loadClass("ENCAPSULATE");
                $navList =& new NAVLIST('itemcommentlist', $start, $amount, 0, 1000, 0, $search, $itemid);
                $navList->showBatchList('comment',$query,'table',$template,_NOCOMMENTS);
 
@@ -869,10 +926,10 @@ class ADMIN {
        }
 
        /**
-         * Browse own comments
-         */
+        * Browse own comments
+        */
        function action_browseowncomments() {
-               global $member;
+               global $member, $manager;
 
                // start index
                if (postVar('start'))
@@ -905,6 +962,7 @@ class ADMIN {
                $template['content'] = 'commentlist';
                $template['canAddBan'] = 0;     // doesn't make sense to allow banning yourself
 
+               $manager->loadClass("ENCAPSULATE");
                $navList =& new NAVLIST('browseowncomments', $start, $amount, 0, 1000, 0, $search, 0);
                $navList->showBatchList('comment',$query,'table',$template,_NOCOMMENTS_YOUR);
 
@@ -912,8 +970,9 @@ class ADMIN {
        }
 
        /**
-         * Browse all comments for a weblog
-         */
+        * Browse all comments for a weblog
+        * @param int $blogid
+        */
        function action_blogcommentlist($blogid = '')
        {
                global $member, $manager;
@@ -940,7 +999,7 @@ class ADMIN {
                $search = postVar('search');            // search through comments
 
 
-               $query =  'SELECT cbody, cuser, cmail, mname, ctime, chost, cnumber, cip, citem FROM '.sql_table('comment').' LEFT OUTER JOIN '.sql_table('member').' ON mnumber=cmember WHERE cblog=' . intval($blogid);
+               $query =  'SELECT cbody, cuser, cemail, cmail, mname, ctime, chost, cnumber, cip, citem FROM '.sql_table('comment').' LEFT OUTER JOIN '.sql_table('member').' ON mnumber=cmember WHERE cblog=' . intval($blogid);
 
                if ($search != '')
                        $query .= ' and cbody LIKE "%' . addslashes($search) . '%"';
@@ -960,6 +1019,7 @@ class ADMIN {
                $template['content'] = 'commentlist';
                $template['canAddBan'] = $member->blogAdminRights($blogid);
 
+               $manager->loadClass("ENCAPSULATE");
                $navList =& new NAVLIST('blogcommentlist', $start, $amount, 0, 1000, $blogid, $search, 0);
                $navList->showBatchList('comment',$query,'table',$template, _NOCOMMENTS_BLOG);
 
@@ -967,8 +1027,8 @@ class ADMIN {
        }
 
        /**
-         * Provide a page to item a new item to the given blog
-         */
+        * Provide a page to item a new item to the given blog
+        */
        function action_createitem() {
                global $member, $manager;
 
@@ -990,6 +1050,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_itemedit() {
                global $member, $manager;
 
@@ -1015,6 +1078,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_itemupdate() {
                global $member, $manager, $CONF;
 
@@ -1036,6 +1102,7 @@ class ADMIN {
                $title  = postVar('title');
                $more   = postVar('more');
                $closed = intPostVar('closed');
+               $draftid = intPostVar('draftid');
 
                // default action = add now
                if (!$actiontype)
@@ -1098,6 +1165,10 @@ class ADMIN {
                // edit the item for real
                ITEM::update($itemid, $catid, $title, $body, $more, $closed, $wasdraft, $publish, $timestamp);
 
+               if ($draftid > 0) {
+                       ITEM::delete($draftid);
+               }
+
                $blogid = getBlogIDFromItemID($itemid);
                $blog =& $manager->getBlog($blogid);
                if (!$closed && $publish && $wasdraft && $blog->pingUserland()) {
@@ -1119,6 +1190,9 @@ class ADMIN {
                }
        }
 
+       /**
+        * @todo document this
+        */
        function action_itemdelete() {
                global $member, $manager;
 
@@ -1157,6 +1231,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_itemdeleteconfirm() {
                global $member;
 
@@ -1174,7 +1251,10 @@ class ADMIN {
                $this->action_itemlist($blogid);
        }
 
-       // deletes one item and returns error if something goes wrong
+       /**
+        * Deletes one item and returns error if something goes wrong
+        * @param int $itemid
+        */
        function deleteOneItem($itemid) {
                global $member, $manager;
 
@@ -1186,6 +1266,9 @@ class ADMIN {
                ITEM::delete($itemid);
        }
 
+       /**
+        * @todo document this
+        */
        function action_itemmove() {
                global $member, $manager;
 
@@ -1215,6 +1298,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_itemmoveto() {
                global $member, $manager;
 
@@ -1247,9 +1333,11 @@ class ADMIN {
        }
 
        /**
-         * Moves one item to a given category (category existance should be checked by caller)
-         * errors are returned
-         */
+        * Moves one item to a given category (category existance should be checked by caller)
+        * errors are returned
+        * @param int $itemid
+        * @param int $destCatid category ID to which the item will be moved
+        */
        function moveOneItem($itemid, $destCatid) {
                global $member;
 
@@ -1261,8 +1349,8 @@ class ADMIN {
        }
 
        /**
-         * Adds a item to the chosen blog
-         */
+        * Adds a item to the chosen blog
+        */
        function action_additem() {
                global $member, $manager, $CONF;
 
@@ -1291,12 +1379,12 @@ class ADMIN {
        }
 
        /**
-         * Shows a window that says we're about to ping weblogs.com.
-         * immediately refresh to the real pinging page, which will
-         * show an error, or redirect to the blog.
-         *
-         * @param $blogid ID of blog for which ping needs to be sent out
-         */
+        * Shows a window that says we're about to ping weblogs.com.
+        * immediately refresh to the real pinging page, which will
+        * show an error, or redirect to the blog.
+        *
+        * @param int $blogid ID of blog for which ping needs to be sent out
+        */
        function action_sendping($blogid = -1) {
                global $member, $manager;
 
@@ -1323,8 +1411,10 @@ class ADMIN {
                <?php           $this->pagefoot();
        }
 
-       // ping to Weblogs.com
-       // sends the real ping (can take up to 10 seconds!)
+       /**
+        * Ping to Weblogs.com
+        * Sends the real ping (can take up to 10 seconds!)
+        */
        function action_rawping() {
                global $manager;
                // TODO: checks?
@@ -1353,8 +1443,8 @@ class ADMIN {
        }
 
        /**
-         * Allows to edit previously made comments
-         */
+        * Allows to edit previously made comments
+        */
        function action_commentedit() {
                global $member, $manager;
 
@@ -1415,6 +1505,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_commentupdate() {
                global $member, $manager;
 
@@ -1458,6 +1551,9 @@ class ADMIN {
 
        }
 
+       /**
+        * @todo document this
+        */
        function action_commentdelete() {
                global $member, $manager;
 
@@ -1498,6 +1594,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_commentdeleteconfirm() {
                global $member;
 
@@ -1518,6 +1617,9 @@ class ADMIN {
                        $this->action_browseowncomments();
        }
 
+       /**
+        * @todo document this
+        */
        function deleteOneComment($commentid) {
                global $member, $manager;
 
@@ -1538,8 +1640,8 @@ class ADMIN {
        }
 
        /**
-         * Usermanagement main
-         */
+        * Usermanagement main
+        */
        function action_usermanagement() {
                global $member, $manager;
 
@@ -1560,12 +1662,13 @@ class ADMIN {
                $template['content'] = 'memberlist';
                $template['tabindex'] = 10;
 
+               $manager->loadClass("ENCAPSULATE");
                $batch =& new BATCH('member');
                $batch->showlist($query,'table',$template);
 
                echo '<h3>' . _MEMBERS_NEW .'</h3>';
                ?>
-                       <form method="post" action="index.php"><div>
+                       <form method="post" action="index.php" name="memberedit"><div>
 
                        <input type="hidden" name="action" value="memberadd" />
                        <?php $manager->addTicketHidden() ?>
@@ -1575,7 +1678,7 @@ class ADMIN {
                                <th colspan="2"><?php echo _MEMBERS_NEW?></th>
                        </tr><tr>
                                <td><?php echo _MEMBERS_DISPLAY?> <?php help('shortnames');?>
-                                       <br /><small>(This is the name used to logon)</small>
+                               <br /><small><?php echo _MEMBERS_DISPLAY_INFO?></small>
                                </td>
                                <td><input tabindex="10010" name="name" size="16" maxlength="16" /></td>
                        </tr><tr>
@@ -1613,11 +1716,15 @@ class ADMIN {
        }
 
        /**
-         * Edit member settings
-         */
+        * Edit member settings
+        */
        function action_memberedit() {
                $this->action_editmembersettings(intRequestVar('memberid'));
        }
+
+       /**
+        * @todo document this
+        */
        function action_editmembersettings($memberid = '') {
                global $member, $manager, $CONF;
 
@@ -1641,7 +1748,7 @@ class ADMIN {
                $mem = MEMBER::createFromID($memberid);
 
                ?>
-               <form method="post" action="index.php"><div>
+               <form method="post" action="index.php" name="memberedit"><div>
 
                <input type="hidden" name="action" value="changemembersettings" />
                <input type="hidden" name="memberid" value="<?php echo  $memberid; ?>" />
@@ -1689,7 +1796,7 @@ class ADMIN {
                                <td><?php $this->input_yesno('admin',$mem->isAdmin(),60); ?></td>
                        </tr><tr>
                                <td><?php echo _MEMBERS_CANLOGIN?> <?php help('canlogin'); ?></td>
-                               <td><?php $this->input_yesno('canlogin',$mem->canLogin(),70); ?></td>
+                               <td><?php $this->input_yesno('canlogin',$mem->canLogin(),70,1,0,_YES,_NO,$mem->isAdmin()); ?></td>
                <?php } ?>
                </tr><tr>
                        <td><?php echo _MEMBERS_NOTES?></td>
@@ -1746,7 +1853,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
-
+       /**
+        * @todo document this
+        */
        function action_changemembersettings() {
                global $member, $CONF, $manager;
 
@@ -1755,12 +1864,12 @@ class ADMIN {
                // check if allowed
                ($member->getID() == $memberid) or $member->isAdmin() or $this->disallow();
 
-               $name                   = trim(postVar('name'));
-               $realname               = trim(postVar('realname'));
+               $name                   = trim(strip_tags(postVar('name')));
+               $realname               = trim(strip_tags(postVar('realname')));
                $password               = postVar('password');
                $repeatpassword = postVar('repeatpassword');
-               $email                  = postVar('email');
-               $url                    = postVar('url');
+               $email                  = strip_tags(postVar('email'));
+               $url                    = strip_tags(postVar('url'));
 
                // Sometimes user didn't prefix the URL with http://, this cause a malformed URL. Let's fix it.
                if (!eregi("^https?://", $url))
@@ -1768,7 +1877,7 @@ class ADMIN {
 
                $admin                  = postVar('admin');
                $canlogin               = postVar('canlogin');
-               $notes                  = postVar('notes');
+               $notes                  = strip_tags(postVar('notes'));
                $deflang                = postVar('deflang');
 
                $mem = MEMBER::createFromID($memberid);
@@ -1815,9 +1924,6 @@ class ADMIN {
                                $mem->setPassword($password);
                }
 
-               if ($newpass)
-                       $mem->setPassword($password);
-
                $oldEmail = $mem->getEmail();
 
                $mem->setRealName($realname);
@@ -1836,25 +1942,28 @@ class ADMIN {
 
                $mem->write();
 
+               // store plugin options
+               $aOptions = requestArray('plugoption');
+               NucleusPlugin::_applyPluginOptions($aOptions);
+               $manager->notify('PostPluginOptionsUpdate',array('context' => 'member', 'memberid' => $memberid, 'member' => &$mem));
+
                // if email changed, generate new password
                if ($oldEmail != $mem->getEmail())
                {
                        $mem->sendActivationLink('addresschange', $oldEmail);
                        // logout member
                        $mem->newCookieKey();
-                       $member->logout();
+
+                       // only log out if the member being edited is the current member.
+                       if ($member->getID() == $memberid)
+                               $member->logout();
                        $this->action_login(_MSG_ACTIVATION_SENT, 0);
                        return;
                }
 
 
-               // store plugin options
-               $aOptions = requestArray('plugoption');
-               NucleusPlugin::_applyPluginOptions($aOptions);
-               $manager->notify('PostPluginOptionsUpdate',array('context' => 'member', 'memberid' => $memberid, 'member' => &$mem));
-
                if (  ( $mem->getID() == $member->getID() )
-                  && ( $newpass || ( $mem->getDisplayName() != $member->getDisplayName() ) )
+                  && ( $mem->getDisplayName() != $member->getDisplayName() )
                   ) {
                        $mem->newCookieKey();
                        $member->logout();
@@ -1864,8 +1973,11 @@ class ADMIN {
                }
        }
 
+       /**
+        * @todo document this
+        */
        function action_memberadd() {
-               global $member;
+               global $member, $manager;
 
                // check if allowed
                $member->isAdmin() or $this->disallow();
@@ -1879,6 +1991,11 @@ class ADMIN {
                if ($res != 1)
                        $this->error($res);
 
+               // fire PostRegister event
+               $newmem = new MEMBER();
+               $newmem->readFromName(postVar('name'));
+               $manager->notify('PostRegister',array('member' => &$newmem));
+
                $this->action_usermanagement();
        }
 
@@ -1893,6 +2010,9 @@ class ADMIN {
                $this->_showActivationPage($key);
        }
 
+       /**
+        * @todo document this
+        */
        function _showActivationPage($key, $message = '')
        {
                global $manager;
@@ -2039,8 +2159,8 @@ class ADMIN {
        }
 
        /**
-         * Manage team
-         */
+        * Manage team
+        */
        function action_manageteam() {
                global $member, $manager;
 
@@ -2066,6 +2186,7 @@ class ADMIN {
                $template['content'] = 'teamlist';
                $template['tabindex'] = 10;
 
+               $manager->loadClass("ENCAPSULATE");
                $batch =& new BATCH('team');
                $batch->showlist($query, 'table', $template);
 
@@ -2102,8 +2223,8 @@ class ADMIN {
        }
 
        /**
-         * Add member tot tram
-         */
+        * Add member to team
+        */
        function action_teamaddmember() {
                global $member, $manager;
 
@@ -2122,6 +2243,9 @@ class ADMIN {
 
        }
 
+       /**
+        * @todo document this
+        */
        function action_teamdelete() {
                global $member, $manager;
 
@@ -2138,7 +2262,7 @@ class ADMIN {
                ?>
                        <h2><?php echo _DELETE_CONFIRM?></h2>
 
-                       <p><?php echo _CONFIRMTXT_TEAM1?><b><?php echo  $teammem->getDisplayName() ?></b><?php echo _CONFIRMTXT_TEAM2?><b><?php echo  htmlspecialchars(strip_tags($blog->getName())) ?></b>
+                       <p><?php echo _CONFIRMTXT_TEAM1?><b><?php echo  htmlspecialchars($teammem->getDisplayName()) ?></b><?php echo _CONFIRMTXT_TEAM2?><b><?php echo  htmlspecialchars(strip_tags($blog->getName())) ?></b>
                        </p>
 
 
@@ -2153,6 +2277,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_teamdeleteconfirm() {
                global $member;
 
@@ -2167,6 +2294,9 @@ class ADMIN {
                $this->action_manageteam();
        }
 
+       /**
+        * @todo document this
+        */
        function deleteOneTeamMember($blogid, $memberid) {
                global $member, $manager;
 
@@ -2200,6 +2330,9 @@ class ADMIN {
                return '';
        }
 
+       /**
+        * @todo document this
+        */
        function action_teamchangeadmin() {
                global $member;
 
@@ -2233,6 +2366,9 @@ class ADMIN {
                        $this->action_overview(_MSG_ADMINCHANGED);
        }
 
+       /**
+        * @todo document this
+        */
        function action_blogsettings() {
                global $member, $manager;
 
@@ -2321,6 +2457,10 @@ class ADMIN {
                        </td>
                        <td><?php $this->input_yesno('public',$blog->isPublic(),70); ?></td>
                </tr><tr>
+       <td><?php echo _EBLOG_REQUIREDEMAIL?>
+                </td>
+                <td><?php $this->input_yesno('reqemail',$blog->emailRequired(),72); ?></td>
+         </tr><tr>
                        <td><?php echo _EBLOG_NOTIFY?> <?php help('blognotify'); ?></td>
                        <td><input name="notify" tabindex="80" maxlength="60" size="40" value="<?php echo  htmlspecialchars($blog->getNotifyAddress()); ?>" /></td>
                </tr><tr>
@@ -2391,6 +2531,7 @@ class ADMIN {
                $template['content'] = 'categorylist';
                $template['tabindex'] = 200;
 
+               $manager->loadClass("ENCAPSULATE");
                $batch =& new BATCH('category');
                $batch->showlist($query,'table',$template);
 
@@ -2431,6 +2572,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_categorynew() {
                global $member, $manager;
 
@@ -2455,7 +2599,9 @@ class ADMIN {
                $this->action_blogsettings();
        }
 
-
+       /**
+        * @todo document this
+        */
        function action_categoryedit($catid = '', $blogid = '', $desturl = '') {
                global $member, $manager;
 
@@ -2479,6 +2625,8 @@ class ADMIN {
                $extrahead = '<script type="text/javascript" src="javascript/numbercheck.js"></script>';
                $this->pagehead($extrahead);
 
+               echo "<p><a href='index.php?action=blogsettings&amp;blogid=$blogid'>(",_BACK_TO_BLOGSETTINGS,")</a></p>";
+
                ?>
                <h2><?php echo _EBLOG_CAT_UPDATE?> '<?php echo htmlspecialchars($cname)?>'</h2>
                <form method='post' action='index.php'><div>
@@ -2513,7 +2661,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
-
+       /**
+        * @todo document this
+        */
        function action_categoryupdate() {
                global $member, $manager;
 
@@ -2554,6 +2704,9 @@ class ADMIN {
                }
        }
 
+       /**
+        * @todo document this
+        */
        function action_categorydelete() {
                global $member, $manager;
 
@@ -2584,7 +2737,7 @@ class ADMIN {
                        <h2><?php echo _DELETE_CONFIRM?></h2>
 
                        <div>
-                       <?php echo _CONFIRMTXT_CATEGORY?><b><?php echo  $blog->getCategoryName($catid)?></b>
+                       <?php echo _CONFIRMTXT_CATEGORY?><b><?php echo  htmlspecialchars($blog->getCategoryName($catid))?></b>
                        </div>
 
                        <form method="post" action="index.php"><div>
@@ -2598,6 +2751,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_categorydeleteconfirm() {
                global $member, $manager;
 
@@ -2613,6 +2769,9 @@ class ADMIN {
                $this->action_blogsettings();
        }
 
+       /**
+        * @todo document this
+        */
        function deleteOneCategory($catid) {
                global $manager, $member;
 
@@ -2659,6 +2818,9 @@ class ADMIN {
 
        }
 
+       /**
+        * @todo document this
+        */
        function moveOneCategory($catid, $destblogid) {
                global $manager, $member;
 
@@ -2724,6 +2886,9 @@ class ADMIN {
 
        }
 
+       /**
+        * @todo document this
+        */
        function action_blogsettingsupdate() {
                global $member, $manager;
 
@@ -2782,6 +2947,7 @@ class ADMIN {
                $blog->setAllowPastPosting(intPostVar('allowpastposting'));
                $blog->setDefaultCategory(intPostVar('defcat'));
                $blog->setSearchable(intPostVar('searchable'));
+               $blog->setEmailRequired(intPostVar('reqemail'));
 
                $blog->writeSettings();
 
@@ -2794,6 +2960,9 @@ class ADMIN {
                $this->action_overview(_MSG_SETTINGSCHANGED);
        }
 
+       /**
+        * @todo document this
+        */
        function action_deleteblog() {
                global $member, $CONF, $manager;
 
@@ -2828,6 +2997,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_deleteblogconfirm() {
                global $member, $CONF, $manager;
 
@@ -2873,6 +3045,9 @@ class ADMIN {
                $this->action_overview(_DELETED_BLOG);
        }
 
+       /**
+        * @todo document this
+        */
        function action_memberdelete() {
                global $member, $manager;
 
@@ -2886,7 +3061,7 @@ class ADMIN {
                ?>
                        <h2><?php echo _DELETE_CONFIRM?></h2>
 
-                       <p><?php echo _CONFIRMTXT_MEMBER?><b><?php echo  $mem->getDisplayName() ?></b>
+                       <p><?php echo _CONFIRMTXT_MEMBER?><b><?php echo htmlspecialchars($mem->getDisplayName()) ?></b>
                        </p>
 
                        <p>
@@ -2903,6 +3078,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_memberdeleteconfirm() {
                global $member;
 
@@ -2920,7 +3098,10 @@ class ADMIN {
                        $this->action_overview(_DELETED_MEMBER);
        }
 
-       // (static)
+       /**
+        * @static
+        * @todo document this
+        */
        function deleteOneMember($memberid) {
                global $manager;
 
@@ -2932,6 +3113,11 @@ class ADMIN {
 
                $manager->notify('PreDeleteMember', array('member' => &$mem));
 
+               /* unlink comments from memberid */
+               $query = 'UPDATE ' . sql_table('comment') . ' SET cmember="0", cuser="'. addslashes($mem->getDisplayName())
+                                       .'" WHERE cmember='.$memberid;
+               sql_query($query);
+
                $query = 'DELETE FROM '.sql_table('member').' WHERE mnumber='.$memberid;
                sql_query($query);
 
@@ -2949,6 +3135,9 @@ class ADMIN {
                return '';
        }
 
+       /**
+        * @todo document this
+        */
        function action_createnewlog() {
                global $member, $CONF, $manager;
 
@@ -3017,7 +3206,7 @@ class ADMIN {
                        <td><input name="timeoffset" tabindex="110" size="3" value="0" /></td>
                </tr><tr>
                        <td><?php echo _EBLOG_ADMIN?>
-                               <?php help('blogadmin'); ?>
+                               <?php help('teamadmin'); ?>
                        </td>
                        <td><?php echo _EBLOG_ADMIN_MSG?></td>
                </tr><tr>
@@ -3030,6 +3219,9 @@ class ADMIN {
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_addnewlog() {
                global $member, $manager, $CONF;
 
@@ -3099,6 +3291,9 @@ class ADMIN {
                $manager->notify(
                        'PostAddCategory',
                        array(
+                               'blog' => &$blog,
+                               'name' => 'General',
+                               'description' => 'Items that do not fit in other categories',
                                'catid' => $catid
                        )
                );
@@ -3132,7 +3327,6 @@ selector();
 
                <p>¿·¤·¤¤weblog¤ÎºîÀ®¤ò´°Î»¤¹¤ë¤¿¤á¤Ë¤Ï¡¢²¼¤Ë¤³¤Î¥Õ¥¡¥¤¥ë¤ÎURL¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£ (¤¹¤Ç¤ËÍÑ°Õ¤·¤¿Ãͤǹç¤Ã¤Æ¤¤¤ë¤È¤Ï»×¤¤¤Þ¤¹¤¬ÊݾڤϤ·¤Þ¤»¤ó):</p>
 
-
                <form action="index.php" method="post"><div>
                        <input type="hidden" name="action" value="addnewlog2" />
                        <?php $manager->addTicketHidden() ?>
@@ -3150,7 +3344,6 @@ selector();
 
                <p>¿·¤·¤¤weblog¤ÎºîÀ®¤ò´°Î»¤¹¤ë¤¿¤á¤Ë¤Ï¡¢²¼¤ËURL¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£ (ÂçÄñ¤Ï´û¸blog¤ÈƱ¤¸URL)</p>
 
-
                <form action="index.php" method="post"><div>
                        <input type="hidden" name="action" value="addnewlog2" />
                        <?php $manager->addTicketHidden() ?>
@@ -3168,6 +3361,9 @@ selector();
 
        }
 
+       /**
+        * @todo document this
+        */
        function action_addnewlog2() {
                global $member, $manager;
 
@@ -3183,6 +3379,9 @@ selector();
                $this->action_overview(_MSG_NEWBLOG);
        }
 
+       /**
+        * @todo document this
+        */
        function action_skinieoverview() {
                global $member, $DIR_LIBS, $manager;
 
@@ -3284,6 +3483,9 @@ selector();
 
        }
 
+       /**
+        * @todo document this
+        */
        function action_skinieimport() {
                global $member, $DIR_LIBS, $DIR_SKINS, $manager;
 
@@ -3312,6 +3514,10 @@ selector();
                // read only metadata
                $error = $importer->readFile($skinFile, 1);
 
+               // clashes
+               $skinNameClashes = $importer->checkSkinNameClashes();
+               $templateNameClashes = $importer->checkTemplateNameClashes();
+               $hasNameClashes = (count($skinNameClashes) > 0) || (count($templateNameClashes) > 0);
 
                if ($error) $this->error($error);
 
@@ -3325,8 +3531,15 @@ selector();
                        <li><p><strong><?php echo _SKINIE_INFO_GENERAL?></strong> <?php echo htmlspecialchars($importer->getInfo())?></p></li>
                        <li><p><strong><?php echo _SKINIE_INFO_SKINS?></strong> <?php echo implode(' <em>'._AND.'</em> ',$importer->getSkinNames())?></p></li>
                        <li><p><strong><?php echo _SKINIE_INFO_TEMPLATES?></strong> <?php echo implode(' <em>'._AND.'</em> ',$importer->getTemplateNames())?></p></li>
-                       <li><p><strong style="color: red;"><?php echo _SKINIE_INFO_SKINCLASH?></strong> <?php echo implode(' <em>'._AND.'</em> ',$importer->checkSkinNameClashes())?></p></li>
-                       <li><p><strong style="color: red;"><?php echo _SKINIE_INFO_TEMPLCLASH?></strong> <?php echo implode(' <em>'._AND.'</em> ',$importer->checkTemplateNameClashes())?></p></li>
+                       <?php
+                               if ($hasNameClashes)
+                               {
+                       ?>
+                       <li><p><strong style="color: red;"><?php echo _SKINIE_INFO_SKINCLASH?></strong> <?php echo implode(' <em>'._AND.'</em> ',$skinNameClashes)?></p></li>
+                       <li><p><strong style="color: red;"><?php echo _SKINIE_INFO_TEMPLCLASH?></strong> <?php echo implode(' <em>'._AND.'</em> ',$templateNameClashes)?></p></li>
+                       <?php
+                               } // if (hasNameClashes)
+                       ?>
                </ul>
 
                <form method="post" action="index.php"><div>
@@ -3335,8 +3548,15 @@ selector();
                        <input type="hidden" name="skinfile" value="<?php echo htmlspecialchars(postVar('skinfile'))?>" />
                        <input type="hidden" name="mode" value="<?php echo htmlspecialchars($mode)?>" />
                        <input type="submit" value="<?php echo _SKINIE_CONFIRM_IMPORT?>" />
+                       <?php
+                               if ($hasNameClashes)
+                               {
+                       ?>
                        <br />
                        <input type="checkbox" name="overwrite" value="1" id="cb_overwrite" /><label for="cb_overwrite"><?php echo _SKINIE_CONFIRM_OVERWRITE?></label>
+                       <?php
+                               } // if (hasNameClashes)
+                       ?>
                </div></form>
 
 
@@ -3344,6 +3564,9 @@ selector();
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_skiniedoimport() {
                global $member, $DIR_LIBS, $DIR_SKINS;
 
@@ -3398,6 +3621,9 @@ selector();
 
        }
 
+       /**
+        * @todo document this
+        */
        function action_skinieexport() {
                global $member, $DIR_LIBS;
 
@@ -3429,6 +3655,9 @@ selector();
                $exporter->export();
        }
 
+       /**
+        * @todo document this
+        */
        function action_templateoverview() {
                global $member, $manager;
 
@@ -3470,6 +3699,9 @@ selector();
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_templateedit($msg = '') {
                global $member, $manager;
 
@@ -3491,7 +3723,7 @@ selector();
                <a href="index.php?action=templateoverview">(<?php echo _TEMPLATE_BACK?>)</a>
                </p>
 
-               <h2><?php echo _TEMPLATE_EDIT_TITLE?> '<?php echo  $templatename; ?>'</h2>
+               <h2><?php echo _TEMPLATE_EDIT_TITLE?> '<?php echo  htmlspecialchars($templatename); ?>'</h2>
 
                <?php                                   if ($msg) echo "<p>"._MESSAGE.": $msg</p>";
                ?>
@@ -3556,6 +3788,12 @@ selector();
        $this->_templateEditRow($template, _TEMPLATE_AFOOTER, 'ARCHIVELIST_FOOTER', '', 150);
 ?>
                </tr><tr>
+                       <th colspan="2"><?php echo _TEMPLATE_BLOGLIST?> <?php help('templatebloglists'); ?></th>
+<?php  $this->_templateEditRow($template, _TEMPLATE_BLOGHEADER, 'BLOGLIST_HEADER', '', 160);
+       $this->_templateEditRow($template, _TEMPLATE_BLOGITEM, 'BLOGLIST_LISTITEM', '', 170);
+       $this->_templateEditRow($template, _TEMPLATE_BLOGFOOTER, 'BLOGLIST_FOOTER', '', 180);
+?>
+               </tr><tr>
                        <th colspan="2"><?php echo _TEMPLATE_CATEGORYLIST?> <?php help('templatecategorylists'); ?></th>
 <?php  $this->_templateEditRow($template, _TEMPLATE_CATHEADER, 'CATLIST_HEADER', '', 160);
        $this->_templateEditRow($template, _TEMPLATE_CATITEM, 'CATLIST_LISTITEM', '', 170);
@@ -3596,6 +3834,9 @@ selector();
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function _templateEditRow(&$template, $description, $name, $help = '', $tabindex = 0, $big = 0) {
                static $count = 1;
        ?>
@@ -3605,6 +3846,9 @@ selector();
        <?php           $count++;
        }
 
+       /**
+        * @todo document this
+        */
        function action_templateupdate() {
                global $member;
 
@@ -3655,6 +3899,9 @@ selector();
                $this->addToTemplate($templateid, 'ARCHIVELIST_HEADER', postVar('ARCHIVELIST_HEADER'));
                $this->addToTemplate($templateid, 'ARCHIVELIST_LISTITEM', postVar('ARCHIVELIST_LISTITEM'));
                $this->addToTemplate($templateid, 'ARCHIVELIST_FOOTER', postVar('ARCHIVELIST_FOOTER'));
+               $this->addToTemplate($templateid, 'BLOGLIST_HEADER', postVar('BLOGLIST_HEADER'));
+               $this->addToTemplate($templateid, 'BLOGLIST_LISTITEM', postVar('BLOGLIST_LISTITEM'));
+               $this->addToTemplate($templateid, 'BLOGLIST_FOOTER', postVar('BLOGLIST_FOOTER'));
                $this->addToTemplate($templateid, 'CATLIST_HEADER', postVar('CATLIST_HEADER'));
                $this->addToTemplate($templateid, 'CATLIST_LISTITEM', postVar('CATLIST_LISTITEM'));
                $this->addToTemplate($templateid, 'CATLIST_FOOTER', postVar('CATLIST_FOOTER'));
@@ -3675,6 +3922,9 @@ selector();
 
        }
 
+       /**
+        * @todo document this
+        */
        function addToTemplate($id, $partname, $content) {
                $partname = addslashes($partname);
                $content = addslashes($content);
@@ -3686,10 +3936,13 @@ selector();
 
                $query = 'INSERT INTO '.sql_table('template')." (tdesc, tpartname, tcontent) "
                           . "VALUES ($id, '$partname', '$content')";
-               mysql_query($query) or die("Query error: " . mysql_error());
+               sql_query($query) or die("Query error: " . mysql_error());
                return mysql_insert_id();
        }
 
+       /**
+        * @todo document this
+        */
        function action_templatedelete() {
                global $member, $manager;
 
@@ -3707,7 +3960,7 @@ selector();
                        <h2><?php echo _DELETE_CONFIRM?></h2>
 
                        <p>
-                       <?php echo _CONFIRMTXT_TEMPLATE?><b><?php echo $name?></b> (<?php echo  htmlspecialchars($desc) ?>)
+                       <?php echo _CONFIRMTXT_TEMPLATE?><b><?php echo htmlspecialchars($name)?></b> (<?php echo  htmlspecialchars($desc) ?>)
                        </p>
 
                        <form method="post" action="index.php"><div>
@@ -3720,6 +3973,9 @@ selector();
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_templatedeleteconfirm() {
                global $member, $manager;
 
@@ -3740,6 +3996,9 @@ selector();
                $this->action_templateoverview();
        }
 
+       /**
+        * @todo document this
+        */
        function action_templatenew() {
                global $member;
 
@@ -3759,6 +4018,9 @@ selector();
                $this->action_templateoverview();
        }
 
+       /**
+        * @todo document this
+        */
        function action_templateclone() {
                global $member;
 
@@ -3793,6 +4055,9 @@ selector();
                $this->action_templateoverview();
        }
 
+       /**
+        * @todo document this
+        */
        function action_skinoverview() {
                global $member, $manager;
 
@@ -3837,6 +4102,9 @@ selector();
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_skinnew() {
                global $member;
 
@@ -3856,6 +4124,9 @@ selector();
                $this->action_skinoverview();
        }
 
+       /**
+        * @todo document this
+        */
        function action_skinedit() {
                global $member, $manager;
 
@@ -3885,7 +4156,33 @@ selector();
                        <li><a tabindex="75" href="index.php?action=skinedittype&amp;skinid=<?php echo  $skinid ?>&amp;type=imagepopup"><?php echo _SKIN_PART_POPUP?></a> <?php help('skinpartimagepopup')?></li>
                </ul>
 
-               <h3><?php echo _SKIN_GENSETTINGS_TITLE?></h3>
+               <?php
+
+               $query = "SELECT stype FROM " . sql_table('skin') . " WHERE stype NOT IN ('index', 'item', 'error', 'search', 'archive', 'archivelist', 'imagepopup', 'member') and sdesc = " . $skinid;
+               $res = sql_query($query);
+
+               echo '<h3>' . _SKIN_PARTS_SPECIAL . '</h3>';
+               echo '<form method="get" action="index.php">' . "\r\n";
+               echo '<input type="hidden" name="action" value="skinedittype" />' . "\r\n";
+               echo '<input type="hidden" name="skinid" value="' . $skinid . '" />' . "\r\n";
+               echo '<input name="type" tabindex="89" size="20" maxlength="20" />' . "\r\n";
+               echo '<input type="submit" tabindex="140" value="' . _SKIN_CREATE . '" onclick="return checkSubmit();" />' . "\r\n";
+               echo '</form>' . "\r\n";
+
+               if ($res && mysql_num_rows($res) > 0) {
+                       echo '<ul>';
+                       $tabstart = 75;
+
+                       while ($row = mysql_fetch_assoc($res)) {
+                               echo '<li><a tabindex="' . ($tabstart++) . '" href="index.php?action=skinedittype&amp;skinid=' . $skinid . '&amp;type=' . htmlspecialchars(strtolower($row['stype'])) . '">' . htmlspecialchars(ucfirst($row['stype'])) . '</a> (<a tabindex="' . ($tabstart++) . '" href="index.php?action=skinremovetype&amp;skinid=' . $skinid . '&amp;type=' . htmlspecialchars(strtolower($row['stype'])) . '">remove</a>)</li>';
+                       }
+
+                       echo '</ul>';
+               }
+
+               ?>
+
+               <h3><?php echo _SKIN_GENSETTINGS_TITLE; ?></h3>
                <form method="post" action="index.php">
                <div>
 
@@ -3919,6 +4216,9 @@ selector();
                <?php           $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_skineditgeneral() {
                global $member;
 
@@ -3951,6 +4251,9 @@ selector();
 
        }
 
+       /**
+        * @todo document this
+        */
        function action_skinedittype($msg = '') {
                global $member, $manager;
 
@@ -3959,6 +4262,13 @@ selector();
 
                $member->isAdmin() or $this->disallow();
 
+               $type = trim($type);
+               $type = strtolower($type);
+
+               if (!isValidShortName($type)) {
+                       $this->error(_ERROR_SKIN_PARTS_SPECIAL_FORMAT);
+               }
+
                $skin =& new SKIN($skinid);
 
                $friendlyNames = SKIN::getFriendlyNames();
@@ -3967,7 +4277,7 @@ selector();
                ?>
                <p>(<a href="index.php?action=skinoverview"><?php echo _SKIN_GOBACK?></a>)</p>
 
-               <h2><?php echo _SKIN_EDITPART_TITLE?> '<?php echo  $skin->getName() ?>': <?php echo  $friendlyNames[$type] ?></h2>
+               <h2><?php echo _SKIN_EDITPART_TITLE?> '<?php echo htmlspecialchars($skin->getName()) ?>': <?php echo htmlspecialchars(isset($friendlyNames[$type]) ? $friendlyNames[$type] : ucfirst($type)); ?></h2>
 
                <?php                   if ($msg) echo "<p>"._MESSAGE.": $msg</p>";
                ?>
@@ -3983,8 +4293,12 @@ selector();
 
                <input type="submit" value="<?php echo _SKIN_UPDATE_BTN?>" onclick="return checkSubmit();" />
                <input type="reset" value="<?php echo _SKIN_RESET_BTN?>" />
-               (skin type: <?php echo  $friendlyNames[$type] ?>)
-               <?php help('skinpart' . $type);?>
+               (skin type: <?php echo htmlspecialchars(isset($friendlyNames[$type]) ? $friendlyNames[$type] : ucfirst($type)); ?>)
+               <?php if (in_array($type, array('index', 'item', 'archivelist', 'archive', 'search', 'error', 'member', 'imagepopup'))) {
+                       help('skinpart' . $type);
+               } else {
+                       help('skinpartspecial');
+               }?>
                <br />
 
                <textarea class="skinedit" tabindex="10" rows="20" cols="80" name="content"><?php echo  htmlspecialchars($skin->getContent($type)) ?></textarea>
@@ -3992,7 +4306,7 @@ selector();
                <br />
                <input type="submit" tabindex="20" value="<?php echo _SKIN_UPDATE_BTN?>" onclick="return checkSubmit();" />
                <input type="reset" value="<?php echo _SKIN_RESET_BTN?>" />
-               (skin type: <?php echo  $friendlyNames[$type] ?>)
+               (skin type: <?php echo htmlspecialchars(isset($friendlyNames[$type]) ? $friendlyNames[$type] : ucfirst($type)); ?>)
 
                <br /><br />
                <?php echo _SKIN_ALLOWEDVARS?>
@@ -4030,6 +4344,9 @@ selector();
                <?php           $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_skinupdate() {
                global $member;
 
@@ -4045,6 +4362,9 @@ selector();
                $this->action_skinedittype(_SKIN_UPDATED);
        }
 
+       /**
+        * @todo document this
+        */
        function action_skindelete() {
                global $member, $manager, $CONF;
 
@@ -4060,7 +4380,7 @@ selector();
                $query = 'SELECT bname FROM '.sql_table('blog').' WHERE bdefskin=' . $skinid;
                $r = sql_query($query);
                if ($o = mysql_fetch_object($r))
-                       $this->error(_ERROR_SKINDEFDELETE . $o->bname);
+                       $this->error(_ERROR_SKINDEFDELETE . htmlspecialchars($o->bname));
 
                $this->pagehead();
 
@@ -4072,7 +4392,7 @@ selector();
                        <h2><?php echo _DELETE_CONFIRM?></h2>
 
                        <p>
-                               <?php echo _CONFIRMTXT_SKIN?><b><?php echo  $name ?></b> (<?php echo  htmlspecialchars($desc)?>)
+                               <?php echo _CONFIRMTXT_SKIN?><b><?php echo htmlspecialchars($name) ?></b> (<?php echo  htmlspecialchars($desc)?>)
                        </p>
 
                        <form method="post" action="index.php"><div>
@@ -4085,6 +4405,9 @@ selector();
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_skindeleteconfirm() {
                global $member, $CONF, $manager;
 
@@ -4115,14 +4438,91 @@ selector();
                $this->action_skinoverview();
        }
 
-       function action_skinclone() {
-               global $member;
+       /**
+        * @todo document this
+        */
+       function action_skinremovetype() {
+               global $member, $manager, $CONF;
 
                $skinid = intRequestVar('skinid');
+               $skintype = requestVar('type');
+
+               if (!isValidShortName($skintype)) {
+                       $this->error(_ERROR_SKIN_PARTS_SPECIAL_DELETE);
+               }
 
                $member->isAdmin() or $this->disallow();
 
-               // 1. read skin to clone
+               // don't allow default skinparts to be deleted
+               if (in_array($skintype, array('index', 'item', 'archivelist', 'archive', 'search', 'error', 'member', 'imagepopup'))) {
+                       $this->error(_ERROR_SKIN_PARTS_SPECIAL_DELETE);
+               }
+
+               $this->pagehead();
+
+               $skin =& new SKIN($skinid);
+               $name = $skin->getName();
+               $desc = $skin->getDescription();
+
+               ?>
+                       <h2><?php echo _DELETE_CONFIRM?></h2>
+
+                       <p>
+                               <?php echo _CONFIRMTXT_SKIN_PARTS_SPECIAL; ?> <b><?php echo htmlspecialchars($skintype); ?> (<?php echo htmlspecialchars($name); ?>)</b> (<?php echo  htmlspecialchars($desc)?>)
+                       </p>
+
+                       <form method="post" action="index.php"><div>
+                               <input type="hidden" name="action" value="skinremovetypeconfirm" />
+                               <?php $manager->addTicketHidden() ?>
+                               <input type="hidden" name="skinid" value="<?php echo $skinid; ?>" />
+                               <input type="hidden" name="type" value="<?php echo htmlspecialchars($skintype); ?>" />
+                               <input type="submit" tabindex="10" value="<?php echo _DELETE_CONFIRM_BTN?>" />
+                       </div></form>
+               <?php
+               $this->pagefoot();
+       }
+
+       /**
+        * @todo document this
+        */
+       function action_skinremovetypeconfirm() {
+               global $member, $CONF, $manager;
+
+               $skinid = intRequestVar('skinid');
+               $skintype = requestVar('type');
+
+               if (!isValidShortName($skintype)) {
+                       $this->error(_ERROR_SKIN_PARTS_SPECIAL_DELETE);
+               }
+
+               $member->isAdmin() or $this->disallow();
+
+               // don't allow default skinparts to be deleted
+               if (in_array($skintype, array('index', 'item', 'archivelist', 'archive', 'search', 'error', 'member', 'imagepopup'))) {
+                       $this->error(_ERROR_SKIN_PARTS_SPECIAL_DELETE);
+               }
+
+               $manager->notify('PreDeleteSkinPart', array('skinid' => $skinid, 'skintype' => $skintype));
+
+               // delete part
+               sql_query('DELETE FROM '.sql_table('skin').' WHERE sdesc=' . $skinid . ' AND stype=\'' . $skintype . '\'');
+
+               $manager->notify('PostDeleteSkinPart', array('skinid' => $skinid, 'skintype' => $skintype));
+
+               $this->action_skinedit();
+       }
+
+       /**
+        * @todo document this
+        */
+       function action_skinclone() {
+               global $member;
+
+               $skinid = intRequestVar('skinid');
+
+               $member->isAdmin() or $this->disallow();
+
+               // 1. read skin to clone
                $skin =& new SKIN($skinid);
 
                $name = "clone_" . $skin->getName();
@@ -4146,6 +4546,7 @@ selector();
 
 
                // 3. clone
+               /*
                $this->skinclonetype($skin, $newid, 'index');
                $this->skinclonetype($skin, $newid, 'item');
                $this->skinclonetype($skin, $newid, 'archivelist');
@@ -4154,11 +4555,21 @@ selector();
                $this->skinclonetype($skin, $newid, 'error');
                $this->skinclonetype($skin, $newid, 'member');
                $this->skinclonetype($skin, $newid, 'imagepopup');
+               */
+
+               $query = "SELECT stype FROM " . sql_table('skin') . " WHERE sdesc = " . $skinid;
+               $res = sql_query($query);
+               while ($row = mysql_fetch_assoc($res)) {
+                       $this->skinclonetype($skin, $newid, $row['stype']);
+               }
 
                $this->action_skinoverview();
 
        }
 
+       /**
+        * @todo document this
+        */
        function skinclonetype($skin, $newid, $type) {
                $newid = intval($newid);
                $content = $skin->getContent($type);
@@ -4168,6 +4579,9 @@ selector();
                }
        }
 
+       /**
+        * @todo document this
+        */
        function action_settingsedit() {
                global $member, $manager, $CONF, $DIR_NUCLEUS, $DIR_MEDIA;
 
@@ -4430,6 +4844,9 @@ selector();
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_settingsupdate() {
                global $member, $CONF;
 
@@ -4482,7 +4899,9 @@ selector();
 
        }
 
-
+       /**
+        * @todo document this
+        */
        function updateConfig($name, $val) {
                $name = addslashes($name);
                $val = trim(addslashes($val));
@@ -4491,13 +4910,14 @@ selector();
                           . " SET value='$val'"
                           . " WHERE name='$name'";
 
-               mysql_query($query) or die("Query error: " . mysql_error());
+               sql_query($query) or die("Query error: " . mysql_error());
                return mysql_insert_id();
        }
 
        /**
-         * Error message
-         */
+        * Error message
+        * @param string $msg message that will be shown
+        */
        function error($msg) {
                $this->pagehead();
                ?>
@@ -4509,13 +4929,18 @@ selector();
                exit;
        }
 
+       /**
+        * @todo document this
+        */
        function disallow() {
                ACTIONLOG::add(WARNING, _ACTIONLOG_DISALLOWED . serverVar('REQUEST_URI'));
 
                $this->error(_ERROR_DISALLOWED);
        }
 
-
+       /**
+        * @todo document this
+        */
        function pagehead($extrahead = '') {
                global $member, $nucleus, $CONF, $manager;
 
@@ -4567,14 +4992,24 @@ selector();
 
                        echo '<br />(';
 
+                       // Note(JP): disabled code name description
+/*
+                       if ($member->isLoggedIn() && $member->isAdmin())
+                               echo '<a href="http://nucleuscms.org/version.php?v=',getNucleusVersion(),'&amp;pl=',getNucleusPatchLevel(),'" title="Check for upgrade">Nucleus CMS ', $nucleus['version'], ' &quot;', $nucleus['codename'], '&quot;</a>';
+                       else
+                               echo 'Nucleus CMS ', $nucleus['version'], ' &quot;', $nucleus['codename'], '&quot;';
+*/
                        if ($member->isLoggedIn() && $member->isAdmin())
-                               echo '<a href="http://nucleuscms.org/version.php?v=',getNucleusVersion(),'&amp;pl=',getNucleusPatchLevel(),'" title="Check for upgrade">Nucleus CMS ', $nucleus['version'], '</a>';
+                               echo '<a href="http://nucleuscms.org/version.php?v=',getNucleusVersion(),'&amp;pl=',getNucleusPatchLevel(),'" title="Check for upgrade">Nucleus CMS ', $nucleus['version'], ' </a>';
                        else
-                               echo 'Nucleus CMS ' , $nucleus['version'];
+                               echo 'Nucleus CMS ', $nucleus['version'];
                        echo ')';
                echo '</div>';
        }
 
+       /**
+        * @todo document this
+        */
        function pagefoot() {
                global $action, $member, $manager;
 
@@ -4595,7 +5030,7 @@ selector();
                        <?php           }
                ?>
                        <div class="foot">
-                               <a href="http://nucleuscms.org/">Nucleus CMS</a> &copy; 2002-2005 The Nucleus Group
+                               <a href="http://nucleuscms.org/">Nucleus CMS</a> &copy; 2002-<?php echo date('Y'); ?> The Nucleus Group
                                -
                                <a href="http://nucleuscms.org/donate.php">Donate!</a>
                        </div>
@@ -4706,7 +5141,9 @@ selector();
                        </html>
                <?php   }
 
-
+       /**
+        * @todo document this
+        */
        function action_regfile() {
                global $member, $CONF;
 
@@ -4731,6 +5168,9 @@ selector();
                echo '"contexts"=hex:31';
        }
 
+       /**
+        * @todo document this
+        */
        function action_bookmarklet() {
                global $member, $manager;
 
@@ -4796,7 +5236,9 @@ selector();
 
        }
 
-
+       /**
+        * @todo document this
+        */
        function action_actionlog() {
                global $member, $manager;
 
@@ -4822,7 +5264,9 @@ selector();
 
        }
 
-
+       /**
+        * @todo document this
+        */
        function action_banlist() {
                global $member, $manager;
 
@@ -4853,7 +5297,9 @@ selector();
 
        }
 
-
+       /**
+        * @todo document this
+        */
        function action_banlistdelete() {
                global $member, $manager;
 
@@ -4899,6 +5345,9 @@ selector();
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_banlistdeleteconfirm() {
                global $member, $manager;
 
@@ -4942,10 +5391,16 @@ selector();
 
        }
 
+       /**
+        * @todo document this
+        */
        function action_banlistnewfromitem() {
                $this->action_banlistnew(getBlogIDFromItemID(intRequestVar('itemid')));
        }
 
+       /**
+        * @todo document this
+        */
        function action_banlistnew($blogid = '') {
                global $member, $manager;
 
@@ -5016,6 +5471,9 @@ selector();
                <?php           $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_banlistadd() {
                global $member;
 
@@ -5049,6 +5507,9 @@ selector();
 
        }
 
+       /**
+        * @todo document this
+        */
        function action_clearactionlog() {
                global $member;
 
@@ -5059,6 +5520,9 @@ selector();
                $this->action_manage(_MSG_ACTIONLOGCLEARED);
        }
 
+       /**
+        * @todo document this
+        */
        function action_backupoverview() {
                global $member, $manager;
 
@@ -5108,6 +5572,9 @@ selector();
                <?php           $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_backupcreate() {
                global $member, $DIR_LIBS;
 
@@ -5126,7 +5593,9 @@ selector();
                exit;
        }
 
-
+       /**
+        * @todo document this
+        */
        function action_backuprestore() {
                global $member, $DIR_LIBS;
 
@@ -5152,7 +5621,9 @@ selector();
 
        }
 
-
+       /**
+        * @todo document this
+        */
        function action_pluginlist() {
                global $member, $manager;
 
@@ -5195,7 +5666,8 @@ selector();
                                        if (ereg('^NP_(.*)\.php$',$filename,$matches)) {
                                                $name = $matches[1];
                                                // only show in list when not yet installed
-                                               if (mysql_num_rows(sql_query('SELECT * FROM '.sql_table('plugin').' WHERE pfile="NP_'.addslashes($name).'"')) == 0)
+                                               $res = sql_query('SELECT * FROM '.sql_table('plugin').' WHERE pfile="NP_'.addslashes($name).'"');
+                                               if (mysql_num_rows($res) == 0)
                                                        array_push($candidates,$name);
                                        }
                                }
@@ -5225,6 +5697,9 @@ selector();
                $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_pluginhelp() {
                global $member, $manager, $DIR_PLUGINS, $CONF;
 
@@ -5258,7 +5733,9 @@ selector();
                $this->pagefoot();
        }
 
-
+       /**
+        * @todo document this
+        */
        function action_pluginadd() {
                global $member, $manager, $DIR_PLUGINS;
 
@@ -5270,26 +5747,11 @@ selector();
                if ($manager->pluginInstalled($name))
                        $this->error(_ERROR_DUPPLUGIN);
                if (!checkPlugin($name))
-                       $this->error(_ERROR_PLUGFILEERROR . ' (' . $name . ')');
-
-               // check if the plugin dependency is met
-               $plugin =& $manager->getPlugin($name);
-               $pluginList = $plugin->getPluginDep();
-               foreach ($pluginList as $pluginName)
-               {
-
-                       $res = sql_query('SELECT * FROM '.sql_table('plugin') . ' WHERE pfile="' . $pluginName . '"');
-                       if (mysql_num_rows($res) == 0)
-                       {
-                               // uninstall plugin again...
-                               $this->deleteOnePlugin($plugin->getID());
-
-                               $this->error(_ERROR_INSREQPLUGIN . $pluginName);
-                       }
-               }
+                       $this->error(_ERROR_PLUGFILEERROR . ' (' . htmlspecialchars($name) . ')');
 
                // get number of currently installed plugins
-               $numCurrent = mysql_num_rows(sql_query('SELECT * FROM '.sql_table('plugin')));
+               $res = sql_query('SELECT * FROM '.sql_table('plugin'));
+               $numCurrent = mysql_num_rows($res);
 
                // plugin will be added as last one in the list
                $newOrder = $numCurrent + 1;
@@ -5306,17 +5768,17 @@ selector();
                sql_query($query);
                $iPid = mysql_insert_id();
 
-               // need to update the plugin object's pid since we didn't have it above when it's first create....
-               $plugin->plugid = $iPid;
-
                $manager->clearCachedInfo('installedPlugins');
 
-               // call the install method of the plugin
+               // Load the plugin for condition checking and instalation
+               $plugin =& $manager->getPlugin($name);
+
+               // check if it got loaded (could have failed)
                if (!$plugin)
                {
                        sql_query('DELETE FROM ' . sql_table('plugin') . ' WHERE pid='. intval($iPid));
                        $manager->clearCachedInfo('installedPlugins');
-                       $this->error('Plugin could not be loaded, or does not support certain features that are required for it to run on your Nucleus installation (you might want to check the <a href="?action=actionlog">actionlog</a> for more info)');
+                       $this->error(_ERROR_PLUGIN_LOAD);
                }
 
                // check if plugin needs a newer Nucleus version
@@ -5326,7 +5788,7 @@ selector();
                        $this->deleteOnePlugin($plugin->getID());
 
                        // ...and show error
-                       $this->error(_ERROR_NUCLEUSVERSIONREQ . $plugin->getMinNucleusVersion());
+                       $this->error(_ERROR_NUCLEUSVERSIONREQ . htmlspecialchars($plugin->getMinNucleusVersion()));
                }
 
                // check if plugin needs a newer Nucleus version
@@ -5336,9 +5798,24 @@ selector();
                        $this->deleteOnePlugin($plugin->getID());
 
                        // ...and show error
-                       $this->error(_ERROR_NUCLEUSVERSIONREQ . $plugin->getMinNucleusVersion() . ' patch ' . $plugin->getMinNucleusPatchLevel());
+                       $this->error(_ERROR_NUCLEUSVERSIONREQ . htmlspecialchars( $plugin->getMinNucleusVersion() . ' patch ' . $plugin->getMinNucleusPatchLevel() ) );
                }
 
+               $pluginList = $plugin->getPluginDep();
+               foreach ($pluginList as $pluginName)
+               {
+
+                       $res = sql_query('SELECT * FROM '.sql_table('plugin') . ' WHERE pfile="' . $pluginName . '"');
+                       if (mysql_num_rows($res) == 0)
+                       {
+                               // uninstall plugin again...
+                               $this->deleteOnePlugin($plugin->getID());
+
+                               $this->error(_ERROR_INSREQPLUGIN . htmlspecialchars($pluginName));
+                       }
+               }
+
+               // call the install method of the plugin
                $plugin->install();
 
                $manager->notify(
@@ -5352,6 +5829,9 @@ selector();
                $this->action_pluginupdate();
        }
 
+       /**
+        * @todo document this
+        */
        function action_pluginupdate() {
                global $member, $manager;
 
@@ -5377,6 +5857,9 @@ selector();
                $this->action_pluginlist();
        }
 
+       /**
+        * @todo document this
+        */
        function action_plugindelete() {
                global $member, $manager;
 
@@ -5403,6 +5886,9 @@ selector();
                <?php           $this->pagefoot();
        }
 
+       /**
+        * @todo document this
+        */
        function action_plugindeleteconfirm() {
                global $member, $manager;
 
@@ -5419,6 +5905,9 @@ selector();
                $this->action_pluginlist();
        }
 
+       /**
+        * @todo document this
+        */
        function deleteOnePlugin($pid, $callUninstall = 0) {
                global $manager;
 
@@ -5471,7 +5960,8 @@ selector();
                        sql_query('DELETE FROM '.sql_table('plugin_option').' WHERE oid in ('.implode(',',$aOIDs).')');
 
                // update order numbers
-               $o = mysql_fetch_object(sql_query('SELECT porder FROM '.sql_table('plugin').' WHERE pid=' . $pid));
+               $res = sql_query('SELECT porder FROM '.sql_table('plugin').' WHERE pid=' . $pid);
+               $o = mysql_fetch_object($res);
                sql_query('UPDATE '.sql_table('plugin').' SET porder=(porder - 1) WHERE porder>'.$o->porder);
 
                // delete row
@@ -5483,6 +5973,9 @@ selector();
                return '';
        }
 
+       /**
+        * @todo document this
+        */
        function action_pluginup() {
                global $member, $manager;
 
@@ -5495,7 +5988,8 @@ selector();
                        $this->error(_ERROR_NOSUCHPLUGIN);
 
                // 1. get old order number
-               $o = mysql_fetch_object(sql_query('SELECT porder FROM '.sql_table('plugin').' WHERE pid='.$plugid));
+               $res = sql_query('SELECT porder FROM '.sql_table('plugin').' WHERE pid='.$plugid);
+               $o = mysql_fetch_object($res);
                $oldOrder = $o->porder;
 
                // 2. calculate new order number
@@ -5508,6 +6002,9 @@ selector();
                $this->action_pluginlist();
        }
 
+       /**
+        * @todo document this
+        */
        function action_plugindown() {
                global $member, $manager;
 
@@ -5519,10 +6016,12 @@ selector();
                        $this->error(_ERROR_NOSUCHPLUGIN);
 
                // 1. get old order number
-               $o = mysql_fetch_object(sql_query('SELECT porder FROM '.sql_table('plugin').' WHERE pid='.$plugid));
+               $res = sql_query('SELECT porder FROM '.sql_table('plugin').' WHERE pid='.$plugid);
+               $o = mysql_fetch_object($res);
                $oldOrder = $o->porder;
 
-               $maxOrder = mysql_num_rows(sql_query('SELECT * FROM '.sql_table('plugin')));
+               $res = sql_query('SELECT * FROM '.sql_table('plugin'));
+               $maxOrder = mysql_num_rows($res);
 
                // 2. calculate new order number
                $newOrder = ($oldOrder < $maxOrder) ? ($oldOrder + 1) : $maxOrder;
@@ -5534,6 +6033,9 @@ selector();
                $this->action_pluginlist();
        }
 
+       /**
+        * @todo document this
+        */
        function action_pluginoptions($message = '') {
                global $member, $manager;
 
@@ -5603,6 +6105,9 @@ selector();
 
        }
 
+       /**
+        * @todo document this
+        */
        function action_pluginoptionsupdate() {
                global $member, $manager;
 
@@ -5622,8 +6127,9 @@ selector();
        }
 
        /**
-         * @static
-         */
+        * @static
+        * @todo document this
+        */
        function _insertPluginOptions($context, $contextid = 0) {
                // get all current values for this contextid
                // (note: this might contain doubles for overlapping contextids)
@@ -5681,893 +6187,39 @@ selector();
 
        }
 
-       /* helper functions to create option forms etc. */
-       function input_yesno($name, $checkedval,$tabindex = 0, $value1 = 1, $value2 = 0, $yesval = _YES, $noval = _NO) {
+       /**
+        * Helper functions to create option forms etc.
+        * @todo document parameters
+        */
+       function input_yesno($name, $checkedval,$tabindex = 0, $value1 = 1, $value2 = 0, $yesval = _YES, $noval = _NO, $isAdmin = 0) {
                $id = htmlspecialchars($name);
                $id = str_replace('[','-',$id);
                $id = str_replace(']','-',$id);
                $id1 = $id . htmlspecialchars($value1);
                $id2 = $id . htmlspecialchars($value2);
 
-               echo '<input type="radio" name="', htmlspecialchars($name),'" value="', htmlspecialchars($value1),'" ';
+               if ($name=="admin") {
+                       echo '<input onclick="selectCanLogin(true);" type="radio" name="', htmlspecialchars($name),'" value="', htmlspecialchars($value1),'" ';
+               } else {
+                       echo '<input type="radio" name="', htmlspecialchars($name),'" value="', htmlspecialchars($value1),'" ';
+               }
+
                        if ($checkedval == $value1)
                                echo "tabindex='$tabindex' checked='checked'";
                        echo ' id="'.$id1.'" /><label for="'.$id1.'">' . $yesval . '</label>';
                echo ' ';
-               echo '<input type="radio" name="', htmlspecialchars($name),'" value="', htmlspecialchars($value2),'" ';
+               if ($name=="admin") {
+                       echo '<input onclick="selectCanLogin(false);" type="radio" name="', htmlspecialchars($name),'" value="', htmlspecialchars($value2),'" ';
+               } else {
+                       echo '<input type="radio" name="', htmlspecialchars($name),'" value="', htmlspecialchars($value2),'" ';
+               }
                        if ($checkedval != $value1)
                                echo "tabindex='$tabindex' checked='checked'";
+                       if ($isAdmin && $name=="canlogin")
+                               echo " disabled='true'";
                        echo ' id="'.$id2.'" /><label for="'.$id2.'">' . $noval . '</label>';
        }
 
-
-
 } // class ADMIN
 
-class ENCAPSULATE {
-       /**
-         * Uses $call to call a function using parameters $params
-         * This function should return the amount of entries shown.
-         * When entries are show, batch operation handlers are shown too.
-         * When no entries were shown, $errormsg is used to display an error
-         *
-         * Passes on the amount of results found (for further encapsulation)
-         */
-       function doEncapsulate($call, $params, $errorMessage = 'No entries') {
-               // start output buffering
-               ob_start();
-
-               $nbOfRows = call_user_func_array($call, $params);
-
-               // get list contents and stop buffering
-               $list = ob_get_contents();
-               ob_end_clean();
-
-               if ($nbOfRows > 0) {
-                       $this->showHead();
-                       echo $list;
-                       $this->showFoot();
-               } else {
-                       echo $errorMessage;
-               }
-
-               return $nbOfRows;
-       }
-}
-
-
-/**
-  * A class used to encapsulate a list of some sort inside next/prev buttons
-  */
-class NAVLIST extends ENCAPSULATE {
-
-       function NAVLIST($action, $start, $amount, $minamount, $maxamount, $blogid, $search, $itemid) {
-               $this->action = $action;
-               $this->start = $start;
-               $this->amount = $amount;
-               $this->minamount = $minamount;
-               $this->maxamount = $maxamount;
-               $this->blogid = $blogid;
-               $this->search = $search;
-               $this->itemid = $itemid;
-       }
-
-       function showBatchList($batchtype, $query, $type, $template, $errorMessage = _LISTS_NOMORE) {
-               $batch =& new BATCH($batchtype);
-
-               $this->doEncapsulate(
-                               array(&$batch, 'showlist'),
-                               array(&$query, $type, $template),
-                               $errorMessage
-               );
-
-       }
-
-
-       function showHead() {
-               $this->showNavigation();
-       }
-       function showFoot() {
-               $this->showNavigation();
-       }
-
-       /**
-         * Displays a next/prev bar for long tables
-         */
-       function showNavigation() {
-               $action = $this->action;
-               $start = $this->start;
-               $amount = $this->amount;
-               $minamount = $this->minamount;
-               $maxamount = $this->maxamount;
-               $blogid = $this->blogid;
-               $search = $this->search;
-               $itemid = $this->itemid;
-
-               $prev = $start - $amount;
-               if ($prev < $minamount) $prev=$minamount;
-
-               // maxamount not used yet
-       //      if ($start + $amount <= $maxamount)
-                       $next = $start + $amount;
-       //      else
-       //              $next = $start;
-
-       ?>
-       <table class="navigation">
-       <tr><td>
-               <form method="post" action="index.php"><div>
-               <input type="submit" value="&lt;&lt; <?php echo  _LISTS_PREV?>" />
-               <input type="hidden" name="blogid" value="<?php echo  $blogid; ?>" />
-               <input type="hidden" name="itemid" value="<?php echo  $itemid; ?>" />
-               <input type="hidden" name="action" value="<?php echo  $action; ?>" />
-               <input type="hidden" name="amount" value="<?php echo  $amount; ?>" />
-               <input type="hidden" name="search" value="<?php echo  $search; ?>" />
-               <input type="hidden" name="start" value="<?php echo  $prev; ?>" />
-               </div></form>
-       </td><td>
-               <form method="post" action="index.php"><div>
-               <input type="hidden" name="blogid" value="<?php echo  $blogid; ?>" />
-               <input type="hidden" name="itemid" value="<?php echo  $itemid; ?>" />
-               <input type="hidden" name="action" value="<?php echo  $action; ?>" />
-               <input name="amount" size="3" value="<?php echo  $amount; ?>" /> <?php echo _LISTS_PERPAGE?>
-               <input type="hidden" name="start" value="<?php echo  $start; ?>" />
-               <input type="hidden" name="search" value="<?php echo  $search; ?>" />
-               <input type="submit" value="&gt; <?php echo _LISTS_CHANGE?>" />
-               </div></form>
-       </td><td>
-               <form method="post" action="index.php"><div>
-               <input type="hidden" name="blogid" value="<?php echo  $blogid; ?>" />
-               <input type="hidden" name="itemid" value="<?php echo  $itemid; ?>" />
-               <input type="hidden" name="action" value="<?php echo  $action; ?>" />
-               <input type="hidden" name="amount" value="<?php echo  $amount; ?>" />
-               <input type="hidden" name="start" value="0" />
-               <input type="text" name="search" value="<?php echo  $search; ?>" size="7" />
-               <input type="submit" value="&gt; <?php echo  _LISTS_SEARCH?>" />
-               </div></form>
-       </td><td>
-               <form method="post" action="index.php"><div>
-               <input type="submit" value="<?php echo _LISTS_NEXT?> &gt; &gt;" />
-               <input type="hidden" name="search" value="<?php echo  $search; ?>" />
-               <input type="hidden" name="blogid" value="<?php echo  $blogid; ?>" />
-               <input type="hidden" name="itemid" value="<?php echo  $itemid; ?>" />
-               <input type="hidden" name="action" value="<?php echo  $action; ?>" />
-               <input type="hidden" name="amount" value="<?php echo  $amount; ?>" />
-               <input type="hidden" name="start" value="<?php echo  $next; ?>" />
-               </div></form>
-       </td></tr>
-       </table>
-       <?php   }
-
-
-}
-
-/**
- * A class used to encapsulate a list of some sort in a batch selection
- */
-class BATCH extends ENCAPSULATE {
-       function BATCH($type) {
-               $this->type = $type;
-       }
-
-       function showHead() {
-               ?>
-                       <form method="post" action="index.php">
-               <?php
-// TODO: get a list op operations above the list too
-// (be careful not to use the same names for the select...)
-//             $this->showOperationList();
-       }
-
-       function showFoot() {
-               $this->showOperationList();
-               ?>
-                       </form>
-               <?php   }
-
-       function showOperationList() {
-               global $manager;
-               ?>
-               <div class="batchoperations">
-                       <?php echo _BATCH_WITH_SEL ?>
-                       <select name="batchaction">
-                       <?php                           $options = array();
-                               switch($this->type) {
-                                       case 'item':
-                                               $options = array(
-                                                       'delete'        => _BATCH_ITEM_DELETE,
-                                                       'move'          => _BATCH_ITEM_MOVE
-                                               );
-                                               break;
-                                       case 'member':
-                                               $options = array(
-                                                       'delete'        => _BATCH_MEMBER_DELETE,
-                                                       'setadmin'      => _BATCH_MEMBER_SET_ADM,
-                                                       'unsetadmin' => _BATCH_MEMBER_UNSET_ADM
-                                               );
-                                               break;
-                                       case 'team':
-                                               $options = array(
-                                                       'delete'        => _BATCH_TEAM_DELETE,
-                                                       'setadmin'      => _BATCH_TEAM_SET_ADM,
-                                                       'unsetadmin' => _BATCH_TEAM_UNSET_ADM,
-                                               );
-                                               break;
-                                       case 'category':
-                                               $options = array(
-                                                       'delete'        => _BATCH_CAT_DELETE,
-                                                       'move'          => _BATCH_CAT_MOVE,
-                                               );
-                                               break;
-                                       case 'comment':
-                                               $options = array(
-                                                       'delete'        => _BATCH_COMMENT_DELETE,
-                                               );
-                                       break;
-                               }
-                               foreach ($options as $option => $label) {
-                                       echo '<option value="',$option,'">',$label,'</option>';
-                               }
-                       ?>
-                       </select>
-                       <input type="hidden" name="action" value="batch<?php echo $this->type?>" />
-                       <?php
-                               $manager->addTicketHidden();
-
-                               // add hidden fields for 'team' and 'comment' batchlists
-                               if ($this->type == 'team')
-                               {
-                                       echo '<input type="hidden" name="blogid" value="',intRequestVar('blogid'),'" />';
-                               }
-                               if ($this->type == 'comment')
-                               {
-                                       echo '<input type="hidden" name="itemid" value="',intRequestVar('itemid'),'" />';
-                               }
-
-                               echo '<input type="submit" value="',_BATCH_EXEC,'" />';
-                       ?>(
-                        <a href="" onclick="if (event &amp;&amp; event.preventDefault) event.preventDefault(); return batchSelectAll(1); "><?php echo _BATCH_SELECTALL?></a> -
-                        <a href="" onclick="if (event &amp;&amp; event.preventDefault) event.preventDefault(); return batchSelectAll(0); "><?php echo _BATCH_DESELECTALL?></a>
-                       )
-               </div>
-               <?php   }
-
-       // shortcut :)
-       function showList($query, $type, $template, $errorMessage = _LISTS_NOMORE) {
-               return $this->doEncapsulate(    'showlist',
-                                                                       array($query, $type, $template),
-                                                                       $errorMessage
-                                                               );
-       }
-
-}
-
-
-
-// can take either an array of objects, or an SQL query
-function showlist($query, $type, $template) {
-
-       if (is_array($query)) {
-               if (sizeof($query) == 0)
-                       return 0;
-
-               call_user_func('listplug_' . $type, $template, 'HEAD');
-
-               foreach ($query as $currentObj) {
-                       $template['current'] = $currentObj;
-                       call_user_func('listplug_' . $type, $template, 'BODY');
-               }
-
-               call_user_func('listplug_' . $type, $template, 'FOOT');
-
-               return sizeof($query);
-
-       } else {
-               $res = sql_query($query);
-
-               // don't do anything if there are no results
-               $numrows = mysql_num_rows($res);
-               if ($numrows == 0)
-                       return 0;
-
-               call_user_func('listplug_' . $type, $template, 'HEAD');
-
-               while($template['current'] = mysql_fetch_object($res))
-                       call_user_func('listplug_' . $type, $template, 'BODY');
-
-               call_user_func('listplug_' . $type, $template, 'FOOT');
-
-               mysql_free_result($res);
-
-               // return amount of results
-               return $numrows;
-       }
-}
-
-function listplug_select($template, $type) {
-       switch($type) {
-               case 'HEAD':
-                       echo '<select name="'.$template['name'].'" tabindex="'.$template['tabindex'].'" '.$template['javascript'].'>';
-
-                       // add extra row if needed
-                       if ($template['extra']) {
-                               echo '<option value="',$template['extraval'],'">',$template['extra'],'</option>';
-                       }
-
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-
-                       echo '<option value="' . htmlspecialchars($current->value) . '"';
-                       if ($template['selected'] == $current->value)
-                               echo ' selected="selected" ';
-                       if ($template['shorten'] > 0) {
-                               echo ' title="'. htmlspecialchars($current->text).'"';
-                               $current->text = shorten($current->text, $template['shorten'], $template['shortenel']);
-                       }
-                       echo '>' . htmlspecialchars($current->text) . '</option>';
-                       break;
-               case 'FOOT':
-                       echo '</select>';
-                       break;
-       }
-}
-
-function listplug_table($template, $type) {
-       switch($type) {
-               case 'HEAD':
-                       echo "<table>";
-                       echo "<thead><tr>";
-                       // print head
-                       call_user_func("listplug_table_" . $template['content'] , $template, 'HEAD');
-                       echo "</tr></thead><tbody>";
-                       break;
-               case 'BODY':
-                       // print tabletype specific thingies
-                       echo "<tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>";
-                       call_user_func("listplug_table_" . $template['content'] , $template,  'BODY');
-                       echo "</tr>";
-                       break;
-               case 'FOOT':
-                       call_user_func("listplug_table_" . $template['content'] , $template,  'FOOT');
-                       echo "</tbody></table>";
-                       break;
-       }
-}
-
-function listplug_table_memberlist($template, $type) {
-       switch($type) {
-               case 'HEAD':
-                       echo '<th>' . _LIST_MEMBER_NAME . '</th><th>' . _LIST_MEMBER_RNAME . '</th><th>' . _LIST_MEMBER_URL . '</th><th>' . _LIST_MEMBER_ADMIN;
-                       help('superadmin');
-                       echo "</th><th>" . _LIST_MEMBER_LOGIN;
-                       help('canlogin');
-                       echo "</th><th colspan='2'>" . _LISTS_ACTIONS. "</th>";
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-
-                       echo '<td>';
-                       $id = listplug_nextBatchId();
-                       echo '<input type="checkbox" id="batch',$id,'" name="batch[',$id,']" value="',$current->mnumber,'" />';
-                       echo '<label for="batch',$id,'">';
-                       echo "<a href='mailto:", htmlspecialchars($current->memail), "' tabindex='".$template['tabindex']."'>", htmlspecialchars($current->mname), "</a>";
-                       echo '</label>';
-                       echo '</td>';
-                       echo '<td>', htmlspecialchars($current->mrealname), '</td>';
-                       echo "<td><a href='$current->murl' tabindex='".$template['tabindex']."'>$current->murl</a></td>";
-                       echo '<td>', ($current->madmin ? _YES : _NO),'</td>';
-                       echo '<td>', ($current->mcanlogin ? _YES : _NO), '</td>';
-                       echo "<td><a href='index.php?action=memberedit&amp;memberid=$current->mnumber' tabindex='".$template['tabindex']."'>"._LISTS_EDIT."</a></td>";
-                       echo "<td><a href='index.php?action=memberdelete&amp;memberid=$current->mnumber' tabindex='".$template['tabindex']."'>"._LISTS_DELETE."</a></td>";
-                       break;
-       }
-}
-
-function listplug_table_teamlist($template, $type) {
-       global $manager;
-       switch($type) {
-               case 'HEAD':
-                       echo "<th>"._LIST_MEMBER_NAME."</th><th>"._LIST_MEMBER_RNAME."</th><th>"._LIST_TEAM_ADMIN;
-                       help('teamadmin');
-                       echo "</th><th colspan='2'>"._LISTS_ACTIONS."</th>";
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-
-                       echo '<td>';
-                       $id = listplug_nextBatchId();
-                       echo '<input type="checkbox" id="batch',$id,'" name="batch[',$id,']" value="',$current->tmember,'" />';
-                       echo '<label for="batch',$id,'">';
-                       echo "<a href='mailto:", htmlspecialchars($current->memail), "' tabindex='".$template['tabindex']."'>", htmlspecialchars($current->mname), "</a>";
-                       echo '</label>';
-                       echo '</td>';
-                       echo '<td>', htmlspecialchars($current->mrealname), '</td>';
-                       echo '<td>', ($current->tadmin ? _YES : _NO) , '</td>';
-                       echo "<td><a href='index.php?action=teamdelete&amp;memberid=$current->tmember&amp;blogid=$current->tblog' tabindex='".$template['tabindex']."'>"._LISTS_DELETE."</a></td>";
-
-                       $url = 'index.php?action=teamchangeadmin&memberid=' . intval($current->tmember) . '&blogid=' . intval($current->tblog);
-                       $url = $manager->addTicketToUrl($url);
-                       echo "<td><a href='",htmlspecialchars($url),"' tabindex='".$template['tabindex']."'>"._LIST_TEAM_CHADMIN."</a></td>";
-                       break;
-       }
-}
-
-function encode_desc(&$data)
-    {   //_$to_entities = get_html_translation_table(HTML_ENTITIES);
-        $to_entities = get_html_translation_table(HTML_SPECIALCHARS);
-        $from_entities = array_flip($to_entities);
-        $data = str_replace('<br />','\n',$data); //hack
-        $data = strtr($data,$from_entities);
-        $data = strtr($data,$to_entities);
-        $data = str_replace('\n','<br />',$data); //hack
-        return $data;
-    }
-
-function listplug_table_pluginlist($template, $type) {
-       global $manager;
-       switch($type) {
-               case 'HEAD':
-                       echo '<th>'._LISTS_INFO.'</th><th>'._LISTS_DESC.'</th>';
-                       echo '<th style="white-space:nowrap">'._LISTS_ACTIONS.'</th>';
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-
-                       $plug =& $manager->getPlugin($current->pfile);
-                       if ($plug) {
-                               echo '<td>';
-                                       echo '<strong>' , htmlspecialchars($plug->getName()) , '</strong><br />';
-                                       echo _LIST_PLUGS_AUTHOR, ' ' , htmlspecialchars($plug->getAuthor()) , '<br />';
-                                       echo _LIST_PLUGS_VER, ' ' , htmlspecialchars($plug->getVersion()) , '<br />';
-                                       if ($plug->getURL())
-                                       echo '<a href="',htmlspecialchars($plug->getURL()),'" tabindex="'.$template['tabindex'].'">',_LIST_PLUGS_SITE,'</a><br />';
-                               echo '</td>';
-                               echo '<td>';
-                                       echo _LIST_PLUGS_DESC .'<br/>'. encode_desc($plug->getDescription());
-                                       if (sizeof($plug->getEventList()) > 0) {
-                                               echo '<br /><br />',_LIST_PLUGS_SUBS,'<br />',htmlspecialchars(implode($plug->getEventList(),', '));
-                                               // check the database to see if it is up-to-date and notice the user if not
-                                       }
-                                       if (!$plug->subscribtionListIsUptodate()) {
-                                               echo '<br /><br /><strong>',_LIST_PLUG_SUBS_NEEDUPDATE,'</strong>';
-                                       }
-                                       if (sizeof($plug->getPluginDep()) > 0)
-                                               echo '<br /><br />',_LIST_PLUGS_DEP,'<br />',htmlspecialchars(implode($plug->getPluginDep(),', '));
-                               echo '</td>';
-                       } else {
-                               echo '<td colspan="2">Error: plugin file <b>',htmlspecialchars($current->pfile),'.php</b> could not be loaded, or it has been set inactive because it does not support some features (check the <a href="?action=actionlog">actionlog</a> for more info)</td>';
-                       }
-                       echo '<td>';
-
-                               $baseUrl = 'index.php?plugid=' . intval($current->pid) . '&action=';
-                               $url = $manager->addTicketToUrl($baseUrl . 'pluginup');
-                               echo "<a href='",htmlspecialchars($url),"' tabindex='".$template['tabindex']."'>",_LIST_PLUGS_UP,"</a>";
-                               $url = $manager->addTicketToUrl($baseUrl . 'plugindown');
-                               echo "<br /><a href='",htmlspecialchars($url),"' tabindex='".$template['tabindex']."'>",_LIST_PLUGS_DOWN,"</a>";
-                               echo "<br /><a href='index.php?action=plugindelete&amp;plugid=$current->pid' tabindex='".$template['tabindex']."'>",_LIST_PLUGS_UNINSTALL,"</a>";
-                               if ($plug && ($plug->hasAdminArea() > 0))
-                                       echo "<br /><a href='".htmlspecialchars($plug->getAdminURL())."'  tabindex='".$template['tabindex']."'>",_LIST_PLUGS_ADMIN,"</a>";
-                               if ($plug && ($plug->supportsFeature('HelpPage') > 0))
-                                       echo "<br /><a href='index.php?action=pluginhelp&amp;plugid=$current->pid'  tabindex='".$template['tabindex']."'>",_LIST_PLUGS_HELP,"</a>";
-                               if (quickQuery('SELECT COUNT(*) AS result FROM '.sql_table('plugin_option_desc').' WHERE ocontext=\'global\' and opid='.$current->pid) > 0)
-                                       echo "<br /><a href='index.php?action=pluginoptions&amp;plugid=$current->pid'  tabindex='".$template['tabindex']."'>",_LIST_PLUGS_OPTIONS,"</a>";
-                       echo '</td>';
-                       break;
-       }
-}
-
-function listplug_table_plugoptionlist($template, $type) {
-       global $manager;
-       switch($type) {
-               case 'HEAD':
-                       echo '<th>'._LISTS_INFO.'</th><th>'._LISTS_VALUE.'</th>';
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-                       listplug_plugOptionRow($current);
-                       break;
-               case 'FOOT':
-                       ?>
-                       <tr>
-                               <th colspan="2"><?php echo _PLUGS_SAVE?></th>
-                       </tr><tr>
-                               <td><?php echo _PLUGS_SAVE?></td>
-                               <td><input type="submit" value="<?php echo _PLUGS_SAVE?>" /></td>
-                       </tr>
-                       <?php                   break;
-       }
-}
-
-function listplug_plugOptionRow($current) {
-       $varname = 'plugoption['.$current['oid'].']['.$current['contextid'].']';
-       // retreive the optionmeta
-       $meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
-
-       // only if it is not a hidden option write the controls to the page
-       if ($meta['access'] != 'hidden') {
-               echo '<td>',htmlspecialchars($current['description']?$current['description']:$current['name']),'</td>';
-               echo '<td>';
-               switch($current['type']) {
-                       case 'yesno':
-                               ADMIN::input_yesno($varname, $current['value'], 0, 'yes', 'no');
-                               break;
-                       case 'password':
-                               echo '<input type="password" size="40" maxlength="128" name="',htmlspecialchars($varname),'" value="',htmlspecialchars($current['value']),'" />';
-                               break;
-                       case 'select':
-                               echo '<select name="'.htmlspecialchars($varname).'">';
-                               $aOptions = NucleusPlugin::getOptionSelectValues($current['typeinfo']);
-                               $aOptions = explode('|', $aOptions);
-                               for ($i=0; $i<(count($aOptions)-1); $i+=2) {
-                                       echo '<option value="'.htmlspecialchars($aOptions[$i+1]).'"';
-                                       if ($aOptions[$i+1] == $current['value'])
-                                               echo ' selected="selected"';
-                                       echo '>'.htmlspecialchars($aOptions[$i]).'</option>';
-                               }
-                               echo '</select>';
-                               break;
-                       case 'textarea':
-                               //$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
-                               echo '<textarea class="pluginoption" cols="30" rows="5" name="',htmlspecialchars($varname),'"';
-                               if ($meta['access'] == 'readonly') {
-                                       echo ' readonly="readonly"';
-                               }
-                               echo '>',htmlspecialchars($current['value']),'</textarea>';
-                               break;
-                       case 'text':
-                       default:
-                               //$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
-
-                               echo '<input type="text" size="40" maxlength="128" name="',htmlspecialchars($varname),'" value="',htmlspecialchars($current['value']),'"';
-                               if ($meta['datatype'] == 'numerical') {
-                                       echo ' onkeyup="checkNumeric(this)" onblur="checkNumeric(this)"';
-                               }
-                               if ($meta['access'] == 'readonly') {
-                                       echo ' readonly="readonly"';
-                               }
-                               echo ' />';
-               }
-               echo $current['extra'];
-               echo '</td>';
-       }
-}
-
-function listplug_table_itemlist($template, $type) {
-       switch($type) {
-               case 'HEAD':
-                       echo "<th>"._LIST_ITEM_INFO."</th><th>"._LIST_ITEM_CONTENT."</th><th style=\"white-space:nowrap\" colspan='1'>"._LISTS_ACTIONS."</th>";
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-                       $current->itime = strtotime($current->itime);   // string -> unix timestamp
-
-                       if ($current->idraft == 1)
-                               $cssclass = "class='draft'";
-
-                       // (can't use offset time since offsets might vary between blogs)
-                       if ($current->itime > $template['now'])
-                               $cssclass = "class='future'";
-
-                       echo "<td $cssclass>",_LIST_ITEM_BLOG,' ', htmlspecialchars($current->bshortname);
-                       echo "    <br />",_LIST_ITEM_CAT,' ', htmlspecialchars($current->cname);
-                       echo "    <br />",_LIST_ITEM_AUTHOR, ' ', htmlspecialchars($current->mname);
-                       echo "    <br />",_LIST_ITEM_DATE," " . date("Y-m-d",$current->itime);
-                       echo "<br />",_LIST_ITEM_TIME," " . date("H:i",$current->itime);
-                       echo "</td>";
-                       echo "<td $cssclass>";
-
-                       $id = listplug_nextBatchId();
-
-                       echo '<input type="checkbox" id="batch',$id,'" name="batch[',$id,']" value="',$current->inumber,'" />';
-                       echo '<label for="batch',$id,'">';
-                       echo "<b>" . htmlspecialchars(strip_tags($current->ititle)) . "</b>";
-                       echo '</label>';
-                       echo "<br />";
-
-
-                       $current->ibody = strip_tags($current->ibody);
-                       $current->ibody = htmlspecialchars(shorten($current->ibody,300,'...'));
-
-                       echo "$current->ibody</td>";
-                       echo "<td style=\"white-space:nowrap\" $cssclass>";
-                       echo    "<a href='index.php?action=itemedit&amp;itemid=$current->inumber'>"._LISTS_EDIT."</a>";
-                       echo    "<br /><a href='index.php?action=itemcommentlist&amp;itemid=$current->inumber'>"._LISTS_COMMENTS."</a>";
-                       echo    "<br /><a href='index.php?action=itemmove&amp;itemid=$current->inumber'>"._LISTS_MOVE."</a>";
-                       echo    "<br /><a href='index.php?action=itemdelete&amp;itemid=$current->inumber'>"._LISTS_DELETE."</a>";
-                       echo "</td>";
-                       break;
-       }
-}
-
-// for batch operations: generates the index numbers for checkboxes
-function listplug_nextBatchId() {
-       static $id = 0;
-       return $id++;
-}
-
-function listplug_table_commentlist($template, $type) {
-       switch($type) {
-               case 'HEAD':
-                       echo "<th>"._LISTS_INFO."</th><th>"._LIST_COMMENT."</th><th colspan='3'>"._LISTS_ACTIONS."</th>";
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-                       $current->ctime = strtotime($current->ctime);   // string -> unix timestamp
-
-                       echo '<td>';
-                       echo date("Y-m-d@H:i",$current->ctime);
-                       echo '<br />';
-                       if ($current->mname)
-                               echo htmlspecialchars($current->mname) ,' ', _LIST_COMMENTS_MEMBER;
-                       else
-                               echo htmlspecialchars($current->cuser);
-                       echo '</td>';
-
-
-                       $current->cbody = strip_tags($current->cbody);
-                       $current->cbody = htmlspecialchars(shorten($current->cbody, 300, '...'));
-
-                       echo '<td>';
-                       $id = listplug_nextBatchId();
-                       echo '<input type="checkbox" id="batch',$id,'" name="batch[',$id,']" value="',$current->cnumber,'" />';
-                       echo '<label for="batch',$id,'">';
-                       echo $current->cbody;
-                       echo '</label>';
-                       echo '</td>';
-
-                       echo "<td style=\"white-space:nowrap\"><a href='index.php?action=commentedit&amp;commentid=$current->cnumber'>"._LISTS_EDIT."</a></td>";
-                       echo "<td style=\"white-space:nowrap\"><a href='index.php?action=commentdelete&amp;commentid=$current->cnumber'>"._LISTS_DELETE."</a></td>";
-                       if ($template['canAddBan'])
-                               echo "<td style=\"white-space:nowrap\"><a href='index.php?action=banlistnewfromitem&amp;itemid=$current->citem&amp;ip=", htmlspecialchars($current->cip), "' title='", htmlspecialchars($current->chost), "'>"._LIST_COMMENT_BANIP."</a></td>";
-                       break;
-       }
-}
-
-
-function listplug_table_bloglist($template, $type) {
-       switch($type) {
-               case 'HEAD':
-                       echo "<th>" . _NAME . "</th><th colspan='7'>" ._LISTS_ACTIONS. "</th>";
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-
-                       echo "<td title='blogid:$current->bnumber shortname:$current->bshortname'><a href='$current->burl'><img src='images/globe.gif' width='13' height='13' alt='". _BLOGLIST_TT_VISIT."' /></a> " . htmlspecialchars($current->bname) . "</td>";
-                       echo "<td><a href='index.php?action=createitem&amp;blogid=$current->bnumber' title='" . _BLOGLIST_TT_ADD ."'>" . _BLOGLIST_ADD . "</a></td>";
-                       echo "<td><a href='index.php?action=itemlist&amp;blogid=$current->bnumber' title='". _BLOGLIST_TT_EDIT."'>". _BLOGLIST_EDIT."</a></td>";
-                       echo "<td><a href='index.php?action=blogcommentlist&amp;blogid=$current->bnumber' title='". _BLOGLIST_TT_COMMENTS."'>". _BLOGLIST_COMMENTS."</a></td>";
-                       echo "<td><a href='index.php?action=bookmarklet&amp;blogid=$current->bnumber' title='". _BLOGLIST_TT_BMLET."'>". _BLOGLIST_BMLET . "</a></td>";
-
-                       if ($current->tadmin == 1) {
-                               echo "<td><a href='index.php?action=blogsettings&amp;blogid=$current->bnumber' title='" . _BLOGLIST_TT_SETTINGS . "'>" ._BLOGLIST_SETTINGS. "</a></td>";
-                               echo "<td><a href='index.php?action=banlist&amp;blogid=$current->bnumber' title='" . _BLOGLIST_TT_BANS. "'>". _BLOGLIST_BANS."</a></td>";
-                       }
-
-                       if ($template['superadmin']) {
-                               echo "<td><a href='index.php?action=deleteblog&amp;blogid=$current->bnumber' title='". _BLOGLIST_TT_DELETE."'>" ._BLOGLIST_DELETE. "</a></td>";
-                       }
-
-
-
-                       break;
-       }
-}
-
-function listplug_table_shortblognames($template, $type) {
-       switch($type) {
-               case 'HEAD':
-                       echo "<th>" . _NAME . "</th><th>" . _NAME. "</th>";
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-
-                       echo '<td>' , htmlspecialchars($current->bshortname) , '</td>';
-                       echo '<td>' , htmlspecialchars($current->bname) , '</td>';
-
-                       break;
-       }
-}
-
-function listplug_table_shortnames($template, $type) {
-       switch($type) {
-               case 'HEAD':
-                       echo "<th>" . _NAME . "</th><th>" . _LISTS_DESC. "</th>";
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-
-                       echo '<td>' , htmlspecialchars($current->name) , '</td>';
-                       echo '<td>' , htmlspecialchars($current->description) , '</td>';
-
-                       break;
-       }
-}
-
-
-function listplug_table_categorylist($template, $type) {
-       switch($type) {
-               case 'HEAD':
-                       echo "<th>"._LISTS_NAME."</th><th>"._LISTS_DESC."</th><th colspan='2'>"._LISTS_ACTIONS."</th>";
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-
-                       echo '<td>';
-                       $id = listplug_nextBatchId();
-                       echo '<input type="checkbox" id="batch',$id,'" name="batch[',$id,']" value="',$current->catid,'" />';
-                       echo '<label for="batch',$id,'">';
-                       echo htmlspecialchars($current->cname);
-                       echo '</label>';
-                       echo '</td>';
-
-                       echo '<td>', htmlspecialchars($current->cdesc), '</td>';
-                       echo "<td><a href='index.php?action=categorydelete&amp;blogid=$current->cblog&amp;catid=$current->catid' tabindex='".$template['tabindex']."'>"._LISTS_DELETE."</a></td>";
-                       echo "<td><a href='index.php?action=categoryedit&amp;blogid=$current->cblog&amp;catid=$current->catid' tabindex='".$template['tabindex']."'>"._LISTS_EDIT."</a></td>";
-
-                       break;
-       }
-}
-
-
-function listplug_table_templatelist($template, $type) {
-       global $manager;
-       switch($type) {
-               case 'HEAD':
-                       echo "<th>"._LISTS_NAME."</th><th>"._LISTS_DESC."</th><th colspan='3'>"._LISTS_ACTIONS."</th>";
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-
-                       echo "<td>" , htmlspecialchars($current->tdname), "</td>";
-                       echo "<td>" , htmlspecialchars($current->tddesc), "</td>";
-                       echo "<td style=\"white-space:nowrap\"><a href='index.php?action=templateedit&amp;templateid=$current->tdnumber' tabindex='".$template['tabindex']."'>"._LISTS_EDIT."</a></td>";
-
-                       $url = $manager->addTicketToUrl('index.php?action=templateclone&templateid=' . intval($current->tdnumber));
-                       echo "<td style=\"white-space:nowrap\"><a href='",htmlspecialchars($url),"' tabindex='".$template['tabindex']."'>"._LISTS_CLONE."</a></td>";
-                       echo "<td style=\"white-space:nowrap\"><a href='index.php?action=templatedelete&amp;templateid=$current->tdnumber' tabindex='".$template['tabindex']."'>"._LISTS_DELETE."</a></td>";
-
-                       break;
-       }
-}
-
-function listplug_table_skinlist($template, $type) {
-       global $CONF, $DIR_SKINS, $manager;
-       switch($type) {
-               case 'HEAD':
-                       echo "<th>"._LISTS_NAME."</th><th>"._LISTS_DESC."</th><th colspan='3'>"._LISTS_ACTIONS."</th>";
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-
-                       echo '<td>';
-
-                       // use a special style for the default skin
-                       if ($current->sdnumber == $CONF['BaseSkin']) {
-                               echo '<strong>',htmlspecialchars($current->sdname),'</strong>';
-                       } else {
-                               echo htmlspecialchars($current->sdname);
-                       }
-
-                       echo '<br /><br />';
-                       echo _LISTS_TYPE ,': ' , htmlspecialchars($current->sdtype);
-                       echo '<br />', _LIST_SKINS_INCMODE , ' ' , (($current->sdincmode=='skindir') ?_PARSER_INCMODE_SKINDIR:_PARSER_INCMODE_NORMAL);
-                       if ($current->sdincpref) echo '<br />' , _LIST_SKINS_INCPREFIX , ' ', htmlspecialchars($current->sdincpref);
-
-                       // add preview image when present
-                       if ($current->sdincpref && @file_exists($DIR_SKINS . $current->sdincpref . 'preview.png'))
-                       {
-                               echo '<br /><br />';
-
-                               $hasEnlargement = @file_exists($DIR_SKINS . $current->sdincpref . 'preview-large.png');
-                               if ($hasEnlargement)
-                                       echo '<a href="',$CONF['SkinsURL'], htmlspecialchars($current->sdincpref),'preview-large.png" title="View larger">';
-
-                               echo '<img class="skinpreview" src="',$CONF['SkinsURL'], htmlspecialchars($current->sdincpref),'preview.png" width="100" height="75" alt="Preview for \'',htmlspecialchars($current->sdname),'\' skin" />';
-
-                               if ($hasEnlargement)
-                                       echo '</a>';
-
-                               if (@file_exists($DIR_SKINS . $current->sdincpref . 'readme.html'))
-                               {
-                                       echo '<br /><a href="',$CONF['SkinsURL'], htmlspecialchars($current->sdincpref),'readme.html" title="More info on the \'',htmlspecialchars($current->sdname),'\' skin">Readme</a>';
-                               }
-
-
-                       }
-
-                       echo "</td>";
-
-
-                       echo "<td>" , htmlspecialchars($current->sddesc);
-                               // show list of defined parts
-                               $r = sql_query('SELECT stype FROM '.sql_table('skin').' WHERE sdesc='.$current->sdnumber . ' ORDER BY stype');
-                               $types = array();
-                               while ($o = mysql_fetch_object($r))
-                                       array_push($types,$o->stype);
-                               if (sizeof($types) > 0) {
-                                       $friendlyNames = SKIN::getFriendlyNames();
-                                       for ($i=0;$i<sizeof($types);$i++) {
-                                               $type = $types[$i];
-                                               $types[$i] = '<li>' . helpHtml('skinpart'.$type) . ' <a href="index.php?action=skinedittype&amp;skinid='.$current->sdnumber.'&amp;type='.$type.'" tabindex="'.$template['tabindex'].'">' . htmlspecialchars($friendlyNames[$type]) . "</a></li>";
-                                       }
-                                       echo '<br /><br />',_LIST_SKINS_DEFINED,' <ul>',implode($types,'') ,'</ul>';
-                               }
-                       echo "</td>";
-                       echo "<td style=\"white-space:nowrap\"><a href='index.php?action=skinedit&amp;skinid=$current->sdnumber' tabindex='".$template['tabindex']."'>"._LISTS_EDIT."</a></td>";
-
-                       $url = $manager->addTicketToUrl('index.php?action=skinclone&skinid=' . intval($current->sdnumber));
-                       echo "<td style=\"white-space:nowrap\"><a href='",htmlspecialchars($url),"' tabindex='".$template['tabindex']."'>"._LISTS_CLONE."</a></td>";
-                       echo "<td style=\"white-space:nowrap\"><a href='index.php?action=skindelete&amp;skinid=$current->sdnumber' tabindex='".$template['tabindex']."'>"._LISTS_DELETE."</a></td>";
-
-                       break;
-       }
-}
-
-function listplug_table_draftlist($template, $type) {
-       switch($type) {
-               case 'HEAD':
-                       echo "<th>"._LISTS_BLOG."</th><th>"._LISTS_TITLE."</th><th colspan='2'>"._LISTS_ACTIONS."</th>";
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-
-                       echo '<td>', htmlspecialchars($current->bshortname) , '</td>';
-                       echo '<td>', htmlspecialchars(strip_tags($current->ititle)) , '</td>';
-                       echo "<td><a href='index.php?action=itemedit&amp;itemid=$current->inumber'>"._LISTS_EDIT."</a></td>";
-                       echo "<td><a href='index.php?action=itemdelete&amp;itemid=$current->inumber'>"._LISTS_DELETE."</a></td>";
-
-                       break;
-       }
-}
-
-
-function listplug_table_actionlist($template, $type) {
-       switch($type) {
-               case 'HEAD':
-                       echo '<th>'._LISTS_TIME.'</th><th>'._LIST_ACTION_MSG.'</th>';
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-
-                       echo '<td>' , htmlspecialchars($current->timestamp), '</td>';
-                       echo '<td>' , htmlspecialchars($current->message), '</td>';
-
-                       break;
-       }
-}
-
-function listplug_table_banlist($template, $type) {
-       switch($type) {
-               case 'HEAD':
-                       echo '<th>'._LIST_BAN_IPRANGE.'</th><th>'. _LIST_BAN_REASON.'</th><th>'._LISTS_ACTIONS.'</th>';
-                       break;
-               case 'BODY':
-                       $current = $template['current'];
-
-                       echo '<td>' , htmlspecialchars($current->iprange) , '</td>';
-                       echo '<td>' , htmlspecialchars($current->reason) , '</td>';
-                       echo "<td><a href='index.php?action=banlistdelete&amp;blogid=", intval($current->blogid) , "&amp;iprange=" , htmlspecialchars($current->iprange) , "'>",_LISTS_DELETE,"</a></td>";
-                       break;
-       }
-}
-
-/**
- * Returns the Javascript code for a bookmarklet that works on most modern browsers
- *
- * @param blogid
- */
-function getBookmarklet($blogid) {
-       global $CONF;
-
-       // normal
-       $document = 'document';
-       $bookmarkletline = "javascript:Q='';x=".$document.";y=window;if(x.selection){Q=x.selection.createRange().text;}else if(y.getSelection){Q=y.getSelection();}else if(x.getSelection){Q=x.getSelection();}wingm=window.open('";
-       $bookmarkletline .= $CONF['AdminURL'] . "bookmarklet.php?blogid=$blogid";
-       $bookmarkletline .="&logtext='+escape(Q)+'&loglink='+escape(x.location.href)+'&loglinktitle='+escape(x.title),'nucleusbm','scrollbars=yes,width=600,height=500,left=10,top=10,status=yes,resizable=yes');wingm.focus();";
-
-       return $bookmarkletline;
-}
-
-
 ?>
diff --git a/euc/nucleus/libs/BODYACTIONS.php b/euc/nucleus/libs/BODYACTIONS.php
new file mode 100644 (file)
index 0000000..e996f70
--- /dev/null
@@ -0,0 +1,152 @@
+<?php
+
+/*
+ * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
+ * Copyright (C) 2002-2007 The Nucleus Group
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * (see nucleus/documentation/index.html#license for more info)
+ */
+/**
+ * A class to parses plugin calls inside items
+ *
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2007 The Nucleus Group
+ * @version $Id: BODYACTIONS.php,v 1.1 2007-04-04 07:52:08 kimitake Exp $
+ * @version $NucleusJP: BODYACTIONS.php,v 1.5 2007/03/22 03:30:14 kmorimatsu Exp $
+ */
+
+class BODYACTIONS extends BaseActions {
+
+       var $currentItem;
+
+       var $template;
+
+       function BODYACTIONS () {
+               $this->BaseActions();   
+       }
+       
+       function setCurrentItem(&$item) {
+               $this->currentItem =& $item;
+       }
+       
+       function setTemplate($template) {
+               $this->template =& $template;
+       }
+
+       function getDefinedActions() {
+               return array('image','media','popup','plugin');
+       }
+
+       function parse_plugin($pluginName) {
+               global $manager;
+
+               // only continue when the plugin is really installed
+               if (!$manager->pluginInstalled('NP_' . $pluginName)) {
+                       return;
+               }
+
+               $plugin =& $manager->getPlugin('NP_' . $pluginName);
+               if (!$plugin) return;
+
+               // get arguments
+               $params = func_get_args();
+
+               // remove plugin name
+               array_shift($params);
+
+               // add item reference (array_unshift didn't work)
+               $params = array_merge(array(&$this->currentItem),$params);
+
+               call_user_func_array(array(&$plugin,'doItemVar'), $params);
+       }
+       
+       function parse_image() {
+               // image/popup calls have arguments separated by |
+               $args = func_get_args();
+               $args = explode('|',implode($args,', '));
+               call_user_func_array(array(&$this,'createImageCode'),$args);
+       }
+       
+       function createImageCode($filename, $width, $height, $text = '') {
+               global $CONF;
+
+               // select private collection when no collection given
+               if (!strstr($filename,'/')) {
+                       $filename = $this->currentItem->authorid . '/' . $filename;
+               }
+
+               $windowwidth = $width;
+               $windowheight = $height;
+
+               $vars['link']                   = htmlspecialchars($CONF['MediaURL']. $filename ,ENT_QUOTES);
+               $vars['text']                   = htmlspecialchars($text ,ENT_QUOTES);
+               $vars['image'] = '<img src="' . $vars['link'] . '" width="' . $width . '" height="' . $height . '" alt="' . $vars['text'] . '" title="' . $vars['text'] . '" />';
+               $vars['width']                  = $width;
+               $vars['height']                 = $height;
+               $vars['media']                  = '<a href="' . $vars['link'] . '">' . $vars['text'] . '</a>';
+
+
+               echo TEMPLATE::fill($this->template['IMAGE_CODE'],$vars);;
+
+       }
+       
+       function parse_media() {
+               // image/popup calls have arguments separated by |
+               $args = func_get_args();
+               $args = explode('|',implode($args,', '));
+               call_user_func_array(array(&$this,'createMediaCode'),$args);
+       }
+
+       function createMediaCode($filename, $text = '') {
+               global $CONF;
+
+               // select private collection when no collection given
+               if (!strstr($filename,'/')) {
+                       $filename = $this->currentItem->authorid . '/' . $filename;
+       }
+
+               $vars['link']                   = htmlspecialchars($CONF['MediaURL'] . $filename ,ENT_QUOTES);
+               $vars['text']                   = htmlspecialchars($text ,ENT_QUOTES);
+               $vars['media']                  = '<a href="' . $vars['link'] . '">' . $vars['text'] . '</a>';
+
+               echo TEMPLATE::fill($this->template['MEDIA_CODE'],$vars);;
+       }
+
+
+       function parse_popup() {
+               // image/popup calls have arguments separated by |
+               $args = func_get_args();
+               $args = explode('|',implode($args,', '));
+               call_user_func_array(array(&$this,'createPopupCode'),$args);
+       }
+
+       function createPopupCode($filename, $width, $height, $text = '') {
+               global $CONF;
+
+               // select private collection when no collection given
+               if (!strstr($filename,'/')) {
+                       $filename = $this->currentItem->authorid . '/' . $filename;
+               }
+
+               $windowwidth = $width;
+               $windowheight = $height;
+
+               $vars['rawpopuplink']   = $CONF['Self'] . "?imagepopup=" . htmlspecialchars($filename,ENT_QUOTES) . "&amp;width=$width&amp;height=$height&amp;imagetext=" . urlencode(htmlspecialchars($text));
+               $vars['popupcode']              = "window.open(this.href,'imagepopup','status=no,toolbar=no,scrollbars=no,resizable=yes,width=$windowwidth,height=$windowheight');return false;";
+               $vars['popuptext']              = htmlspecialchars($text,ENT_QUOTES);
+               $vars['popuplink']              = '<a href="' . $vars['rawpopuplink']. '" onclick="'. $vars['popupcode'].'" >' . $vars['popuptext'] . '</a>';
+               $vars['width']                  = $width;
+               $vars['height']                 = $height;
+               $vars['text']                   = $text;
+               $vars['link']                   = htmlspecialchars($CONF['MediaURL'] . $filename ,ENT_QUOTES);
+               $vars['media']                  = '<a href="' . $vars['link'] . '">' . $vars['popuptext'] . '</a>';
+
+               echo TEMPLATE::fill($this->template['POPUP_CODE'],$vars);
+       }
+
+}
+?>
\ No newline at end of file
diff --git a/euc/nucleus/libs/BaseActions.php b/euc/nucleus/libs/BaseActions.php
new file mode 100644 (file)
index 0000000..129233f
--- /dev/null
@@ -0,0 +1,314 @@
+<?php
+/*
+ * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
+ * Copyright (C) 2002-2007 The Nucleus Group
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * (see nucleus/documentation/index.html#license for more info)
+ */
+/**
+ * This class contains parse actions that are available in all ACTION classes
+ * e.g. include, phpinclude, parsedinclude, skinfile, ...
+ *
+ * It should never be used on it's own
+ *
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2007 The Nucleus Group
+ * @version $Id: BaseActions.php,v 1.1 2007-04-04 07:52:08 kimitake Exp $
+ * @version $NucleusJP: BaseActions.php,v 1.3 2007/02/04 06:28:46 kimitake Exp $
+ */
+
+class BaseActions {
+
+       // depth level for includes (max. level is 3)
+       var $level;
+
+       // array of evaluated conditions (true/false). The element at the end is the one for the most nested
+       // if block.
+       var $if_conditions;
+
+       // in the "elseif" / "elseifnot" sequences, if one of the conditions become "true" remained conditions should not
+       // be tested. this variable (actually a stack) holds this information.
+       var $if_execute;
+
+       // at all times, can be evaluated to either true if the current block needs to be displayed. This
+       // variable is used to decide to skip skinvars in parts that will never be outputted.
+       var $if_currentlevel;
+
+       // contains a search string with keywords that need to be highlighted. These get parsed into $aHighlight
+       var $strHighlight;
+
+       // array of keywords that need to be highlighted in search results (see the highlight()
+       // and parseHighlight() methods)
+       var $aHighlight;
+
+       // reference to the parser object that is using this object as actions-handler
+       var $parser;
+
+       function BaseActions() {
+               $this->level = 0;
+
+               // if nesting level
+               $this->if_conditions = array(); // array on which condition values are pushed/popped
+               $this->if_execute = array();    // array on which condition values are pushed/popped
+               $this->if_currentlevel = 1;             // 1 = current level is displayed; 0 = current level not displayed
+
+               // highlights
+               $this->strHighlight = '';                       // full highlight
+               $this->aHighlight = array();            // parsed highlight
+
+       }
+
+       // include file (no parsing of php)
+       function parse_include($filename) {
+               @readfile($this->getIncludeFileName($filename));
+       }
+
+       // php-include file
+       function parse_phpinclude($filename) {
+               includephp($this->getIncludeFileName($filename));
+       }
+
+       // parsed include
+       function parse_parsedinclude($filename) {
+               // check current level
+               if ($this->level > 3) return;   // max. depth reached (avoid endless loop)
+               $filename = $this->getIncludeFileName($filename);
+               if (!file_exists($filename)) return '';
+
+               $fsize = filesize($filename);
+
+               // nothing to include
+               if ($fsize <= 0)
+                       return;
+
+               $this->level = $this->level + 1;
+
+               // read file
+               $fd = fopen ($filename, 'r');
+               $contents = fread ($fd, $fsize);
+               fclose ($fd);
+
+               // parse file contents
+               $this->parser->parse($contents);
+
+               $this->level = $this->level - 1;
+       }
+
+       /**
+        * Returns the correct location of the file to be included, according to
+        * parser properties
+        *
+        * IF IncludeMode = 'skindir' => use skindir
+        */
+       function getIncludeFileName($filename) {
+               // leave absolute filenames and http urls as they are
+               if (
+                               (substr($filename,0,1) == '/')
+                       ||      (substr($filename,0,7) == 'http://')
+                       ||      (substr($filename,0,6) == 'ftp://')
+                       )
+                       return $filename;
+
+               $filename = PARSER::getProperty('IncludePrefix') . $filename;
+               if (PARSER::getProperty('IncludeMode') == 'skindir') {
+                       global $DIR_SKINS;
+                       return $DIR_SKINS . $filename;
+               } else {
+                       return $filename;
+               }
+       }
+
+       /**
+        * Inserts an url relative to the skindir (useful when doing import/export)
+        *
+        * e.g. <skinfile(default/myfile.sth)>
+        */
+       function parse_skinfile($filename) {
+               global $CONF;
+
+               echo $CONF['SkinsURL'] . PARSER::getProperty('IncludePrefix') . $filename;
+       }
+
+       /**
+        * Sets a property for the parser
+        */
+       function parse_set($property, $value) {
+               PARSER::setProperty($property, $value);
+       }
+
+       /**
+        * Helper function: add if condition
+        */
+       function _addIfCondition($condition) {
+
+               array_push($this->if_conditions,$condition);
+
+               $this->_updateTopIfCondition();
+
+               ob_start();
+       }
+
+       function _updateTopIfCondition() {
+               if (sizeof($this->if_conditions) == 0)
+                       $this->if_currentlevel = 1;
+               else
+                       $this->if_currentlevel = $this->if_conditions[sizeof($this->if_conditions) - 1];
+       }
+
+       /**
+        * Helper function for elseif / elseifnot
+        */
+       function _addIfExecute() {
+               array_push($this->if_execute, 0);
+       }
+
+       /**
+        * Helper function for elseif / elseifnot
+        * @param string condition to be fullfilled
+        */
+       function _updateIfExecute($condition) {
+               $index = sizeof($this->if_execute) - 1;
+               $this->if_execute[$index] = $this->if_execute[$index] || $condition;
+       }
+
+       /**
+        * returns the currently top if condition
+        */
+       function _getTopIfCondition() {
+               return $this->if_currentlevel;
+       }
+
+       /**
+        * Sets the search terms to be highlighted
+        *
+        * @param $highlight
+        *              A series of search terms
+        */
+       function setHighlight($highlight) {
+               $this->strHighlight = $highlight;
+               if ($highlight) {
+                       $this->aHighlight = parseHighlight($highlight);
+               }
+       }
+
+       /**
+        * Applies the highlight to the given piece of text
+        *
+        * @param &$data
+        *              Data that needs to be highlighted
+        * @see setHighlight
+        */
+       function highlight(&$data) {
+               if ($this->aHighlight)
+                       return highlight($data,$this->aHighlight,$this->template['SEARCH_HIGHLIGHT']);
+               else
+                       return $data;
+       }
+
+       /**
+        * Parses <%if%> statements
+        */
+       function parse_if() {
+               $this->_addIfExecute();
+
+               $args = func_get_args();
+               $condition = call_user_func_array(array(&$this,'checkCondition'), $args);
+               $this->_addIfCondition($condition);
+       }
+
+       /**
+        * Parses <%else%> statements
+        */
+       function parse_else() {
+               if (sizeof($this->if_conditions) == 0) return;
+               array_pop($this->if_conditions);
+               if ($this->if_currentlevel) {
+                       ob_end_flush();
+                       $this->_updateIfExecute(1);
+                       $this->_addIfCondition(0);
+               } elseif ($this->if_execute[sizeof($this->if_execute) - 1]) {
+                       ob_end_clean();
+                       $this->_addIfCondition(0);
+               } else {
+                       ob_end_clean();
+                       $this->_addIfCondition(1);
+               }
+       }
+
+       /**
+        * Parses <%elseif%> statements
+        */
+       function parse_elseif() {
+               if (sizeof($this->if_conditions) == 0) return;
+               array_pop($this->if_conditions);
+               if ($this->if_currentlevel) {
+                       ob_end_flush();
+                       $this->_updateIfExecute(1);
+                       $this->_addIfCondition(0);
+               } elseif ($this->if_execute[sizeof($this->if_execute) - 1]) {
+                       ob_end_clean();
+                       $this->_addIfCondition(0);
+               } else {
+                       ob_end_clean();
+                       $args = func_get_args();
+                       $condition = call_user_func_array(array(&$this,'checkCondition'), $args);
+                       $this->_addIfCondition($condition);
+               }
+       }
+
+       /**
+        * Parses <%ifnot%> statements
+        */
+       function parse_ifnot() {
+               $this->_addIfExecute();
+
+               $args = func_get_args();
+               $condition = call_user_func_array(array(&$this,'checkCondition'), $args);
+               $this->_addIfCondition(!$condition);
+       }
+
+       /**
+        * Parses <%elseifnot%> statements
+        */
+       function parse_elseifnot() {
+               if (sizeof($this->if_conditions) == 0) return;
+               array_pop($this->if_conditions);
+               if ($this->if_currentlevel) {
+                       ob_end_flush();
+                       $this->_updateIfExecute(1);
+                       $this->_addIfCondition(0);
+               } elseif ($this->if_execute[sizeof($this->if_execute) - 1]) {
+                       ob_end_clean();
+                       $this->_addIfCondition(0);
+               } else {
+                       ob_end_clean();
+                       $args = func_get_args();
+                       $condition = call_user_func_array(array(&$this,'checkCondition'), $args);
+                       $this->_addIfCondition(!$condition);
+               }
+       }
+
+       /**
+        * Ends a conditional if-block
+        * see e.g. ifcat (BLOG), ifblogsetting (PAGEFACTORY)
+        */
+       function parse_endif() {
+               // we can only close what has been opened
+               if (sizeof($this->if_conditions) == 0) return;
+
+               if ($this->if_currentlevel) {
+                       ob_end_flush();
+               } else {
+                       ob_end_clean();
+               }
+               array_pop($this->if_conditions);
+               array_pop($this->if_execute);
+
+               $this->_updateTopIfCondition();
+       }
+}
+?>
diff --git a/euc/nucleus/libs/COMMENTACTIONS.php b/euc/nucleus/libs/COMMENTACTIONS.php
new file mode 100644 (file)
index 0000000..14e19a7
--- /dev/null
@@ -0,0 +1,318 @@
+<?php
+/*
+ * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
+ * Copyright (C) 2002-2007 The Nucleus Group
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * (see nucleus/documentation/index.html#license for more info)
+ */
+/**
+ * This class is used when parsing comment templates
+ *
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2007 The Nucleus Group
+ * @version $Id: COMMENTACTIONS.php,v 1.1 2007-04-04 07:52:08 kimitake Exp $
+ * @version $NucleusJP: COMMENTACTIONS.php,v 1.4 2007/03/19 10:20:24 shizuki Exp $
+ */
+
+class COMMENTACTIONS extends BaseActions {
+
+       // ref to COMMENTS object which is using this object to handle
+       // its templatevars
+       var $commentsObj;
+
+       // template to use to parse the comments
+       var $template;
+
+       // comment currenlty being handled (mysql result assoc array; see COMMENTS::showComments())
+       var $currentComment;
+
+       function COMMENTACTIONS(&$comments) {
+               // call constructor of superclass first
+               $this->BaseActions();
+
+               // reference to the comments object
+               $this->setCommentsObj($comments);
+       }
+
+       function getDefinedActions() {
+               return array(
+                       'blogurl',
+                       'commentcount',
+                       'commentword',
+                       'email',
+                       'itemlink',
+                       'itemid',
+                       'itemtitle',
+                       'date',
+                       'time',
+                       'commentid',
+                       'body',
+                       'memberid',
+                       'timestamp',
+                       'host',
+                       'ip',
+                       'blogid',
+                       'authtext',
+                       'user',
+                       'userid',
+                       'userlinkraw',
+                       'userlink',
+                       'useremail',
+                       'userwebsite',
+                       'excerpt',
+                       'short',
+                       'skinfile',
+                       'set',
+                       'plugin',
+                       'include',
+                       'phpinclude',
+                       'parsedinclude'
+               );
+       }
+
+       function setParser(&$parser) {
+               $this->parser =& $parser;
+       }
+       
+       function setCommentsObj(&$commentsObj) {
+               $this->commentsObj =& $commentsObj;
+       }
+       
+       function setTemplate($template) {
+               $this->template =& $template;
+       }
+       
+       function setCurrentComment(&$comment) {
+               global $manager;
+               if ($comment['memberid'] != 0) {
+                       $comment['authtext'] = $template['COMMENTS_AUTH'];
+
+                       $mem =& $manager->getMember($comment['memberid']);
+                       $comment['user'] = $mem->getDisplayName();
+                       if ($mem->getURL())
+                               $comment['userid'] = $mem->getURL();
+                       else
+                               $comment['userid'] = $mem->getEmail();
+
+                       $comment['userlinkraw'] = createLink(
+                                                                               'member',
+                                                                               array(
+                                                                                       'memberid' => $comment['memberid'],
+                                                                                       'name' => $mem->getDisplayName(),
+                                                                                       'extra' => $this->commentsObj->itemActions->linkparams
+                                                                               )
+                                                                         );
+
+               } else {
+
+                       // create smart links
+/*                     if (isValidMailAddress($comment['userid']))
+                               $comment['userlinkraw'] = 'mailto:'.$comment['userid'];
+                       elseif (strstr($comment['userid'],'http://') != false)
+                               $comment['userlinkraw'] = $comment['userid'];
+                       elseif (strstr($comment['userid'],'www') != false)
+                               $comment['userlinkraw'] = 'http://'.$comment['userid'];*/
+                       if (strstr($comment['userid'],'http://') != false)
+                               $comment['userlinkraw'] = $comment['userid'];
+                       elseif (strstr($comment['userid'],'www') != false)
+                               $comment['userlinkraw'] = 'http://'.$comment['userid'];
+                       elseif (isValidMailAddress($comment['email']))
+                               $comment['userlinkraw'] = 'mailto:'.$comment['userid'];
+                       elseif (isValidMailAddress($comment['userid']))
+                               $comment['userlinkraw'] = 'mailto:'.$comment['email'];
+               }
+
+               $this->currentComment =& $comment;
+       }
+
+       function parse_blogurl() {
+               global $manager;
+               $blogid = getBlogIDFromItemID($this->commentsObj->itemid);
+               $blog =& $manager->getBlog($blogid);
+               echo $blog->getURL();
+       }
+
+       function parse_commentcount() {
+                       echo $this->commentsObj->commentcount;
+       }
+       
+       function parse_commentword() {
+               if ($this->commentsObj->commentcount == 1)
+                       echo $this->template['COMMENTS_ONE'];
+               else
+                       echo $this->template['COMMENTS_MANY'];
+       }
+
+       function parse_itemlink() {
+               echo createLink(
+                       'item',
+                       array(
+                               'itemid' => $this->commentsObj->itemid,
+                               'timestamp' => $this->commentsObj->itemActions->currentItem->timestamp,
+                               'title' => $this->commentsObj->itemActions->currentItem->title,
+                               'extra' => $this->commentsObj->itemActions->linkparams
+                       )
+               );
+       }
+       
+       function parse_itemid() {
+               echo $this->commentsObj->itemid;
+       }
+       
+       function parse_itemtitle($maxLength = 0) {
+               if ($maxLength == 0)
+                       $this->commentsObj->itemActions->parse_title();
+               else
+                       $this->commentsObj->itemActions->parse_syndicate_title($maxLength);
+       }
+
+       function parse_date($format = '') {
+               echo formatDate($format, $this->currentComment['timestamp'], $this->template['FORMAT_DATE'], $this->commentsObj->itemActions->blog);
+       }
+       
+       function parse_time($format = '') {
+               echo strftime(
+                               ($format == '') ? $this->template['FORMAT_TIME'] : $format,
+                               $this->currentComment['timestamp']
+                       );
+       }
+
+       function parse_commentid() {
+               echo $this->currentComment['commentid'];
+       }
+       
+       function parse_body() {
+               echo $this->highlight($this->currentComment['body']);
+       }
+       
+       function parse_memberid() {
+               echo $this->currentComment['memberid'];
+       }
+       
+       function parse_timestamp() {
+               echo $this->currentComment['timestamp'];
+       }
+       
+       function parse_host() {
+               echo $this->currentComment['host'];
+       }
+       
+       function parse_ip() {
+               echo $this->currentComment['ip'];
+       }
+       
+       function parse_blogid() {
+               echo $this->currentComment['blogid'];
+       }
+
+//     function parse_user() {
+       function parse_user($mode='') {
+               global $manager;
+               if ($mode == 'realname' && $this->currentComment['memberid'] > 0) {
+                       $member =& $manager->getMember($this->currentComment['memberid']);
+                       echo $member->getRealName();
+               } else {
+                       echo $this->currentComment['user'];
+               }
+       }
+       
+       function parse_userid() {
+                       echo $this->currentComment['userid'];
+       }
+       
+       function parse_email() {
+               $email = $this->currentComment['email'];
+               $email = str_replace('@', ' (at) ', $email);
+               $email = str_replace('.', ' (dot) ', $email);
+               echo $email;
+       }
+       
+       function parse_userlinkraw() {
+               echo $this->currentComment['userlinkraw'];
+       }
+       
+       function parse_userlink() {
+               if ($this->currentComment['userlinkraw']) {
+                       echo '<a href="'.$this->currentComment['userlinkraw'].'" rel="nofollow">'.$this->currentComment['user'].'</a>';
+               } else {
+                       echo $this->currentComment['user'];
+               }
+       }
+
+       function parse_useremail() {
+               global $manager;
+               if ($this->currentComment['memberid'] > 0)
+               {
+                       $member =& $manager->getMember($this->currentComment['memberid']);
+
+                       if ($member->email != '')
+                               echo $member->email;
+               }
+               else
+               {
+                       if (isValidMailAddress($this->currentComment['email']))
+                               echo $this->currentComment['email'];
+                       elseif (isValidMailAddress($this->currentComment['userid']))
+                               echo $this->currentComment['userid'];
+//                     if (!(strpos($this->currentComment['userlinkraw'], 'mailto:') === false))
+//                             echo str_replace('mailto:', '', $this->currentComment['userlinkraw']);
+               }
+       }
+
+       function parse_userwebsite() {
+               if (!(strpos($this->currentComment['userlinkraw'], 'http://') === false))
+                       echo $this->currentComment['userlinkraw'];
+       }
+
+       function parse_excerpt() {
+               echo stringToXML(shorten($this->currentComment['body'], 60, '...'));
+       }
+       
+       function parse_short() {
+               $tmp = strtok($this->currentComment['body'],"\n");
+               $tmp = str_replace('<br />','',$tmp);
+               echo $tmp;
+               if ($tmp != $this->currentComment['body'])
+                       $this->parser->parse($this->template['COMMENTS_CONTINUED']);
+       }
+       
+       function parse_authtext() {
+               if ($this->currentComment['memberid'] != 0)
+                       $this->parser->parse($this->template['COMMENTS_AUTH']);
+       }
+
+       /**
+         * Executes a plugin templatevar
+         *
+         * @param pluginName name of plugin (without the NP_)
+         *
+         * extra parameters can be added
+         */
+       function parse_plugin($pluginName) {
+               global $manager;
+
+               // only continue when the plugin is really installed
+               if (!$manager->pluginInstalled('NP_' . $pluginName))
+                       return;
+
+               $plugin =& $manager->getPlugin('NP_' . $pluginName);
+               if (!$plugin) return;
+
+               // get arguments
+               $params = func_get_args();
+
+               // remove plugin name
+               array_shift($params);
+
+               // pass info on current item and current comment as well
+               $params = array_merge(array(&$this->currentComment),$params);
+               $params = array_merge(array(&$this->commentsObj->itemActions->currentItem),$params);
+
+               call_user_func_array(array(&$plugin,'doTemplateCommentsVar'), $params);
+       }
+}
+?>
\ No newline at end of file
index bb73358..517a7b3 100755 (executable)
@@ -15,8 +15,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: COMMENTS.php,v 1.4 2007-03-27 12:13:56 kimitake Exp $
- * $NucleusJP: COMMENTS.php,v 1.9 2007/03/20 19:31:29 kmorimatsu Exp $
+ * @version $Id: COMMENTS.php,v 1.5 2007-04-04 07:52:08 kimitake Exp $
+ * $NucleusJP: COMMENTS.php,v 1.4 2007/03/27 12:13:56 kimitake Exp $
  */
 
 if ( !function_exists('requestVar') ) exit;
@@ -150,7 +150,7 @@ class COMMENTS {
                if ($CONF['ProtectMemNames'] && !$member->isLoggedIn() && MEMBER::isNameProtected($comment['user']))
                        return _ERROR_COMMENTS_MEMBERNICK;
 
-               if ($isvalid != 1)
+               // email required protection
                if ($settings->emailRequired() && strlen($comment['email']) == 0 && !$member->isLoggedIn()) {
                        return _ERROR_EMAIL_REQUIRED;
                }
diff --git a/euc/nucleus/libs/ENCAPSULATE.php b/euc/nucleus/libs/ENCAPSULATE.php
new file mode 100644 (file)
index 0000000..be5df5a
--- /dev/null
@@ -0,0 +1,259 @@
+<?php
+/*
+ * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
+ * Copyright (C) 2002-2007 The Nucleus Group
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * (see nucleus/documentation/index.html#license for more info)
+ */
+
+/**
+ * Part of the code for the Nucleus admin area
+ *
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2007 The Nucleus Group
+ * @version $Id: ENCAPSULATE.php,v 1.1 2007-04-04 07:52:08 kimitake Exp $
+ * @version $NucleusJP: ENCAPSULATE.php,v 1.4 2007/03/22 03:30:14 kmorimatsu Exp $
+ */
+
+class ENCAPSULATE {
+       /**
+         * Uses $call to call a function using parameters $params
+         * This function should return the amount of entries shown.
+         * When entries are show, batch operation handlers are shown too.
+         * When no entries were shown, $errormsg is used to display an error
+         *
+         * Passes on the amount of results found (for further encapsulation)
+         */
+       function doEncapsulate($call, $params, $errorMessage = 'No entries') {
+               // start output buffering
+               ob_start();
+
+               $nbOfRows = call_user_func_array($call, $params);
+
+               // get list contents and stop buffering
+               $list = ob_get_contents();
+               ob_end_clean();
+
+               if ($nbOfRows > 0) {
+                       $this->showHead();
+                       echo $list;
+                       $this->showFoot();
+               } else {
+                       echo $errorMessage;
+               }
+
+               return $nbOfRows;
+       }
+}
+
+/**
+  * A class used to encapsulate a list of some sort inside next/prev buttons
+  */
+class NAVLIST extends ENCAPSULATE {
+
+       function NAVLIST($action, $start, $amount, $minamount, $maxamount, $blogid, $search, $itemid) {
+               $this->action = $action;
+               $this->start = $start;
+               $this->amount = $amount;
+               $this->minamount = $minamount;
+               $this->maxamount = $maxamount;
+               $this->blogid = $blogid;
+               $this->search = $search;
+               $this->itemid = $itemid;
+       }
+
+       function showBatchList($batchtype, $query, $type, $template, $errorMessage = _LISTS_NOMORE) {
+               $batch =& new BATCH($batchtype);
+
+               $this->doEncapsulate(
+                               array(&$batch, 'showlist'),
+                               array(&$query, $type, $template),
+                               $errorMessage
+               );
+
+       }
+
+
+       function showHead() {
+               $this->showNavigation();
+       }
+       function showFoot() {
+               $this->showNavigation();
+       }
+
+       /**
+         * Displays a next/prev bar for long tables
+         */
+       function showNavigation() {
+               $action = $this->action;
+               $start = $this->start;
+               $amount = $this->amount;
+               $minamount = $this->minamount;
+               $maxamount = $this->maxamount;
+               $blogid = $this->blogid;
+               $search = htmlspecialchars($this->search);
+               $itemid = $this->itemid;
+
+               $prev = $start - $amount;
+               if ($prev < $minamount) $prev=$minamount;
+
+               // maxamount not used yet
+       //      if ($start + $amount <= $maxamount)
+                       $next = $start + $amount;
+       //      else
+       //              $next = $start;
+
+       ?>
+       <table class="navigation">
+       <tr><td>
+               <form method="post" action="index.php"><div>
+               <input type="submit" value="&lt;&lt; <?php echo  _LISTS_PREV?>" />
+               <input type="hidden" name="blogid" value="<?php echo  $blogid; ?>" />
+               <input type="hidden" name="itemid" value="<?php echo  $itemid; ?>" />
+               <input type="hidden" name="action" value="<?php echo  $action; ?>" />
+               <input type="hidden" name="amount" value="<?php echo  $amount; ?>" />
+               <input type="hidden" name="search" value="<?php echo  $search; ?>" />
+               <input type="hidden" name="start" value="<?php echo  $prev; ?>" />
+               </div></form>
+       </td><td>
+               <form method="post" action="index.php"><div>
+               <input type="hidden" name="blogid" value="<?php echo  $blogid; ?>" />
+               <input type="hidden" name="itemid" value="<?php echo  $itemid; ?>" />
+               <input type="hidden" name="action" value="<?php echo  $action; ?>" />
+               <input name="amount" size="3" value="<?php echo  $amount; ?>" /> <?php echo _LISTS_PERPAGE?>
+               <input type="hidden" name="start" value="<?php echo  $start; ?>" />
+               <input type="hidden" name="search" value="<?php echo  $search; ?>" />
+               <input type="submit" value="&gt; <?php echo _LISTS_CHANGE?>" />
+               </div></form>
+       </td><td>
+               <form method="post" action="index.php"><div>
+               <input type="hidden" name="blogid" value="<?php echo  $blogid; ?>" />
+               <input type="hidden" name="itemid" value="<?php echo  $itemid; ?>" />
+               <input type="hidden" name="action" value="<?php echo  $action; ?>" />
+               <input type="hidden" name="amount" value="<?php echo  $amount; ?>" />
+               <input type="hidden" name="start" value="0" />
+               <input type="text" name="search" value="<?php echo  $search; ?>" size="7" />
+               <input type="submit" value="&gt; <?php echo  _LISTS_SEARCH?>" />
+               </div></form>
+       </td><td>
+               <form method="post" action="index.php"><div>
+               <input type="submit" value="<?php echo _LISTS_NEXT?> &gt; &gt;" />
+               <input type="hidden" name="search" value="<?php echo  $search; ?>" />
+               <input type="hidden" name="blogid" value="<?php echo  $blogid; ?>" />
+               <input type="hidden" name="itemid" value="<?php echo  $itemid; ?>" />
+               <input type="hidden" name="action" value="<?php echo  $action; ?>" />
+               <input type="hidden" name="amount" value="<?php echo  $amount; ?>" />
+               <input type="hidden" name="start" value="<?php echo  $next; ?>" />
+               </div></form>
+       </td></tr>
+       </table>
+       <?php   }
+
+
+}
+
+
+/**
+ * A class used to encapsulate a list of some sort in a batch selection
+ */
+class BATCH extends ENCAPSULATE {
+       function BATCH($type) {
+               $this->type = $type;
+       }
+
+       function showHead() {
+               ?>
+                       <form method="post" action="index.php">
+               <?php
+// TODO: get a list op operations above the list too
+// (be careful not to use the same names for the select...)
+//             $this->showOperationList();
+       }
+
+       function showFoot() {
+               $this->showOperationList();
+               ?>
+                       </form>
+               <?php   }
+
+       function showOperationList() {
+               global $manager;
+               ?>
+               <div class="batchoperations">
+                       <?php echo _BATCH_WITH_SEL ?>
+                       <select name="batchaction">
+                       <?php                           $options = array();
+                               switch($this->type) {
+                                       case 'item':
+                                               $options = array(
+                                                       'delete'        => _BATCH_ITEM_DELETE,
+                                                       'move'          => _BATCH_ITEM_MOVE
+                                               );
+                                               break;
+                                       case 'member':
+                                               $options = array(
+                                                       'delete'        => _BATCH_MEMBER_DELETE,
+                                                       'setadmin'      => _BATCH_MEMBER_SET_ADM,
+                                                       'unsetadmin' => _BATCH_MEMBER_UNSET_ADM
+                                               );
+                                               break;
+                                       case 'team':
+                                               $options = array(
+                                                       'delete'        => _BATCH_TEAM_DELETE,
+                                                       'setadmin'      => _BATCH_TEAM_SET_ADM,
+                                                       'unsetadmin' => _BATCH_TEAM_UNSET_ADM,
+                                               );
+                                               break;
+                                       case 'category':
+                                               $options = array(
+                                                       'delete'        => _BATCH_CAT_DELETE,
+                                                       'move'          => _BATCH_CAT_MOVE,
+                                               );
+                                               break;
+                                       case 'comment':
+                                               $options = array(
+                                                       'delete'        => _BATCH_COMMENT_DELETE,
+                                               );
+                                       break;
+                               }
+                               foreach ($options as $option => $label) {
+                                       echo '<option value="',$option,'">',$label,'</option>';
+                               }
+                       ?>
+                       </select>
+                       <input type="hidden" name="action" value="batch<?php echo $this->type?>" />
+                       <?php
+                               $manager->addTicketHidden();
+
+                               // add hidden fields for 'team' and 'comment' batchlists
+                               if ($this->type == 'team')
+                               {
+                                       echo '<input type="hidden" name="blogid" value="',intRequestVar('blogid'),'" />';
+                               }
+                               if ($this->type == 'comment')
+                               {
+                                       echo '<input type="hidden" name="itemid" value="',intRequestVar('itemid'),'" />';
+                               }
+
+                               echo '<input type="submit" value="',_BATCH_EXEC,'" />';
+                       ?>(
+                        <a href="" onclick="if (event &amp;&amp; event.preventDefault) event.preventDefault(); return batchSelectAll(1); "><?php echo _BATCH_SELECTALL?></a> -
+                        <a href="" onclick="if (event &amp;&amp; event.preventDefault) event.preventDefault(); return batchSelectAll(0); "><?php echo _BATCH_DESELECTALL?></a>
+                       )
+               </div>
+               <?php   }
+
+       // shortcut :)
+       function showList($query, $type, $template, $errorMessage = _LISTS_NOMORE) {
+               return $this->doEncapsulate(    'showlist',
+                                                                       array($query, $type, $template),
+                                                                       $errorMessage
+                                                               );
+       }
+
+}
+?>
diff --git a/euc/nucleus/libs/ITEMACTIONS.php b/euc/nucleus/libs/ITEMACTIONS.php
new file mode 100644 (file)
index 0000000..d62132c
--- /dev/null
@@ -0,0 +1,430 @@
+<?php
+/*
+ * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
+ * Copyright (C) 2002-2007 The Nucleus Group
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * (see nucleus/documentation/index.html#license for more info)
+ */
+/**
+ * This class to parse item templates
+ *
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2007 The Nucleus Group
+ * @version $Id: ITEMACTIONS.php,v 1.1 2007-04-04 07:52:08 kimitake Exp $
+ * @version $NucleusJP: ITEMACTIONS.php,v 1.5 2007/03/22 03:30:14 kmorimatsu Exp $
+ */
+class ITEMACTIONS extends BaseActions {
+
+       // contains an assoc array with parameters that need to be included when
+       // generating links to items/archives/... (e.g. catid)
+       var $linkparams;
+
+       // true when the current user is a blog admin (and thus allowed to edit all items)
+       var $allowEditAll;
+
+       // timestamp of last visit
+       var $lastVisit;
+
+       // item currently being handled (mysql result object, see BLOG::showUsingQuery)
+       var $currentItem;
+
+       // reference to the blog currently being displayed
+       var $blog;
+
+       // associative array with template info (part name => contents)
+       var $template;
+
+       // true when comments need to be displayed
+       var $showComments;
+
+       function ITEMACTIONS(&$blog) {
+               // call constructor of superclass first
+               $this->BaseActions();
+
+               // extra parameters for created links
+               global $catid;
+               if ($catid)
+                       $this->linkparams = array('catid' => $catid);
+
+               // check if member is blog admin (and thus allowed to edit all items)
+               global $member;
+               $this->allowEditAll = ($member->isLoggedIn() && $member->blogAdminRights($blog->getID()));
+               $this->setBlog($blog);
+       }
+
+       function getDefinedActions() {
+               return array(
+                       'blogid',
+                       'title',
+                       'body',
+                       'more',
+                       'smartbody',
+                       'itemid',
+                       'morelink',
+                       'category',
+                       'categorylink',
+                       'author',
+                       'authorid',
+                       'authorlink',
+                       'catid',
+                       'karma',
+                       'date',
+                       'time',
+                       'query',
+                       'itemlink',
+                       'blogurl',
+                       'closed',
+                       'syndicate_title',
+                       'syndicate_description',
+                       'karmaposlink',
+                       'karmaneglink',
+                       'new',
+                       'image',
+                       'popup',
+                       'media',
+                       'daylink',
+                       'query',
+                       'include',
+                       'phpinclude',
+                       'parsedinclude',
+                       'skinfile',
+                       'set',
+                       'plugin',
+                       'edit',
+                       'editlink',
+                       'editpopupcode',
+                       'comments',
+                       'relevance'/*,
+                       'if',
+                       'else',
+                       'endif',
+                       'elseif',
+                       'ifnot',
+                       'elseifnot'*/
+               );
+       }
+
+       function setLastVisit($lastVisit) {
+               $this->lastVisit = $lastVisit;
+       }
+       
+       function setParser(&$parser) {
+               $this->parser =& $parser;
+       }
+       
+       function setCurrentItem(&$item) {
+               $this->currentItem =& $item;
+       }
+       
+       function setBlog(&$blog) {
+               $this->blog =& $blog;
+       }
+       
+       function setTemplate($template) {
+               $this->template =& $template;
+       }
+       
+       function setShowComments($val) {
+               $this->showComments = $val;
+       }
+
+       // methods used by parser to insert content
+
+       function parse_blogid() {
+               echo $this->blog->getID();
+       }
+       
+       function parse_body() {
+               $this->highlightAndParse($this->currentItem->body);
+       }
+       
+       function parse_more() {
+               $this->highlightAndParse($this->currentItem->more);
+       }
+       
+       function parse_itemid() {
+               echo $this->currentItem->itemid;
+       }
+       
+       function parse_category() {
+               echo $this->currentItem->category;
+       }
+       
+       function parse_categorylink() {
+               echo createLink('category', array('catid' => $this->currentItem->catid, 'name' => $this->currentItem->category));
+       }
+       
+       function parse_catid() {
+               echo $this->currentItem->catid;
+       }
+       
+       function parse_authorid() {
+               echo $this->currentItem->authorid;
+       }
+       
+       function parse_authorlink() {
+               echo createLink(
+                       'member',
+                       array(
+                               'memberid' => $this->currentItem->authorid,
+                               'name' => $this->currentItem->author,
+                               'extra' => $this->linkparams
+                       )
+               );
+       }
+       
+       function parse_query() {
+               echo $this->strHighlight;
+       }
+       
+       function parse_itemlink() {
+               echo createLink(
+                       'item',
+                       array(
+                               'itemid' => $this->currentItem->itemid,
+                               'title' => $this->currentItem->title,
+                               'timestamp' => $this->currentItem->timestamp,
+                               'extra' => $this->linkparams
+                       )
+               );
+       }
+       
+       function parse_blogurl() {
+               echo $this->blog->getURL();
+       }
+       
+       function parse_closed() {
+               echo $this->currentItem->closed;
+       }
+       
+       function parse_relevance() {
+               echo round($this->currentItem->score,2);
+       }
+
+       function parse_title($format = '') {
+               switch ($format) {
+                       case 'xml':
+                               echo stringToXML ($this->currentItem->title);
+                               break;
+                       case 'attribute':
+                               echo stringToAttribute ($this->currentItem->title);
+                               break;
+                       case 'raw':
+                               echo $this->currentItem->title;
+                               break;
+                       default:
+                               $this->highlightAndParse($this->currentItem->title);
+                               break;
+               }
+       }
+
+       function parse_karma($type = 'totalscore') {
+               global $manager;
+
+               // get karma object
+               $karma =& $manager->getKarma($this->currentItem->itemid);
+
+               switch($type) {
+                       case 'pos':
+                               echo $karma->getNbPosVotes();
+                               break;
+                       case 'neg':
+                               echo $karma->getNbNegVotes();
+                               break;
+                       case 'votes':
+                               echo $karma->getNbOfVotes();
+                               break;
+                       case 'posp':
+                               $percentage = $karma->getNbOfVotes() ? 100 * ($karma->getNbPosVotes() / $karma->getNbOfVotes()) : 50;
+                               echo number_format($percentage,2), '%';
+                               break;
+                       case 'negp':
+                               $percentage = $karma->getNbOfVotes() ? 100 * ($karma->getNbNegVotes() / $karma->getNbOfVotes()) : 50;
+                               echo number_format($percentage,2), '%';
+                               break;
+                       case 'totalscore':
+                       default:
+                               echo $karma->getTotalScore();
+                               break;
+               }
+
+       }
+
+       function parse_author($which = '') {
+               switch($which)
+               {
+                       case 'realname':
+                               echo $this->currentItem->authorname;
+                               break;
+                       case 'id':
+                               echo $this->currentItem->authorid;
+                               break;
+                       case 'email':
+                               echo $this->currentItem->authormail;
+                               break;
+                       case 'url':
+                               echo $this->currentItem->authorurl;
+                               break;
+                       case 'name':
+                       default:
+                               echo $this->currentItem->author;
+               }
+       }
+
+       function parse_smartbody() {
+               if (!$this->currentItem->more) {
+                       $this->highlightAndParse($this->currentItem->body);
+               } else {
+                       $this->highlightAndParse($this->currentItem->more);
+               }
+       }
+
+       function parse_morelink() {
+               if ($this->currentItem->more)
+                       $this->parser->parse($this->template['MORELINK']);
+       }
+
+       function parse_date($format = '') {
+               echo formatDate($format, $this->currentItem->timestamp, $this->template['FORMAT_DATE'], $this->blog);
+       }
+
+       /**
+         * @param format optional strftime format
+         */
+       function parse_time($format = '') {
+               echo strftime($format ? $format : $this->template['FORMAT_TIME'],$this->currentItem->timestamp);
+       }
+
+       /**
+         * @param maxLength optional maximum length
+         */
+       function parse_syndicate_title($maxLength = 100) {
+               $syndicated = strip_tags($this->currentItem->title);
+               echo htmlspecialchars(shorten($syndicated,$maxLength,'...'),ENT_QUOTES);
+       }
+
+       /**
+         * @param maxLength optional maximum length
+         */
+       function parse_syndicate_description($maxLength = 250, $addHighlight = 0) {
+               $syndicated = strip_tags($this->currentItem->body);
+               if ($addHighlight) {
+                       $tmp_highlight = htmlspecialchars(shorten($syndicated,$maxLength,'...'),ENT_QUOTES);
+                       echo $this->highlightAndParse($tmp_highlight);
+               } else {
+                       echo htmlspecialchars(shorten($syndicated,$maxLength,'...'),ENT_QUOTES);
+               }
+       }
+
+       function parse_karmaposlink($text = '') {
+               global $CONF;
+               $link = $CONF['ActionURL'] . '?action=votepositive&amp;itemid='.$this->currentItem->itemid;
+               echo $text ? '<a href="'.$link.'">'.$text.'</a>' : $link;
+       }
+
+       function parse_karmaneglink($text = '') {
+               global $CONF;
+               $link = $CONF['ActionURL'] . '?action=votenegative&amp;itemid='.$this->currentItem->itemid;
+               echo $text ? '<a href="'.$link.'">'.$text.'</a>' : $link;
+       }
+
+       function parse_new() {
+               if (($this->lastVisit != 0) && ($this->currentItem->timestamp > $this->lastVisit))
+                       echo $this->template['NEW'];
+       }
+
+       function parse_daylink() {
+               echo createArchiveLink($this->blog->getID(), strftime('%Y-%m-%d',$this->currentItem->timestamp), $this->linkparams);
+       }
+
+       function parse_comments($maxToShow = 0) {
+               if ($maxToShow == 0)
+                       $maxToShow = $this->blog->getMaxComments();
+
+               // add comments
+               if ($this->showComments && $this->blog->commentsEnabled()) {
+                       $comments =& new COMMENTS($this->currentItem->itemid);
+                       $comments->setItemActions($this);
+                       $comments->showComments($this->template, $maxToShow, $this->currentItem->closed ? 0 : 1, $this->strHighlight);
+               }
+       }
+
+       /**
+         * Executes a plugin templatevar
+         *
+         * @param pluginName name of plugin (without the NP_)
+         *
+         * extra parameters can be added
+         */
+       function parse_plugin($pluginName) {
+               global $manager;
+
+               // only continue when the plugin is really installed
+               if (!$manager->pluginInstalled('NP_' . $pluginName))
+                       return;
+
+               $plugin =& $manager->getPlugin('NP_' . $pluginName);
+               if (!$plugin) return;
+
+               // get arguments
+               $params = func_get_args();
+
+               // remove plugin name
+               array_shift($params);
+
+               // add item reference (array_unshift didn't work)
+               $params = array_merge(array(&$this->currentItem),$params);
+
+               call_user_func_array(array(&$plugin,'doTemplateVar'), $params);
+       }
+
+       function parse_edit() {
+               global $member, $CONF;
+               if ($this->allowEditAll || ($member->isLoggedIn() && ($member->getID() == $this->currentItem->authorid)) ) {
+                       $this->parser->parse($this->template['EDITLINK']);
+               }
+       }
+
+       function parse_editlink() {
+               global $CONF;
+               echo $CONF['AdminURL'],'bookmarklet.php?action=edit&amp;itemid=',$this->currentItem->itemid;
+       }
+
+       function parse_editpopupcode() {
+               echo "if (event &amp;&amp; event.preventDefault) event.preventDefault();winbm=window.open(this.href,'nucleusbm','scrollbars=yes,width=600,height=500,left=10,top=10,status=yes,resizable=yes');winbm.focus();return false;";
+       }
+
+       // helper functions
+
+       /**
+        * Parses highlighted text, with limited actions only (to prevent not fully trusted team members
+        * from hacking your weblog.
+        * 'plugin variables in items' implementation by Andy
+        */
+       function highlightAndParse(&$data) {
+               $actions =& new BODYACTIONS($this->blog);
+               $parser =& new PARSER($actions->getDefinedActions(), $actions);
+               $actions->setTemplate($this->template);
+               $actions->setHighlight($this->strHighlight);
+               $actions->setCurrentItem($this->currentItem);
+               //$actions->setParser($parser);
+               $parser->parse($actions->highlight($data));
+       }
+
+       /*
+       // this is the function previous to the 'plugin variables in items' implementation by Andy
+       function highlightAndParse(&$data) {
+               // allow only a limited subset of actions (do not allow includes etc, they might be evil)
+               $this->parser->actions = array('image','media','popup');
+               $tmp_highlight = $this->highlight($data);
+               $this->parser->parse($tmp_highlight);
+               $this->parser->actions = $this->getDefinedActions();
+       }
+       */
+}
+
+?>
\ No newline at end of file
diff --git a/euc/nucleus/libs/entity.php b/euc/nucleus/libs/entity.php
new file mode 100644 (file)
index 0000000..3411d7b
--- /dev/null
@@ -0,0 +1,186 @@
+<?php
+
+class entity {
+
+       function named_to_numeric ($string) {
+               $string = preg_replace('/(&[0-9A-Za-z]+)(;?\=?|([^A-Za-z0-9\;\:\.\-\_]))/e', "entity::_named('\\1', '\\2') . '\\3'", $string);
+               return $string; 
+       }
+       
+       function normalize_numeric ($string) {
+               global $_entities;
+               $string = preg_replace('/&#([0-9]+)(;)?/e', "'&#x'.dechex('\\1').';'", $string);
+               $string = preg_replace('/&#[Xx](0)*([0-9A-Fa-f]+)(;?|([^A-Za-z0-9\;\:\.\-\_]))/e', "'&#x' . strtoupper('\\2') . ';\\4'", $string);
+               $string = strtr($string, $_entities['cp1251']);
+               return $string;
+       }
+       function numeric_to_utf8 ($string) {
+               $string = preg_replace('/&#([0-9]+)(;)?/e', "'&#x'.dechex('\\1').';'", $string);
+               $string = preg_replace('/&#[Xx](0)*([0-9A-Fa-f]+)(;?|([^A-Za-z0-9\;\:\.\-\_]))/e', "'&#x' . strtoupper('\\2') . ';\\4'", $string);
+               $string = preg_replace('/&#x([0-9A-Fa-f]+);/e', "entity::_hex_to_utf8('\\1')", $string);                
+               return $string;         
+       }
+
+       function numeric_to_named ($string) {
+               global $_entities;
+               $string = preg_replace('/&#[Xx]([0-9A-Fa-f]+)/e', "'&#'.hexdec('\\1')", $string);
+               $string = strtr($string, array_flip($_entities['named']));
+               return $string; 
+       }
+       
+       function specialchars ($string, $type = 'xml') {
+               $apos = $type == 'xml' ? '&apos;' : '&#39;';
+               $specialchars = array (
+                       '&quot;'        => '&quot;',            '&amp;'         => '&amp;',             
+                       '&apos;'        => $apos,                       '&lt;'          => '&lt;',              
+                       '&gt;'          => '&gt;',                      '"'                     => '&quot;',
+                       '&'                     => '&amp;',                     "'"                     => $apos,
+                       '<'                     => '&lt;',                      '>'                     => '&gt;'
+               );
+       
+               $string = preg_replace('/&(#?[Xx]?[0-9A-Za-z]+);/', "[[[ENTITY:\\1]]]", $string);               
+               $string = strtr($string, $specialchars);
+               $string = preg_replace('/\[\[\[ENTITY\:([^\]]+)\]\]\]/', "&\\1;", $string);             
+               return $string;
+       }
+       
+
+       function _hex_to_utf8($s)
+       {
+               $c = hexdec($s);
+       
+               if ($c < 0x80) {
+                       $str = chr($c);
+               }
+               else if ($c < 0x800) {
+                       $str = chr(0xC0 | $c>>6) . chr(0x80 | $c & 0x3F);
+               }
+               else if ($c < 0x10000) {
+                       $str = chr(0xE0 | $c>>12) . chr(0x80 | $c>>6 & 0x3F) . chr(0x80 | $c & 0x3F);
+               }
+               else if ($c < 0x200000) {
+                       $str = chr(0xF0 | $c>>18) . chr(0x80 | $c>>12 & 0x3F) . chr(0x80 | $c>>6 & 0x3F) . chr(0x80 | $c & 0x3F);
+               }
+                               
+               return $str;
+       }               
+
+       function _named($entity, $extra) {
+               global $_entities;
+               
+               if ($extra == '=') return $entity . '=';
+               
+               $length = strlen($entity);
+
+               while ($length > 0) {
+                       $check = substr($entity, 0, $length);
+                       if (isset($_entities['named'][$check])) return $_entities['named'][$check] . ';' . substr($entity, $length);
+                       $length--;
+               }
+               
+               return $entity . ($extra == ';' ? ';' : '');
+       }
+}
+
+
+$_entities['cp1251'] = array (
+       '&#x80;'                => '&#x20AC;',  '&#x82;'                => '&#x201A;',  '&#x83;'                => '&#x192;',   
+       '&#x84;'                => '&#x201E;',  '&#x85;'                => '&#x2026;',  '&#x86;'                => '&#x2020;',  
+       '&#x87;'                => '&#x2021;',  '&#x88;'                => '&#x2C6;',   '&#x89;'                => '&#x2030;',  
+       '&#x8A;'                => '&#x160;',   '&#x8B;'                => '&#x2039;',  '&#x8C;'                => '&#x152;',   
+       '&#x8E;'                => '&#x17D;',   '&#x91;'                => '&#x2018;',  '&#x92;'                => '&#x2019;',  
+       '&#x93;'                => '&#x201C;',  '&#x94;'                => '&#x201D;',  '&#x95;'                => '&#x2022;',  
+       '&#x96;'                => '&#x2013;',  '&#x97;'                => '&#x2014;',  '&#x98;'                => '&#x2DC;',   
+       '&#x99;'                => '&#x2122;',  '&#x9A;'                => '&#x161;',   '&#x9B;'                => '&#x203A;',  
+       '&#x9C;'                => '&#x153;',   '&#x9E;'                => '&#x17E;',   '&#x9F;'                => '&#x178;',   
+);
+       
+$_entities['named'] = array (
+       '&nbsp'                 => '&#160',             '&iexcl'                => '&#161',             '&cent'                 => '&#162',     
+       '&pound'                => '&#163',             '&curren'               => '&#164',             '&yen'                  => '&#165',     
+       '&brvbar'               => '&#166',     '&sect'                 => '&#167',             '&uml'                  => '&#168',     
+       '&copy'                 => '&#169',             '&ordf'                 => '&#170',             '&laquo'                => '&#171',     
+       '&not'                  => '&#172',             '&shy'                  => '&#173',             '&reg'                  => '&#174',     
+       '&macr'                 => '&#175',             '&deg'                  => '&#176',             '&plusmn'               => '&#177',     
+       '&sup2'                 => '&#178',             '&sup3'                 => '&#179',     '&acute'                => '&#180',     
+       '&micro'                => '&#181',     '&para'                 => '&#182',             '&middot'               => '&#183',     
+       '&cedil'                => '&#184',     '&sup1'                 => '&#185',             '&ordm'                 => '&#186',     
+       '&raquo'                => '&#187',             '&frac14'               => '&#188',             '&frac12'               => '&#189',     
+       '&frac34'               => '&#190',             '&iquest'               => '&#191',             '&Agrave'               => '&#192',     
+       '&Aacute'               => '&#193',             '&Acirc'                => '&#194',             '&Atilde'               => '&#195',     
+       '&Auml'                 => '&#196',             '&Aring'                => '&#197',             '&AElig'                => '&#198',     
+       '&Ccedil'               => '&#199',     '&Egrave'               => '&#200',             '&Eacute'               => '&#201',     
+       '&Ecirc'                => '&#202',             '&Euml'                 => '&#203',             '&Igrave'               => '&#204',     
+       '&Iacute'               => '&#205',             '&Icirc'                => '&#206',             '&Iuml'                 => '&#207',     
+       '&ETH'                  => '&#208',             '&Ntilde'               => '&#209',             '&Ograve'               => '&#210',     
+       '&Oacute'               => '&#211',             '&Ocirc'                => '&#212',             '&Otilde'               => '&#213',     
+       '&Ouml'                 => '&#214',             '&times'                => '&#215',             '&Oslash'               => '&#216',     
+       '&Ugrave'               => '&#217',             '&Uacute'               => '&#218',             '&Ucirc'                => '&#219',     
+       '&Uuml'                 => '&#220',             '&Yacute'               => '&#221',             '&THORN'                => '&#222',     
+       '&szlig'                => '&#223',             '&agrave'               => '&#224',             '&aacute'               => '&#225',     
+       '&acirc'                => '&#226',             '&atilde'               => '&#227',             '&auml'                 => '&#228',     
+       '&aring'                => '&#229',             '&aelig'                => '&#230',             '&ccedil'               => '&#231',     
+       '&egrave'               => '&#232',             '&eacute'               => '&#233',             '&ecirc'                => '&#234',     
+       '&euml'                 => '&#235',             '&igrave'               => '&#236',             '&iacute'               => '&#237',     
+       '&icirc'                => '&#238',             '&iuml'                 => '&#239',             '&eth'                  => '&#240',     
+       '&ntilde'               => '&#241',             '&ograve'               => '&#242',             '&oacute'               => '&#243',     
+       '&ocirc'                => '&#244',             '&otilde'               => '&#245',             '&ouml'                 => '&#246',     
+       '&divide'               => '&#247',             '&oslash'               => '&#248',             '&ugrave'               => '&#249',     
+       '&uacute'               => '&#250',             '&ucirc'                => '&#251',             '&uuml'                 => '&#252',     
+       '&yacute'               => '&#253',             '&thorn'                => '&#254',             '&yuml'                 => '&#255',     
+       '&OElig'                => '&#338',             '&oelig'                => '&#229',             '&Scaron'               => '&#352',     
+       '&scaron'               => '&#353',             '&Yuml'                 => '&#376',             '&circ'                 => '&#710',     
+       '&tilde'                => '&#732',     '&esnp'                 => '&#8194',    '&emsp'                 => '&#8195',    
+       '&thinsp'               => '&#8201',    '&zwnj'                 => '&#8204',    '&zwj'                  => '&#8205',    
+       '&lrm'                  => '&#8206',    '&rlm'                  => '&#8207',    '&ndash'                => '&#8211',    
+       '&mdash'                => '&#8212',    '&lsquo'                => '&#8216',    '&rsquo'                => '&#8217',    
+       '&sbquo'                => '&#8218',    '&ldquo'                => '&#8220',    '&rdquo'                => '&#8221',    
+       '&bdquo'                => '&#8222',    '&dagger'               => '&#8224',    '&Dagger'               => '&#8225',    
+       '&permil'               => '&#8240',    '&lsaquo'               => '&#8249',    '&rsaquo'               => '&#8250',
+       '&euro'                 => '&#8364',    '&fnof'                 => '&#402',             '&Alpha'                => '&#913',     
+       '&Beta'                 => '&#914',             '&Gamma'                => '&#915',             '&Delta'                => '&#916',     
+       '&Epsilon'              => '&#917',             '&Zeta'                 => '&#918',             '&Eta'                  => '&#919',     
+       '&Theta'                => '&#920',             '&Iota'                 => '&#921',             '&Kappa'                => '&#922',     
+       '&Lambda'               => '&#923',             '&Mu'                   => '&#924',             '&Nu'                   => '&#925',     
+       '&Xi'                   => '&#926',             '&Omicron'              => '&#927',             '&Pi'                   => '&#928',     
+       '&Rho'                  => '&#929',             '&Sigma'                => '&#931',             '&Tau'                  => '&#932',     
+       '&Upsilon'              => '&#933',     '&Phi'                  => '&#934',             '&Chi'                  => '&#935',     
+       '&Psi'                  => '&#936',             '&Omega'                => '&#937',             '&alpha'                => '&#945',     
+       '&beta'                 => '&#946',             '&gamma'                => '&#947',             '&delta'                => '&#948',     
+       '&epsilon'              => '&#949',             '&zeta'                 => '&#950',             '&eta'                  => '&#951',     
+       '&theta'                => '&#952',             '&iota'                 => '&#953',             '&kappa'                => '&#954',     
+       '&lambda'               => '&#955',             '&mu'                   => '&#956',             '&nu'                   => '&#957',     
+       '&xi'                   => '&#958',             '&omicron'              => '&#959',             '&pi'                   => '&#960',     
+       '&rho'                  => '&#961',             '&sigmaf'               => '&#962',             '&sigma'                => '&#963',     
+       '&tau'                  => '&#964',             '&upsilon'              => '&#965',     '&phi'                  => '&#966',     
+       '&chi'                  => '&#967',             '&psi'                  => '&#968',             '&omega'                => '&#969',     
+       '&thetasym'             => '&#977',             '&upsih'                => '&#978',             '&piv'                  => '&#982',     
+       '&bull'                 => '&#8226',    '&hellip'               => '&#8230',    '&prime'                => '&#8242',    
+       '&Prime'                => '&#8243',    '&oline'                => '&#8254',    '&frasl'                => '&#8260',    
+       '&weierp'               => '&#8472',    '&image'                => '&#8465',    '&real'                 => '&#8476',    
+       '&trade'                => '&#8482',    '&alefsym'              => '&#8501',    '&larr'                 => '&#8592',    
+       '&uarr'                 => '&#8593',    '&rarr'                 => '&#8594',    '&darr'                 => '&#8595',    
+       '&harr'                 => '&#8596',    '&crarr'                => '&#8629',    '&lArr'                 => '&#8656',    
+       '&uArr'                 => '&#8657',    '&rArr'                 => '&#8658',    '&dArr'                 => '&#8659',    
+       '&hArr'                 => '&#8660',    '&forall'               => '&#8704',    '&part'                 => '&#8706',    
+       '&exist'                => '&#8707',    '&empty'                => '&#8709',    '&nabla'                => '&#8711',    
+       '&isin'                 => '&#8712',    '&notin'                => '&#8713',    '&ni'                   => '&#8715',    
+       '&prod'                 => '&#8719',    '&sum'                  => '&#8721',    '&minus'                => '&#8722',    
+       '&lowast'               => '&#8727',    '&radic'                => '&#8730',    '&prop'                 => '&#8733',    
+       '&infin'                => '&#8734',    '&ang'                  => '&#8736',    '&and'                  => '&#8743',    
+       '&or'                   => '&#8744',    '&cap'                  => '&#8745',    '&cup'                  => '&#8746',    
+       '&int'                  => '&#8747',    '&there4'               => '&#8756',    '&sim'                  => '&#8764',    
+       '&cong'                 => '&#8773',    '&asymp'                => '&#8776',    '&ne'                   => '&#8800',    
+       '&equiv'                => '&#8801',    '&le'                   => '&#8804',    '&ge'                   => '&#8805',    
+       '&sub'                  => '&#8834',    '&sup'                  => '&#8835',    '&nsub'                 => '&#8836',    
+       '&sube'                 => '&#8838',    '&supe'                 => '&#8839',    '&oplus'                => '&#8853',    
+       '&otimes'               => '&#8855',    '&perp'                 => '&#8869',    '&sdot'                 => '&#8901',    
+       '&lceil'                => '&#8968',    '&rceil'                => '&#8969',    '&lfloor'               => '&#8970',    
+       '&rfloor'               => '&#8971',    '&lang'                 => '&#9001',    '&rang'                 => '&#9002',    
+       '&loz'                  => '&#9674',    '&spades'               => '&#9824',    '&clubs'                => '&#9827',    
+       '&hearts'               => '&#9829',    '&diams'                => '&#9830',    
+);
+
+
+?>
\ No newline at end of file
diff --git a/euc/nucleus/libs/mysql.php b/euc/nucleus/libs/mysql.php
new file mode 100644 (file)
index 0000000..1e6829f
--- /dev/null
@@ -0,0 +1,122 @@
+<?php
+
+/*
+ * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
+ * Copyright (C) 2002-2007 The Nucleus Group
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * (see nucleus/documentation/index.html#license for more info)
+ */
+/**
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2007 The Nucleus Group
+ * @version $Id: mysql.php,v 1.1 2007-04-04 07:52:08 kimitake Exp $
+ * @version $NucleusJP: mysql.php,v 1.3 2007/02/04 06:28:46 kimitake Exp $
+ */
+/*
+ * if no mysql_* functions exist, define wrappers
+ */
+$MYSQL_CONN = 0;
+
+if (!function_exists('mysql_query'))
+{
+       if (!function_exists('mysqli_query') && function_exists('startUpError'))
+       {
+               startUpError('<p>No suitable mySQL library was found to run Nucleus</p>');
+       }
+       
+       function mysql_query($query) 
+       {
+               global $MYSQL_CONN;
+               return mysqli_query($MYSQL_CONN, $query); 
+       }
+       
+       function mysql_fetch_object($res) 
+       { 
+               return mysqli_fetch_object($res);
+       }
+       
+       function mysql_fetch_array($res) 
+       { 
+               return mysqli_fetch_array($res);
+       }       
+       
+       function mysql_fetch_assoc($res) 
+       { 
+               return mysqli_fetch_assoc($res);
+       }       
+
+       function mysql_fetch_row($res) 
+       { 
+               return mysqli_fetch_row($res);
+       }       
+
+       function mysql_num_rows($res)
+       {
+               return mysqli_num_rows($res);
+       }
+       
+       function mysql_num_fields($res)
+       {
+               return mysqli_num_fields($res);
+       }
+       
+       function mysql_free_result($res)
+       {
+               return mysqli_free_result($res);
+       }
+       
+       function mysql_result($res, $row, $col) 
+       { 
+               if (($row != 0) || ($col != 0)) {
+                       trigger_error('not implemented', E_USER_ERROR);
+               }
+               
+               $row = mysqli_fetch_row($res);
+               return $row[$col];
+       }       
+       
+       function mysql_connect($host, $username, $pwd)
+       {
+               return mysqli_connect($host, $username, $pwd);
+       }
+       
+       function mysql_error()
+       {
+               global $MYSQL_CONN;
+               return mysqli_error($MYSQL_CONN);
+       }
+       
+       function mysql_select_db($db)
+       {
+               global $MYSQL_CONN;
+               return mysqli_select_db($MYSQL_CONN, $db);
+       }
+       
+       function mysql_close()
+       {
+               global $MYSQL_CONN;
+               return mysqli_close($MYSQL_CONN);
+       }
+       
+       function mysql_insert_id()
+       {
+               global $MYSQL_CONN;
+               return mysqli_insert_id($MYSQL_CONN);
+       }
+       
+       function mysql_affected_rows()
+       {
+               global $MYSQL_CONN;
+               return mysqli_affected_rows($MYSQL_CONN);
+       }
+}
+
+
+
+?>
\ No newline at end of file
diff --git a/euc/nucleus/libs/showlist.php b/euc/nucleus/libs/showlist.php
new file mode 100644 (file)
index 0000000..e7789b7
--- /dev/null
@@ -0,0 +1,632 @@
+<?php
+/*
+ * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
+ * Copyright (C) 2002-2007 The Nucleus Group
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * (see nucleus/documentation/index.html#license for more info)
+ */
+/**
+ * Functions to create lists of things inside the admin are
+ *
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2007 The Nucleus Group
+ * @version $Id: showlist.php,v 1.1 2007-04-04 07:52:08 kimitake Exp $
+ * @version $NucleusJP: showlist.php,v 1.6 2007/03/19 10:21:21 shizuki Exp $
+ */
+
+
+// can take either an array of objects, or an SQL query
+function showlist($query, $type, $template) {
+
+       if (is_array($query)) {
+               if (sizeof($query) == 0)
+                       return 0;
+
+               call_user_func('listplug_' . $type, $template, 'HEAD');
+
+               foreach ($query as $currentObj) {
+                       $template['current'] = $currentObj;
+                       call_user_func('listplug_' . $type, $template, 'BODY');
+               }
+
+               call_user_func('listplug_' . $type, $template, 'FOOT');
+
+               return sizeof($query);
+
+       } else {
+               $res = sql_query($query);
+
+               // don't do anything if there are no results
+               $numrows = mysql_num_rows($res);
+               if ($numrows == 0)
+                       return 0;
+
+               call_user_func('listplug_' . $type, $template, 'HEAD');
+
+               while($template['current'] = mysql_fetch_object($res))
+                       call_user_func('listplug_' . $type, $template, 'BODY');
+
+               call_user_func('listplug_' . $type, $template, 'FOOT');
+
+               mysql_free_result($res);
+
+               // return amount of results
+               return $numrows;
+       }
+}
+
+function listplug_select($template, $type) {
+       switch($type) {
+               case 'HEAD':
+                       echo '<select name="' . ifset($template['name']) . '" tabindex="' . ifset($template['tabindex']) . '" ' . ifset($template['javascript']) . '>';
+
+                       // add extra row if needed
+                       if (ifset($template['extra'])) {
+                               echo '<option value="', ifset($template['extraval']), '">', $template['extra'], '</option>';
+                       }
+
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+
+                       echo '<option value="' . htmlspecialchars($current->value) . '"';
+                       if ($template['selected'] == $current->value)
+                               echo ' selected="selected" ';
+                       if (isset($template['shorten']) && $template['shorten'] > 0) {
+                               echo ' title="'. htmlspecialchars($current->text).'"';
+                               $current->text = shorten($current->text, $template['shorten'], $template['shortenel']);
+                       }
+                       echo '>' . htmlspecialchars($current->text) . '</option>';
+                       break;
+               case 'FOOT':
+                       echo '</select>';
+                       break;
+       }
+}
+
+function listplug_table($template, $type) {
+       switch($type) {
+               case 'HEAD':
+                       echo "<table>";
+                       echo "<thead><tr>";
+                       // print head
+                       call_user_func("listplug_table_" . $template['content'] , $template, 'HEAD');
+                       echo "</tr></thead><tbody>";
+                       break;
+               case 'BODY':
+                       // print tabletype specific thingies
+                       echo "<tr onmouseover='focusRow(this);' onmouseout='blurRow(this);'>";
+                       call_user_func("listplug_table_" . $template['content'] , $template,  'BODY');
+                       echo "</tr>";
+                       break;
+               case 'FOOT':
+                       call_user_func("listplug_table_" . $template['content'] , $template,  'FOOT');
+                       echo "</tbody></table>";
+                       break;
+       }
+}
+
+function listplug_table_memberlist($template, $type) {
+       switch($type) {
+               case 'HEAD':
+                       echo '<th>' . _LIST_MEMBER_NAME . '</th><th>' . _LIST_MEMBER_RNAME . '</th><th>' . _LIST_MEMBER_URL . '</th><th>' . _LIST_MEMBER_ADMIN;
+                       help('superadmin');
+                       echo "</th><th>" . _LIST_MEMBER_LOGIN;
+                       help('canlogin');
+                       echo "</th><th colspan='2'>" . _LISTS_ACTIONS. "</th>";
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+
+                       echo '<td>';
+                       $id = listplug_nextBatchId();
+                       echo '<input type="checkbox" id="batch',$id,'" name="batch[',$id,']" value="',$current->mnumber,'" />';
+                       echo '<label for="batch',$id,'">';
+                       echo "<a href='mailto:", htmlspecialchars($current->memail), "' tabindex='".$template['tabindex']."'>", htmlspecialchars($current->mname), "</a>";
+                       echo '</label>';
+                       echo '</td>';
+                       echo '<td>', htmlspecialchars($current->mrealname), '</td>';
+                       echo "<td><a href='", htmlspecialchars($current->murl), "' tabindex='", $template['tabindex'] , "'>", htmlspecialchars($current->murl), "</a></td>";
+                       echo '<td>', ($current->madmin ? _YES : _NO),'</td>';
+                       echo '<td>', ($current->mcanlogin ? _YES : _NO), '</td>';
+                       echo "<td><a href='index.php?action=memberedit&amp;memberid=$current->mnumber' tabindex='".$template['tabindex']."'>"._LISTS_EDIT."</a></td>";
+                       echo "<td><a href='index.php?action=memberdelete&amp;memberid=$current->mnumber' tabindex='".$template['tabindex']."'>"._LISTS_DELETE."</a></td>";
+                       break;
+       }
+}
+
+function listplug_table_teamlist($template, $type) {
+       global $manager;
+       switch($type) {
+               case 'HEAD':
+                       echo "<th>"._LIST_MEMBER_NAME."</th><th>"._LIST_MEMBER_RNAME."</th><th>"._LIST_TEAM_ADMIN;
+                       help('teamadmin');
+                       echo "</th><th colspan='2'>"._LISTS_ACTIONS."</th>";
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+
+                       echo '<td>';
+                       $id = listplug_nextBatchId();
+                       echo '<input type="checkbox" id="batch',$id,'" name="batch[',$id,']" value="',$current->tmember,'" />';
+                       echo '<label for="batch',$id,'">';
+                       echo "<a href='mailto:", htmlspecialchars($current->memail), "' tabindex='".$template['tabindex']."'>", htmlspecialchars($current->mname), "</a>";
+                       echo '</label>';
+                       echo '</td>';
+                       echo '<td>', htmlspecialchars($current->mrealname), '</td>';
+                       echo '<td>', ($current->tadmin ? _YES : _NO) , '</td>';
+                       echo "<td><a href='index.php?action=teamdelete&amp;memberid=$current->tmember&amp;blogid=$current->tblog' tabindex='".$template['tabindex']."'>"._LISTS_DELETE."</a></td>";
+
+                       $url = 'index.php?action=teamchangeadmin&memberid=' . intval($current->tmember) . '&blogid=' . intval($current->tblog);
+                       $url = $manager->addTicketToUrl($url);
+                       echo "<td><a href='",htmlspecialchars($url),"' tabindex='".$template['tabindex']."'>"._LIST_TEAM_CHADMIN."</a></td>";
+                       break;
+       }
+}
+
+function listplug_table_pluginlist($template, $type) {
+       global $manager;
+       switch($type) {
+               case 'HEAD':
+                       echo '<th>'._LISTS_INFO.'</th><th>'._LISTS_DESC.'</th>';
+                       echo '<th style="white-space:nowrap">'._LISTS_ACTIONS.'</th>';
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+
+                       $plug =& $manager->getPlugin($current->pfile);
+                       if ($plug) {
+                               echo '<td>';
+                                       echo '<strong>' , htmlspecialchars($plug->getName()) , '</strong><br />';
+                                       echo _LIST_PLUGS_AUTHOR, ' ' , htmlspecialchars($plug->getAuthor()) , '<br />';
+                                       echo _LIST_PLUGS_VER, ' ' , htmlspecialchars($plug->getVersion()) , '<br />';
+                                       if ($plug->getURL())
+                                       echo '<a href="',htmlspecialchars($plug->getURL()),'" tabindex="'.$template['tabindex'].'">',_LIST_PLUGS_SITE,'</a><br />';
+                               echo '</td>';
+                               echo '<td>';
+                                       echo _LIST_PLUGS_DESC .'<br/>'. encode_desc($plug->getDescription());
+                                       if (sizeof($plug->getEventList()) > 0) {
+                                               echo '<br /><br />',_LIST_PLUGS_SUBS,'<br />',htmlspecialchars(implode($plug->getEventList(),', '));
+                                               // check the database to see if it is up-to-date and notice the user if not
+                                       }
+                                       if (!$plug->subscribtionListIsUptodate()) {
+                                               echo '<br /><br /><strong>',_LIST_PLUG_SUBS_NEEDUPDATE,'</strong>';
+                                       }
+                                       if (sizeof($plug->getPluginDep()) > 0)
+                                               echo '<br /><br />',_LIST_PLUGS_DEP,'<br />',htmlspecialchars(implode($plug->getPluginDep(),', '));
+                               echo '</td>';
+                       } else {
+                               echo '<td colspan="2">Error: plugin file <b>',htmlspecialchars($current->pfile),'.php</b> could not be loaded, or it has been set inactive because it does not support some features (check the <a href="?action=actionlog">actionlog</a> for more info)</td>';
+                       }
+                       echo '<td>';
+
+                               $baseUrl = 'index.php?plugid=' . intval($current->pid) . '&action=';
+                               $url = $manager->addTicketToUrl($baseUrl . 'pluginup');
+                               echo "<a href='",htmlspecialchars($url),"' tabindex='".$template['tabindex']."'>",_LIST_PLUGS_UP,"</a>";
+                               $url = $manager->addTicketToUrl($baseUrl . 'plugindown');
+                               echo "<br /><a href='",htmlspecialchars($url),"' tabindex='".$template['tabindex']."'>",_LIST_PLUGS_DOWN,"</a>";
+                               echo "<br /><a href='index.php?action=plugindelete&amp;plugid=$current->pid' tabindex='".$template['tabindex']."'>",_LIST_PLUGS_UNINSTALL,"</a>";
+                               if ($plug && ($plug->hasAdminArea() > 0))
+                                       echo "<br /><a href='".htmlspecialchars($plug->getAdminURL())."'  tabindex='".$template['tabindex']."'>",_LIST_PLUGS_ADMIN,"</a>";
+                               if ($plug && ($plug->supportsFeature('HelpPage') > 0))
+                                       echo "<br /><a href='index.php?action=pluginhelp&amp;plugid=$current->pid'  tabindex='".$template['tabindex']."'>",_LIST_PLUGS_HELP,"</a>";
+                               if (quickQuery('SELECT COUNT(*) AS result FROM '.sql_table('plugin_option_desc').' WHERE ocontext=\'global\' and opid='.$current->pid) > 0)
+                                       echo "<br /><a href='index.php?action=pluginoptions&amp;plugid=$current->pid'  tabindex='".$template['tabindex']."'>",_LIST_PLUGS_OPTIONS,"</a>";
+                       echo '</td>';
+                       break;
+       }
+}
+
+function listplug_table_plugoptionlist($template, $type) {
+       global $manager;
+       switch($type) {
+               case 'HEAD':
+                       echo '<th>'._LISTS_INFO.'</th><th>'._LISTS_VALUE.'</th>';
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+                       listplug_plugOptionRow($current);
+                       break;
+               case 'FOOT':
+                       ?>
+                       <tr>
+                               <th colspan="2"><?php echo _PLUGS_SAVE?></th>
+                       </tr><tr>
+                               <td><?php echo _PLUGS_SAVE?></td>
+                               <td><input type="submit" value="<?php echo _PLUGS_SAVE?>" /></td>
+                       </tr>
+                       <?php                   break;
+       }
+}
+
+function listplug_plugOptionRow($current) {
+       $varname = 'plugoption['.$current['oid'].']['.$current['contextid'].']';
+       // retreive the optionmeta
+       $meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
+
+       // only if it is not a hidden option write the controls to the page
+       if ($meta['access'] != 'hidden') {
+               echo '<td>',htmlspecialchars($current['description']?$current['description']:$current['name']),'</td>';
+               echo '<td>';
+               switch($current['type']) {
+                       case 'yesno':
+                               ADMIN::input_yesno($varname, $current['value'], 0, 'yes', 'no');
+                               break;
+                       case 'password':
+                               echo '<input type="password" size="40" maxlength="128" name="',htmlspecialchars($varname),'" value="',htmlspecialchars($current['value']),'" />';
+                               break;
+                       case 'select':
+                               echo '<select name="'.htmlspecialchars($varname).'">';
+                               $aOptions = NucleusPlugin::getOptionSelectValues($current['typeinfo']);
+                               $aOptions = explode('|', $aOptions);
+                               for ($i=0; $i<(count($aOptions)-1); $i+=2) {
+                                       echo '<option value="'.htmlspecialchars($aOptions[$i+1]).'"';
+                                       if ($aOptions[$i+1] == $current['value'])
+                                               echo ' selected="selected"';
+                                       echo '>'.htmlspecialchars($aOptions[$i]).'</option>';
+                               }
+                               echo '</select>';
+                               break;
+                       case 'textarea':
+                               //$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
+                               echo '<textarea class="pluginoption" cols="30" rows="5" name="',htmlspecialchars($varname),'"';
+                               if ($meta['access'] == 'readonly') {
+                                       echo ' readonly="readonly"';
+                               }
+                               echo '>',htmlspecialchars($current['value']),'</textarea>';
+                               break;
+                       case 'text':
+                       default:
+                               //$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
+
+                               echo '<input type="text" size="40" maxlength="128" name="',htmlspecialchars($varname),'" value="',htmlspecialchars($current['value']),'"';
+                               if ($meta['datatype'] == 'numerical') {
+                                       echo ' onkeyup="checkNumeric(this)" onblur="checkNumeric(this)"';
+                               }
+                               if ($meta['access'] == 'readonly') {
+                                       echo ' readonly="readonly"';
+                               }
+                               echo ' />';
+               }
+               echo $current['extra'];
+               echo '</td>';
+       }
+}
+
+function listplug_table_itemlist($template, $type) {
+       $cssclass = null;
+
+       switch($type) {
+               case 'HEAD':
+                       echo "<th>"._LIST_ITEM_INFO."</th><th>"._LIST_ITEM_CONTENT."</th><th style=\"white-space:nowrap\" colspan='1'>"._LISTS_ACTIONS."</th>";
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+                       $current->itime = strtotime($current->itime);   // string -> unix timestamp
+
+                       if ($current->idraft == 1)
+                               $cssclass = "class='draft'";
+
+                       // (can't use offset time since offsets might vary between blogs)
+                       if ($current->itime > $template['now'])
+                               $cssclass = "class='future'";
+
+                       echo "<td $cssclass>",_LIST_ITEM_BLOG,' ', htmlspecialchars($current->bshortname);
+                       echo "    <br />",_LIST_ITEM_CAT,' ', htmlspecialchars($current->cname);
+                       echo "    <br />",_LIST_ITEM_AUTHOR, ' ', htmlspecialchars($current->mname);
+                       echo "    <br />",_LIST_ITEM_DATE," " . date("Y-m-d",$current->itime);
+                       echo "<br />",_LIST_ITEM_TIME," " . date("H:i",$current->itime);
+                       echo "</td>";
+                       echo "<td $cssclass>";
+
+                       $id = listplug_nextBatchId();
+
+                       echo '<input type="checkbox" id="batch',$id,'" name="batch[',$id,']" value="',$current->inumber,'" />';
+                       echo '<label for="batch',$id,'">';
+                       echo "<b>" . htmlspecialchars(strip_tags($current->ititle)) . "</b>";
+                       echo '</label>';
+                       echo "<br />";
+
+
+                       $current->ibody = strip_tags($current->ibody);
+                       $current->ibody = htmlspecialchars(shorten($current->ibody,300,'...'));
+
+                       echo "$current->ibody</td>";
+                       echo "<td  style=\"white-space:nowrap\" $cssclass>";
+                       echo    "<a href='index.php?action=itemedit&amp;itemid=$current->inumber'>"._LISTS_EDIT."</a>";
+                       echo    "<br /><a href='index.php?action=itemcommentlist&amp;itemid=$current->inumber'>"._LISTS_COMMENTS."</a>";
+                       echo    "<br /><a href='index.php?action=itemmove&amp;itemid=$current->inumber'>"._LISTS_MOVE."</a>";
+                       echo    "<br /><a href='index.php?action=itemdelete&amp;itemid=$current->inumber'>"._LISTS_DELETE."</a>";
+                       echo "</td>";
+                       break;
+       }
+}
+
+// for batch operations: generates the index numbers for checkboxes
+function listplug_nextBatchId() {
+       static $id = 0;
+       return $id++;
+}
+
+function listplug_table_commentlist($template, $type) {
+       switch($type) {
+               case 'HEAD':
+                       echo "<th>"._LISTS_INFO."</th><th>"._LIST_COMMENT."</th><th colspan='3'>"._LISTS_ACTIONS."</th>";
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+                       $current->ctime = strtotime($current->ctime);   // string -> unix timestamp
+
+                       echo '<td>';
+                       echo date("Y-m-d@H:i",$current->ctime);
+                       echo '<br />';
+                       if ($current->mname)
+                               echo htmlspecialchars($current->mname) ,' ', _LIST_COMMENTS_MEMBER;
+                       else
+                               echo htmlspecialchars($current->cuser);
+                       if ($current->cmail != '') {
+                                echo '<br />';
+                                echo htmlspecialchars($current->cmail);
+                        }
+                       if ($current->cemail != '') {
+                                echo '<br />';
+                                echo htmlspecialchars($current->cemail);
+                        }
+                       echo '</td>';
+
+                       $current->cbody = strip_tags($current->cbody);
+                       $current->cbody = htmlspecialchars(shorten($current->cbody, 300, '...'));
+
+                       echo '<td>';
+                       $id = listplug_nextBatchId();
+                       echo '<input type="checkbox" id="batch',$id,'" name="batch[',$id,']" value="',$current->cnumber,'" />';
+                       echo '<label for="batch',$id,'">';
+                       echo $current->cbody;
+                       echo '</label>';
+                       echo '</td>';
+
+                       echo "<td style=\"white-space:nowrap\"><a href='index.php?action=commentedit&amp;commentid=$current->cnumber'>"._LISTS_EDIT."</a></td>";
+                       echo "<td style=\"white-space:nowrap\"><a href='index.php?action=commentdelete&amp;commentid=$current->cnumber'>"._LISTS_DELETE."</a></td>";
+                       if ($template['canAddBan'])
+                               echo "<td style=\"white-space:nowrap\"><a href='index.php?action=banlistnewfromitem&amp;itemid=$current->citem&amp;ip=", htmlspecialchars($current->cip), "' title='", htmlspecialchars($current->chost), "'>"._LIST_COMMENT_BANIP."</a></td>";
+                       break;
+       }
+}
+
+
+function listplug_table_bloglist($template, $type) {
+       switch($type) {
+               case 'HEAD':
+                       echo "<th>" . _NAME . "</th><th colspan='7'>" ._LISTS_ACTIONS. "</th>";
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+
+                       echo "<td title='blogid:$current->bnumber shortname:$current->bshortname'><a href='$current->burl'><img src='images/globe.gif' width='13' height='13' alt='". _BLOGLIST_TT_VISIT."' /></a> " . htmlspecialchars($current->bname) . "</td>";
+                       echo "<td><a href='index.php?action=createitem&amp;blogid=$current->bnumber' title='" . _BLOGLIST_TT_ADD ."'>" . _BLOGLIST_ADD . "</a></td>";
+                       echo "<td><a href='index.php?action=itemlist&amp;blogid=$current->bnumber' title='". _BLOGLIST_TT_EDIT."'>". _BLOGLIST_EDIT."</a></td>";
+                       echo "<td><a href='index.php?action=blogcommentlist&amp;blogid=$current->bnumber' title='". _BLOGLIST_TT_COMMENTS."'>". _BLOGLIST_COMMENTS."</a></td>";
+                       echo "<td><a href='index.php?action=bookmarklet&amp;blogid=$current->bnumber' title='". _BLOGLIST_TT_BMLET."'>". _BLOGLIST_BMLET . "</a></td>";
+
+                       if ($current->tadmin == 1) {
+                               echo "<td><a href='index.php?action=blogsettings&amp;blogid=$current->bnumber' title='" . _BLOGLIST_TT_SETTINGS . "'>" ._BLOGLIST_SETTINGS. "</a></td>";
+                               echo "<td><a href='index.php?action=banlist&amp;blogid=$current->bnumber' title='" . _BLOGLIST_TT_BANS. "'>". _BLOGLIST_BANS."</a></td>";
+                       }
+
+                       if ($template['superadmin']) {
+                               echo "<td><a href='index.php?action=deleteblog&amp;blogid=$current->bnumber' title='". _BLOGLIST_TT_DELETE."'>" ._BLOGLIST_DELETE. "</a></td>";
+                       }
+
+
+
+                       break;
+       }
+}
+
+function listplug_table_shortblognames($template, $type) {
+       switch($type) {
+               case 'HEAD':
+                       echo "<th>" . _NAME . "</th><th>" . _NAME. "</th>";
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+
+                       echo '<td>' , htmlspecialchars($current->bshortname) , '</td>';
+                       echo '<td>' , htmlspecialchars($current->bname) , '</td>';
+
+                       break;
+       }
+}
+
+function listplug_table_shortnames($template, $type) {
+       switch($type) {
+               case 'HEAD':
+                       echo "<th>" . _NAME . "</th><th>" . _LISTS_DESC. "</th>";
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+
+                       echo '<td>' , htmlspecialchars($current->name) , '</td>';
+                       echo '<td>' , htmlspecialchars($current->description) , '</td>';
+
+                       break;
+       }
+}
+
+
+function listplug_table_categorylist($template, $type) {
+       switch($type) {
+               case 'HEAD':
+                       echo "<th>"._LISTS_NAME."</th><th>"._LISTS_DESC."</th><th colspan='2'>"._LISTS_ACTIONS."</th>";
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+
+                       echo '<td>';
+                       $id = listplug_nextBatchId();
+                       echo '<input type="checkbox" id="batch',$id,'" name="batch[',$id,']" value="',$current->catid,'" />';
+                       echo '<label for="batch',$id,'">';
+                       echo htmlspecialchars($current->cname);
+                       echo '</label>';
+                       echo '</td>';
+
+                       echo '<td>', htmlspecialchars($current->cdesc), '</td>';
+                       echo "<td><a href='index.php?action=categorydelete&amp;blogid=$current->cblog&amp;catid=$current->catid' tabindex='".$template['tabindex']."'>"._LISTS_DELETE."</a></td>";
+                       echo "<td><a href='index.php?action=categoryedit&amp;blogid=$current->cblog&amp;catid=$current->catid' tabindex='".$template['tabindex']."'>"._LISTS_EDIT."</a></td>";
+
+                       break;
+       }
+}
+
+
+function listplug_table_templatelist($template, $type) {
+       global $manager;
+       switch($type) {
+               case 'HEAD':
+                       echo "<th>"._LISTS_NAME."</th><th>"._LISTS_DESC."</th><th colspan='3'>"._LISTS_ACTIONS."</th>";
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+
+                       echo "<td>" , htmlspecialchars($current->tdname), "</td>";
+                       echo "<td>" , htmlspecialchars($current->tddesc), "</td>";
+                       echo "<td style=\"white-space:nowrap\"><a href='index.php?action=templateedit&amp;templateid=$current->tdnumber' tabindex='".$template['tabindex']."'>"._LISTS_EDIT."</a></td>";
+
+                       $url = $manager->addTicketToUrl('index.php?action=templateclone&templateid=' . intval($current->tdnumber));
+                       echo "<td style=\"white-space:nowrap\"><a href='",htmlspecialchars($url),"' tabindex='".$template['tabindex']."'>"._LISTS_CLONE."</a></td>";
+                       echo "<td style=\"white-space:nowrap\"><a href='index.php?action=templatedelete&amp;templateid=$current->tdnumber' tabindex='".$template['tabindex']."'>"._LISTS_DELETE."</a></td>";
+
+                       break;
+       }
+}
+
+function listplug_table_skinlist($template, $type) {
+       global $CONF, $DIR_SKINS, $manager;
+       switch($type) {
+               case 'HEAD':
+                       echo "<th>"._LISTS_NAME."</th><th>"._LISTS_DESC."</th><th colspan='3'>"._LISTS_ACTIONS."</th>";
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+
+                       echo '<td>';
+
+                       // use a special style for the default skin
+                       if ($current->sdnumber == $CONF['BaseSkin']) {
+                               echo '<strong>',htmlspecialchars($current->sdname),'</strong>';
+                       } else {
+                               echo htmlspecialchars($current->sdname);
+                       }
+
+                       echo '<br /><br />';
+                       echo _LISTS_TYPE ,': ' , htmlspecialchars($current->sdtype);
+                       echo '<br />', _LIST_SKINS_INCMODE , ' ' , (($current->sdincmode=='skindir') ?_PARSER_INCMODE_SKINDIR:_PARSER_INCMODE_NORMAL);
+                       if ($current->sdincpref) echo '<br />' , _LIST_SKINS_INCPREFIX , ' ', htmlspecialchars($current->sdincpref);
+
+                       // add preview image when present
+                       if ($current->sdincpref && @file_exists($DIR_SKINS . $current->sdincpref . 'preview.png'))
+                       {
+                               echo '<br /><br />';
+
+                               $hasEnlargement = @file_exists($DIR_SKINS . $current->sdincpref . 'preview-large.png');
+                               if ($hasEnlargement)
+                                       echo '<a href="',$CONF['SkinsURL'], htmlspecialchars($current->sdincpref),'preview-large.png" title="View larger">';
+
+                               echo '<img class="skinpreview" src="',$CONF['SkinsURL'], htmlspecialchars($current->sdincpref),'preview.png" width="100" height="75" alt="Preview for \'',htmlspecialchars($current->sdname),'\' skin" />';
+
+                               if ($hasEnlargement)
+                                       echo '</a>';
+
+                               if (@file_exists($DIR_SKINS . $current->sdincpref . 'readme.html'))
+                               {
+                                       echo '<br /><a href="',$CONF['SkinsURL'], htmlspecialchars($current->sdincpref),'readme.html" title="More info on the \'',htmlspecialchars($current->sdname),'\' skin">Readme</a>';
+                               }
+
+
+                       }
+
+                       echo "</td>";
+
+
+                       echo "<td>" , htmlspecialchars($current->sddesc);
+                               // show list of defined parts
+                               $r = sql_query('SELECT stype FROM '.sql_table('skin').' WHERE sdesc='.$current->sdnumber . ' ORDER BY stype');
+                               $types = array();
+                               while ($o = mysql_fetch_object($r))
+                                       array_push($types,$o->stype);
+                               if (sizeof($types) > 0) {
+                                       $friendlyNames = SKIN::getFriendlyNames();
+                                       for ($i=0;$i<sizeof($types);$i++) {
+                                               $type = $types[$i];
+                                               if (in_array($type, array('index', 'item', 'archivelist', 'archive', 'search', 'error', 'member', 'imagepopup'))) {
+                                                       $types[$i] = '<li>' . helpHtml('skinpart'.$type) . ' <a href="index.php?action=skinedittype&amp;skinid='.$current->sdnumber.'&amp;type='.$type.'" tabindex="'.$template['tabindex'].'">' . htmlspecialchars($friendlyNames[$type]) . "</a></li>";
+                                               } else {
+                                                       $types[$i] = '<li>' . helpHtml('skinpartspecial') . ' <a href="index.php?action=skinedittype&amp;skinid='.$current->sdnumber.'&amp;type='.$type.'" tabindex="'.$template['tabindex'].'">' . htmlspecialchars($friendlyNames[$type]) . "</a></li>";
+                                               }
+                                       }
+                                       echo '<br /><br />',_LIST_SKINS_DEFINED,' <ul>',implode($types,'') ,'</ul>';
+                               }
+                       echo "</td>";
+                       echo "<td style=\"white-space:nowrap\"><a href='index.php?action=skinedit&amp;skinid=$current->sdnumber' tabindex='".$template['tabindex']."'>"._LISTS_EDIT."</a></td>";
+
+                       $url = $manager->addTicketToUrl('index.php?action=skinclone&skinid=' . intval($current->sdnumber));
+                       echo "<td style=\"white-space:nowrap\"><a href='",htmlspecialchars($url),"' tabindex='".$template['tabindex']."'>"._LISTS_CLONE."</a></td>";
+                       echo "<td style=\"white-space:nowrap\"><a href='index.php?action=skindelete&amp;skinid=$current->sdnumber' tabindex='".$template['tabindex']."'>"._LISTS_DELETE."</a></td>";
+
+                       break;
+       }
+}
+
+function listplug_table_draftlist($template, $type) {
+       switch($type) {
+               case 'HEAD':
+                       echo "<th>"._LISTS_BLOG."</th><th>"._LISTS_TITLE."</th><th colspan='2'>"._LISTS_ACTIONS."</th>";
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+
+                       echo '<td>', htmlspecialchars($current->bshortname) , '</td>';
+                       echo '<td>', htmlspecialchars(strip_tags($current->ititle)) , '</td>';
+                       echo "<td><a href='index.php?action=itemedit&amp;itemid=$current->inumber'>"._LISTS_EDIT."</a></td>";
+                       echo "<td><a href='index.php?action=itemdelete&amp;itemid=$current->inumber'>"._LISTS_DELETE."</a></td>";
+
+                       break;
+       }
+}
+
+
+function listplug_table_actionlist($template, $type) {
+       switch($type) {
+               case 'HEAD':
+                       echo '<th>'._LISTS_TIME.'</th><th>'._LIST_ACTION_MSG.'</th>';
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+
+                       echo '<td>' , htmlspecialchars($current->timestamp), '</td>';
+                       echo '<td>' , htmlspecialchars($current->message), '</td>';
+
+                       break;
+       }
+}
+
+function listplug_table_banlist($template, $type) {
+       switch($type) {
+               case 'HEAD':
+                       echo '<th>'._LIST_BAN_IPRANGE.'</th><th>'. _LIST_BAN_REASON.'</th><th>'._LISTS_ACTIONS.'</th>';
+                       break;
+               case 'BODY':
+                       $current = $template['current'];
+
+                       echo '<td>' , htmlspecialchars($current->iprange) , '</td>';
+                       echo '<td>' , htmlspecialchars($current->reason) , '</td>';
+                       echo "<td><a href='index.php?action=banlistdelete&amp;blogid=", intval($current->blogid) , "&amp;iprange=" , htmlspecialchars($current->iprange) , "'>",_LISTS_DELETE,"</a></td>";
+                       break;
+       }
+}
+
+?>
\ No newline at end of file