OSDN Git Service

*** empty log message ***
authorshizuki <shizuki@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Sat, 7 Oct 2006 11:55:42 +0000 (11:55 +0000)
committershizuki <shizuki@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Sat, 7 Oct 2006 11:55:42 +0000 (11:55 +0000)
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@431 1ca29b6e-896d-4ea0-84a5-967f57386b96

trunk/NP_CustomURL/NP_CustomURL.php [new file with mode: 0644]
trunk/NP_CustomURL/customurl/default_help.html [new file with mode: 0644]
trunk/NP_CustomURL/customurl/help.html [new file with mode: 0644]
trunk/NP_CustomURL/customurl/help.php [new file with mode: 0644]
trunk/NP_CustomURL/customurl/index.php [new file with mode: 0644]
trunk/NP_CustomURL/customurl/japanese-euc_help.html [new file with mode: 0644]
trunk/NP_CustomURL/customurl/japanese-utf8_help.html [new file with mode: 0644]
trunk/NP_CustomURL/customurl/language/english.php [new file with mode: 0644]
trunk/NP_CustomURL/customurl/language/japanese-euc.php [new file with mode: 0644]
trunk/NP_CustomURL/customurl/language/japanese-utf8.php [new file with mode: 0644]

diff --git a/trunk/NP_CustomURL/NP_CustomURL.php b/trunk/NP_CustomURL/NP_CustomURL.php
new file mode 100644 (file)
index 0000000..cdc58a4
--- /dev/null
@@ -0,0 +1,1808 @@
+<?php
+
+if (!function_exists('sql_table')) {
+       function sql_table($name)
+       {
+               return 'nucleus_' . $name;
+       }
+}
+
+if (!function_exists('htmlspecialchars_decode')) {
+       function htmlspecialchars_decode($text)
+       {
+               return strtr($text, array_flip(get_html_translation_table(HTML_SPECIALCHARS)));
+       }
+}
+
+if (!defined('_CUSTOMURL_TABLE_DEFINED')) {
+       define('_CUSTOMURL_TABLE_DEFINED',      1);
+       define('_CUSTOMURL_TABLE',      sql_table('plug_customurl'));
+       define('_C_SUBCAT_TABLE',       sql_table('plug_multiple_categories_sub'));
+}
+
+class NP_CustomURL extends NucleusPlugin
+ {
+
+       function getMinNucleusVersion()
+       {
+               return '322';
+       }
+
+       function getName()
+       {
+               return 'Customized URL';
+       }
+
+       function getAuthor()
+       {
+               return 'shizuki';
+       }
+
+       function getURL()
+       {
+               return 'http://shizuki.kinezumi.net/NucleusCMS/Plugins/NP_CustomURL/NP_CustomURL.html';
+       }
+
+       function getVersion()
+       {
+               return '0.3.0';
+       }
+
+       function getDescription()
+       {
+               return _DESCRIPTION;
+       }
+
+       function supportsFeature($what)
+       {
+               switch($what) {
+                       case 'SqlTablePrefix':
+                               return 1;
+                       case 'HelpPage':
+                               return 1;
+                       default:
+                               return 0;
+               }
+       }
+
+       function hasAdminArea()
+       {
+               return 1;
+       }
+
+       function event_QuickMenu(&$data)
+       {
+               global $member;
+               if(($this->getOption( 'customurl_quicklink') == 'no') || !($member->isLoggedIn() && $member->isAdmin()) ) return;
+               array_push(
+                       $data['options'],
+                       array(
+                               'title'         => _ADMIN_TITLE,
+                               'url'           => $this->getAdminURL(),
+                               'tooltip'       => _QUICK_TIPS
+                       )
+               );
+       }
+
+       function getTableList()
+       {
+               return  array(
+                       _CUSTOMURL_TABLE
+               );
+       }
+
+       function getEventList()
+       {
+               return  array(
+                       'QuickMenu',
+                       'ParseURL',
+                       'GenerateURL',
+                       'PostAddBlog',
+                       'PostAddItem',
+                       'PostUpdateItem',
+                       'PostRegister',
+                       'PostAddCategory',
+                       'PostDeleteBlog',
+                       'PostDeleteItem',
+                       'PostDeleteMember',
+                       'PostDeleteCategory',
+                       'PrePluginOptionsUpdate',
+                       'PreItem',
+                       'PostItem',
+                       'PreSkinParse',
+                       'AddItemFormExtras',
+                       'EditItemFormExtras',
+                       'PostMoveCategory',
+                       'PostMoveItem',
+                       'PreSendContentType',
+                       'InitSkinParse',
+               );
+       }
+
+       function install()
+       {
+               global $manager, $CONF;
+// Keys initialize
+               if (empty($CONF['ArchiveKey'])) {
+                       $CONF['ArchiveKey'] = 'archive';
+               }
+               if (empty($CONF['ArchivesKey'])) {
+                       $CONF['ArchivesKey'] = 'archives';
+               }
+               if (empty($CONF['MemberKey'])) {
+                       $CONF['MemberKey'] = 'member';
+               }
+               if (empty($CONF['ItemKey'])) {
+                       $CONF['ItemKey'] = 'item';
+               }
+               if (empty($CONF['CategoryKey'])) {
+                       $CONF['CategoryKey'] = 'category';
+               }
+
+//Plugins sort
+               $myid = intval($this->getID());
+               $res = sql_query('SELECT pid, porder FROM '.sql_table('plugin'));
+               while($p = mysql_fetch_array($res)) {
+                       if (intval($p['pid']) == $myid) {
+                               sql_query(sprintf('UPDATE %s SET porder = %d WHERE pid = %d', sql_table('plugin'), 1, $myid));
+                       } else {
+                               sql_query(sprintf('UPDATE %s SET porder = %d WHERE pid = %d', sql_table('plugin'), $p['porder']+1, $p['pid']));
+                       }
+               }
+
+//create plugin's options and set default value
+               $this->createOption(            'customurl_archive',    _OP_ARCHIVE_DIR_NAME,   'text',         $CONF['ArchiveKey']);
+               $this->createOption(            'customurl_archives',   _OP_ARCHIVES_DIR_NAME,  'text',         $CONF['ArchivesKey']);
+               $this->createOption(            'customurl_member',             _OP_MEMBER_DIR_NAME,    'text',         $CONF['MemberKey']);
+               $this->createOption(            'customurl_dfitem',             _OP_DEF_ITEM_KEY,               'text',         $CONF['ItemKey']);
+               $this->createOption(            'customurl_dfcat',              _OP_DEF_CAT_KEY,                'text',         $CONF['CategoryKey']);
+               $this->createOption(            'customurl_dfscat',             _OP_DEF_SCAT_KEY,               'text',         'subcategory');
+               $this->createOption(            'customurl_tabledel',   _OP_TABLE_DELETE,               'yesno',        'no');
+               $this->createOption(            'customurl_quicklink',  _OP_QUICK_LINK,                 'yesno',        'yes');
+               $this->createOption(            'customurl_notfound',   _OP_NOT_FOUND,                  'select',       '404',  '404 Not Found|404|303 See Other|303');
+               $this->createBlogOption(        'use_customurl',                _OP_USE_CURL,                   'yesno',        'yes');
+               $this->createBlogOption(        'redirect_normal',              _OP_RED_NORM,                   'yesno',        'yes');
+               $this->createBlogOption(        'redirect_search',              _OP_RED_SEARCH,                 'yesno',        'yes');
+               $this->createBlogOption(        'customurl_bname',              _OP_BLOG_PATH,                  'text');
+//             $this->createItemOption(        'customurl_iname',              _OP_ITEM_PATH,                  'text',         $CONF['ItemKey']);
+               $this->createMemberOption(      'customurl_mname',              _OP_MEMBER_PATH,                'text');
+               $this->createCategoryOption('customurl_cname',          _OP_CATEGORY_PATH,              'text');
+
+               $this->setOption('customurl_archive',   $CONF['ArchiveKey']);                   //default archive directory name
+               $this->setOption('customurl_archives',  $CONF['ArchivesKey']);                  //default archives directory name
+               $this->setOption('customurl_member',    $CONF['MemberKey']);                    //default member directory name
+               $this->setOption('customurl_dfitem',    $CONF['ItemKey']);                              //default itemkey_template
+               $this->setOption('customurl_dfcat',             $CONF['CategoryKey']);                  //default categorykey_template
+               $this->setOption('customurl_dfscat',    'subcategory');                                 //default subcategorykey_template
+
+//create data table
+               $sql = 'CREATE TABLE IF NOT EXISTS '._CUSTOMURL_TABLE.' ('
+                               . ' `id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, '
+                               . ' `obj_param` VARCHAR(15) NOT NULL, '
+                               . ' `obj_name` VARCHAR(128) NOT NULL, '
+                               . ' `obj_id` INT(11) NOT NULL, '
+                               . ' `obj_bid` INT(11) NOT NULL,'
+                               . ' INDEX (`obj_name`)'
+                               . ' )';
+               sql_query($sql);
+
+//setting default aliases
+               $this->_createNewPath('blog',           'blog',         'bnumber',      'bshortname');
+               $this->_createNewPath('item',           'item',         'inumber',      'iblog');
+               $this->_createNewPath('category',       'category',     'catid',        'cblog');
+               $this->_createNewPath('member',         'member',       'mnumber',      'mname');
+
+               if ($this->pluginCheck('MultipleCategories')) {
+                       $this->_createNewPath('subcategory', 'plug_multiple_categories_sub', 'scatid', 'catid');
+               }
+
+       }
+
+       function _createNewPath($type, $n_table, $id, $bids)
+       {
+               $tmpTable = sql_table('plug_customurl_temp');
+               sql_query(sprintf('CREATE TABLE %s SELECT obj_id, obj_param FROM %s WHERE obj_param = "%s"', $tmpTable, _CUSTOMURL_TABLE, $type));
+               $TmpQuery = 'SELECT %s, %s FROM %s LEFT JOIN %s ON %s.%s = %s.obj_id WHERE %s.obj_id is null';
+               $temp = sql_query(sprintf($TmpQuery, $id, $bids, sql_table($n_table), $tmpTable, sql_table($n_table), $id, $tmpTable, $tmpTable));
+               if ($temp) {
+                       while ($row=mysql_fetch_array($temp)) {
+                               switch ($type) {
+                                       case 'blog':
+                                               $newPath = $row[$bids];         //set access by BlogshortName/
+                                               $blgid = 0;
+                                       break;
+                                       case 'item':
+                                               $tque = 'SELECT itime as result FROM %s WHERE inumber = %d';
+                                               $itime = quickQuery( sprintf($tque ,sql_table('item'), intval($row[$id]) ) );
+                                               $y = $m = $d = '';
+                                               sscanf($itime,'"%d-%d-%d %s"',$y,$m,$d,$temp);
+                                               $ikey = TEMPLATE::fill($this->getOption('customurl_dfitem'), array ('year' => $y, 'month' => $m, 'day' => $d));
+                                               $newPath = $ikey . '_' . $row[$id] . '.html';           //set access by (itemkey_template)_itemid.html
+                                               $blgid = $row[$bids];
+                                       break;
+                                       case 'category':
+                                               $newPath = $this->getOption('customurl_dfcat') . '_' . $row[$id];               //set access by (categorykey_template)_categoryid/
+                                               $blgid = $row[$bids];
+                                       break;
+                                       case 'member':
+                                               $newPath = $row[$bids] . '.html';               //set access by loginName.html
+                                               $blgid = 0;
+                                       break;
+                                       case 'subcategory':
+                                               $newPath = $this->getOption('customurl_dfscat') . '_' . $row[$id];              //set access by (subcategorykey_template)_subcategoryid/
+                                               $blgid = $row[$bids];
+                                       break;
+                                       default:
+                                       break;
+                               }
+                               sql_query(sprintf('INSERT INTO %s (obj_param, obj_id, obj_name, obj_bid) VALUES ("%s", %d, "%s", %d)', _CUSTOMURL_TABLE, $type, intval($row[$id]), $newPath, intval($blgid)));
+                       }
+               }
+               $temp = sql_query(sprintf('SELECT obj_id, obj_name FROM %s WHERE obj_param = "%s"', _CUSTOMURL_TABLE, $type));
+               while ($row=mysql_fetch_array($temp)) {
+                       switch ($type) {
+                               case 'blog':
+                                       $this->setBlogOption($row[obj_id], 'customurl_bname',$row[obj_name]);
+                               break;
+                               case 'category':
+                                       $this->setCategoryOption($row[obj_id], 'customurl_cname', $row[obj_name]);
+                               break;
+                               case 'member':
+                                       $obj_name = substr($row[obj_name], 0, -5);
+                                       $this->setMemberOption($row[obj_id], 'customurl_mname', $obj_name);
+                               break;
+                               default:
+                               break;
+                       }
+               }
+
+               sql_query('DROP TABLE IF EXISTS '.$tmpTable);
+       }
+
+       function init()
+       {
+               global $admin;
+               $language = ereg_replace( '[\\|/]', '', getLanguageName());
+               if (file_exists($this->getDirectory().'language/'.$language.'.php')) {
+                       include_once($this->getDirectory().'language/'.$language.'.php');
+               }else {
+                       include_once($this->getDirectory().'language/english.php');
+               }
+       }
+
+       function pluginCheck($pluginName)
+       {
+               global $manager;
+               if (!$manager->pluginInstalled('NP_'.$pluginName)) return;
+               $plugin =& $manager->getPlugin('NP_'.$pluginName);
+               return $plugin;
+       }
+
+       function unInstall()
+       {
+               if($this->getOption('customurl_tabledel') == 'yes') {
+                       sql_query("DROP TABLE "._CUSTOMURL_TABLE);
+               }
+               $this->deleteOption('customurl_archive');
+               $this->deleteOption('customurl_archives');
+               $this->deleteOption('customurl_member');
+               $this->deleteOption('customurl_dfitem');
+               $this->deleteOption('customurl_dfcat');
+               $this->deleteOption('customurl_dfscat');
+               $this->deleteOption('customurl_notfound');
+               $this->deleteOption('customurl_tabledel');
+               $this->deleteOption('customurl_quicklink');
+               $this->deleteBlogOption('use_customurl');
+               $this->deleteBlogOption('redirect_normal');
+               $this->deleteBlogOption('redirect_search');
+               $this->deleteBlogOption('customurl_bname');
+//             $this->deleteItemOption('customurl_iname');
+               $this->deleteMemberOption('customurl_mname');
+               $this->deleteCategoryOption('customurl_cname');
+       }
+
+       function event_ParseURL($data)
+       {
+               global $CONF, $manager, $curl_blogid, $blogid, $itemid, $catid, $memberid, $archivelist, $archive, $query;
+// initialize
+               $info = $data['info'];
+               $complete =& $data['complete'];
+               if ($complete) return;
+
+// Use NP_MultipleCategories ?
+               $mcategories = $this->pluginCheck('MultipleCategories');
+               if ($mcategories) {
+                       if (method_exists($mcategories, "getRequestName")) {
+                               $mcategories->event_PreSkinParse(array());
+                               global $subcatid;
+                               $subrequest = $mcategories->getRequestName();
+                       }
+               }
+               if (!$subrequest) $subrequest = 'subcatid';
+
+// initialize and sanitize '$blogid'
+               if (!$blogid) {
+                       if ( getVar('blogid') ) {
+                               if ( is_numeric(getVar('blogid')) ) {
+                                       $blogid = intval( getVar('blogid') );
+                               } else {
+                                       $blogid = intval( getBlogIDFromName(getVar('blogid')) );
+                               }
+                       } elseif ($curl_blogid) {
+                               $blogid = intval($curl_blogid);
+                       } else {
+                               $blogid = $CONF['DefaultBlog'];
+                       }
+               } else {
+                       if (is_numeric($blogid)) {
+                               $blogid = intval($blogid);
+                       } else {
+                               $blogid = intval(getBlogIDFromName($blogid));
+                       }
+               }
+
+               if (!$info) {
+                       if (serverVar('PATH_INFO')) {
+                               $info = serverVar('PATH_INFO');
+                       } elseif (getNucleusVersion() < 330) {
+                               if (getVar('virtualpath')) $info = getVar('virtualpath');
+                       } else {
+                               return;
+                       }
+               }
+
+// Sanitize 'PATH_INFO'
+               $info = trim($info, '/');
+               $v_path = explode("/", $info);
+               foreach($v_path as $key => $value) {
+                       $value = urlencode($value);
+                       $value = preg_replace('|[^a-zA-Z0-9-~+_.?#=&;,/:@%]|i', '', $value);
+                       $v_path[$key] = $value;
+//                     $blog = $manager->getBlog($blogid);
+//                     $exLink = TRUE;
+               }
+               if (phpversion() >= '4.1.0') {
+                       $_SERVER['PATH_INFO'] = implode('/', $v_path);
+               }
+               global $HTTP_SERVER_VARS;
+               $HTTP_SERVER_VARS['PATH_INFO'] = implode('/', $v_path);
+
+// Admin area check
+               $uri = str_replace('/', '\/', sprintf("%s%s%s","http://",serverVar("HTTP_HOST"),serverVar("SCRIPT_NAME")));
+               $plug_url = str_replace('/', '\/', $CONF['PluginURL']);
+               if (strpos($uri, $plug_url) === 0) $UsingPlugAdmin = TRUE;
+
+// redirect to other URL style
+               if ($this->getBlogOption(intval($blogid), 'use_customurl') == 'yes' && !$UsingPlugAdmin && !$CONF['UsingAdminArea']) {
+// Search query redirection
+// 301 permanent ? or 302 temporary ?
+                       $search_q = (getVar('query') || strpos(serverVar('REQUEST_URI'), 'query=') !== FALSE);
+                       if ($this->getBlogOption(intval($blogid), 'redirect_search') == 'yes') {
+                               if ($search_q) {
+                                       $que_str = getVar('query');
+                                       $que_str = htmlspecialchars($que_str);
+                                       $que_str = mb_eregi_replace('/', 'ssslllaaassshhh', $que_str);
+                                       $que_str = mb_eregi_replace("'", 'qqquuuooottt', $que_str);
+                                       $que_str = mb_eregi_replace('&', 'aaammmppp', $que_str);
+                                       $que_str = urlencode($que_str);
+                                       $search_path = '/search/' . $que_str;
+                                       $b_url = createBlogidLink($blogid);
+                                       $redurl = sprintf("%s%s", $b_url, $search_path);
+                                       redirect($redurl); // 302 Moved temporary
+                                       exit;
+                               }
+                       }
+                       if ($this->getBlogOption(intval($blogid), 'redirect_search') == 'no' && $search_q) {
+                               $exLink = TRUE;
+                       }
+
+// redirection nomal URL to FancyURL
+                       $temp_req = explode('?', serverVar('REQUEST_URI'));
+                       $request_path = reset($temp_req);
+                       $feeds = ($request_path == 'xml-rss1.php' || $request_path == 'xml-rss2.php' || $request_path == 'atom.php');
+                       if ($this->getBlogOption(intval($blogid), 'redirect_normal') == 'yes' && serverVar('QUERY_STRING') && !$feeds && !$exLink) {
+                               $temp = explode('&', serverVar('QUERY_STRING'));
+                               foreach ($temp as $k => $val) {
+                                       if (preg_match('/^virtualpath/', $val)) {
+                                               unset($temp[$k]);
+                                       }
+                               }
+                               if (!empty($temp)) {
+                                       $p_arr = array();
+                                       foreach ($temp as $key => $value) {
+                                               $p_key = explode('=', $value);
+                                               switch (reset($p_key)) {
+                                                       case 'blogid';
+                                                               $p_arr[] = $CONF['BlogKey'] . '/' . intval(getVar('blogid'));
+                                                               unset($temp[$key]);
+                                                               break;
+                                                       case 'catid';
+                                                               $p_arr[] = $CONF['CategoryKey'] . '/' . intval(getVar('catid'));
+                                                               unset($temp[$key]);
+                                                               break;
+                                                       case $subrequest;
+                                                               $p_arr[] = $subrequest . '/' . intval(getVar($subrequest));
+                                                               unset($temp[$key]);
+                                                               break;
+                                                       case 'itemid';
+                                                               $p_arr[] = $CONF['ItemKey'] . '/' . intval(getVar('itemid'));
+                                                               unset($temp[$key]);
+                                                               break;
+                                                       case 'memberid';
+                                                               $p_arr[] = $CONF['MemberKey'] . '/' . intval(getVar('memberid'));
+                                                               unset($temp[$key]);
+                                                               break;
+                                                       case 'archivelist';
+                                                               $p_arr[] = $CONF['ArchivesKey'] . '/' . intval(getVar('archivelist'));
+                                                               unset($temp[$key]);
+                                                               break;
+                                                       case 'archive';
+                                                               $p_arr[] = $CONF['ArchiveKey'] . '/' . intval(getVar('archive'));
+                                                               unset($temp[$key]);
+                                                               break;
+                                                       default:
+                                                               break;
+                                               }
+                                       }
+                                       if (reset($p_arr)) {
+                                               $b_url = createBlogidLink($blogid);
+                                               $red_path = '/' . implode('/', $p_arr);
+                                               if (substr($b_url, -1) == '/') $b_url = rtrim($b_url, '/');
+                                               $redurl = sprintf("%s%s", $b_url, $red_path);
+                       // HTTP status 301 "Moved Permanentry"
+                                               header( "HTTP/1.1 301 Moved Permanently" );
+                                               header('Location: ' . $redurl);
+                                               exit;
+                                       }
+                               }
+                       } elseif ($this->getBlogOption(intval($blogid), 'redirect_normal') == 'yes' && $feeds) {
+                               $b_url = rtrim(createBlogidLink($blogid), '/');
+                               switch ($request_path) {
+                                       case 'xml-rss1.php':
+                                               $feed_code = '/index.rdf';
+                                               break;
+                                       case 'xml-rss2.php':
+                                               $feed_code = '/rss2.xml';
+                                               break;
+                                       case 'atom.php':
+                                               $feed_code = '/atom.xml';
+                                               break;
+                                       default:
+                                               break;
+                               }
+                       // HTTP status 301 "Moved Permanentry"
+                               header('HTTP/1.1 301 Moved Permanently');
+                               header('Location: ' . $b_url . $feed_code);
+                               exit;
+                       }
+               }
+// decode path_info
+
+// decode unofficial Page switch '/page_2.html'
+               foreach($v_path as $pathName) {
+                       if (preg_match('/^page_/', $pathName)) {
+                               $temp_info = explode('page_', $pathName);
+                               $_GET['page'] = intval($temp_info[1]);
+                               $page = array_pop($v_path);
+                       }
+               }
+
+// decode TrackBack URL shorten ver.
+               $tail = end($v_path);
+               if (substr($tail, -10, 10) == '.trackback') {
+                       $v_pathName = substr($tail, 0, strlen($tail)-10);
+                       if (is_numeric($v_pathName)) {
+                               $this->_trackback($blogid, $v_pathName);
+                       } else {
+                               $this->_trackback($blogid, $v_pathName . '.html');
+                       }
+               }
+
+// decode other type URL
+               $bLink = $cLink = $iLink = $exLink = FALSE;
+               if (empty($info)) $bLink = TRUE;
+               $linkObj = array (
+                       'bid' => 0,
+                       'name' => reset($v_path),
+                       'linkparam' => 'blog'
+               );
+               $blog_id = $this->getRequestPathInfo($linkObj);
+               if ($blog_id) {
+                       $blogid = $blog_id;
+                       $trush = array_shift($v_path);
+                       $bLink = TURE;
+               }
+               if ($this->getBlogOption(intval($blogid), 'use_customurl') == 'no') {
+                       return;
+               }
+               $i = 1;
+               foreach($v_path as $pathName) {
+                       switch ($pathName) {
+// decode FancyURLs and redirection to Customized URL
+                               // for blogs
+                               case $CONF['BlogKey']:
+                                       if (isset($v_path[$i]) && is_numeric($v_path[$i])) {
+                                               if ($this->getBlogOption(intval($v_path[$i]), 'use_customurl') == 'no') {
+                                                       $blogid = intval($v_path[$i]);
+                                                       $bLink = TRUE;
+                                               } else {
+                                                       $red_uri = createBlogidLink(intval($v_path[$i]));
+                                               }
+                                       }
+                               break;
+                               // for items
+                               case $CONF['ItemKey']:
+                                       if (isset($v_path[$i]) && is_numeric($v_path[$i])) {
+                                               if ($this->getBlogOption(intval($blogid), 'use_customurl') == 'no') {
+                                                       $itemid = intval($v_path[$i]);
+                                                       $iLink = TRUE;
+                                               } else {
+                                                       $red_uri = createItemLink(intval($v_path[$i]));
+                                               }
+                                       }
+                               break;
+                               // for categories
+                               case $CONF['CategoryKey']:
+                               case 'catid':
+                                       if (isset($v_path[$i]) && is_numeric($v_path[$i])) {
+                                               if ($this->getBlogOption(intval($blogid), 'use_customurl') == 'no') {
+                                                       $catid = intval($v_path[$i]);
+                                                       $cLink = TRUE;
+                                               } else {
+                                                       $red_uri = createCategoryLink(intval($v_path[$i]));
+                                               }
+                                       }
+                               break;
+                               // for subcategories
+                               case $subrequest:
+                                       $c = $i - 2;
+                                       if ($mcategories && isset($v_path[$i]) && is_numeric($v_path[$i]) && $i >= 3 && is_numeric($v_path[$c])) {
+                                               if ($this->getBlogOption(intval($blogid), 'use_customurl') == 'no') {
+                                                       $subcatid = intval($v_path[$i]);
+                                                       $catid = intval($v_path[$c]);
+                                                       $cLink = TRUE;
+                                               } else {
+                                                       $red_uri = createCategoryLink(intval($v_path[$c])) . $this->_createSubCategoryLink(intval($v_path[$i]));
+                                               }
+                                       }
+                               break;
+                               // for archives
+                               case $CONF['ArchivesKey']:
+                               case $this->getOption('customurl_archives'):
+                               // FancyURL
+                                       if (isset($v_path[$i]) && is_numeric($v_path[$i])) {
+                                               if ($this->getBlogOption(intval($v_path[$i]), 'use_customurl') == 'no') {
+                                                       $archivelist = intval($v_path[$i]);
+                                                       $blogid = $archivelist;
+                                                       $exLink = TRUE;
+                                               } else {
+                                                       $red_uri = createArchiveListLink(intval($v_path[$i]));
+                                               }
+                               // Customized URL
+                                       } elseif (isset($v_path[$i])) {
+                                               $archivelist = $blogid;
+                                               $red_uri = createArchiveListLink($archivelist);
+                                       } else {
+                                               $archivelist = $blogid;
+                                               $exLink = TRUE;
+                                       }
+                               break;
+                               // for archive
+                               case $CONF['ArchiveKey']:
+                               case $this->getOption('customurl_archive'):
+                                       $y = $m = $d = '';
+                                       $ar = $i + 1;
+                                       if (isset($v_path[$i])) {
+                                               $darc = (ereg('([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})',$v_path[$i]));
+                                               $marc = (ereg('([0-9]{4})-([0-9]{1,2})',$v_path[$i]));
+                                               $adarc = (ereg('([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})',$v_path[$ar]));
+                                               $amarc = (ereg('([0-9]{4})-([0-9]{1,2})',$v_path[$ar]));
+                               // FancyURL
+                                               if (is_numeric($v_path[$i]) && !$darc && !$marc && isset($v_path[$ar]) && ($adarc || $amarc)) {
+                                                       sscanf($v_path[$ar],'%d-%d-%d',$y,$m,$d);
+                                                       if (isset($d)) {
+                                                               $archive = sprintf('%04d-%02d-%02d',$y,$m,$d);
+                                                       } else {
+                                                               $archive = sprintf('%04d-%02d',$y,$m);
+                                                       }
+                                                       if ($this->getBlogOption(intval($v_path[$i]), 'use_customurl') == 'no') {
+                                                               $blogid = intval($v_path[$i]);
+                                                               $exLink = TRUE;
+                                                       } else {
+                                                               $red_uri = createArchiveLink(intval($v_path[$i]), $archive);
+                                                       }
+                               // Customized URL
+                                               } elseif ($darc || $marc) {
+                                                       sscanf($v_path[$i],'%d-%d-%d',$y,$m,$d);
+                                                       if (isset($d)) {
+                                                               $archive = sprintf('%04d-%02d-%02d',$y,$m,$d);
+                                                       } else {
+                                                               $archive = sprintf('%04d-%02d',$y,$m);
+                                                       }
+                                                       $exLink = TRUE;
+                                               } else {
+                                                       $red_uri = createArchiveListLink($blogid);
+                                               }
+                                       } else {
+                                               $red_uri = createArchiveListLink($blogid);
+                                       }
+                               break;
+                               // for member
+                               case $CONF['MemberKey']:
+                               case $this->getOption('customurl_member'):
+                               // Customized URL
+                                       if (isset($v_path[$i]) && substr($v_path[$i], -5, 5) == '.html') {
+                                               $member_id = $this->getRequestPathInfo(array ('linkparam' => 'member', 'bid' => 0, 'name' => $v_path[$i]));
+                                               $memberid = intval($member_id);
+                                               $exLink = TRUE;
+                               // FancyURL
+                                       } elseif (isset($v_path[$i]) && is_numeric($v_path[$i])) {
+                                               if ($this->getBlogOption(intval($blogid), 'use_customurl') == 'no') {
+                                                       $memberid = intval($v_path[$i]);
+                                                       $exLink = TRUE;
+                                               } else {
+                                                       $red_uri = createMemberLink(intval($v_path[$i]));
+                                               }
+                                       } else {
+                                               $red_url = createBlogidLink($blogid);
+                                       }
+                               break;
+                               // for tag
+                               case 'tag':
+                                       if (isset($v_path[$i]) && is_string($v_path[$i])) {
+                                               $_REQUEST['tag'] = $v_path[$i];
+                                               $exLink = TRUE;
+                                       }
+                               break;
+                               // for search query
+                               case 'search':
+//                                     if (isset($v_path[$i]) && is_string($v_path[$i])) {
+//                                             if (!serverVar('QUERY_STRING')) {
+//                                                     $_SERVER['QUERY_STRING'] = 'query='.$v_path[$i];
+//                                             } else {
+//                                                     $_SERVER['QUERY_STRING'] .= '&query='.$v_path[$i];
+//                                             }
+//                                             $_REQUEST['query'] = urldecode($v_path[$i]);
+                                               $que_str = urldecode($v_path[$i]);
+                                               $que_str = mb_eregi_replace('ssslllaaassshhh', '/', $que_str);
+                                               $que_str = mb_eregi_replace('qqquuuooottt', "'", $que_str);
+                                               $que_str = mb_eregi_replace('aaammmppp', '&', $que_str);
+                                               $que_str = htmlspecialchars_decode($que_str);
+                                               $_GET['query'] = $que_str;
+                                               $query = $que_str;
+                                               $exLink = TRUE;
+//                                     }
+                               break;
+                               // for pageswitch
+                               case 'page':
+                                       if (isset($v_path[$i]) && is_numeric($v_path[$i])) {
+                                               $_GET['page'] = intval($v_path[$i]);
+                                               $exLink = TRUE;
+                                       }
+                               break;
+                               // for trackback
+                               case 'trackback':
+                                       if (isset($v_path[$i]) && is_string($v_path[$i])) $this->_trackback($blogid, $v_path[$i]);
+                                       return;
+                               break;
+
+// decode Customized URL
+                               default:
+                               // initialyze
+                                       $linkObj = array (
+                                               'bid' => $blogid,
+                                               'name' => $pathName
+                                       );
+                               // category ?
+                                       if (!$cLink && !$iLink && substr($pathName, -5) != '.html') {
+                                               $linkObj['linkparam'] = 'category';
+                                               $cat_id = $this->getRequestPathInfo($linkObj);
+                                               if (!empty($cat_id)) {
+                                                       $catid = intval($cat_id);
+                                                       $cLink = TURE;
+                                               }
+                                       }
+                               // subcategory ?
+                                       if ($cLink && !$iLink && $mcategories && substr($pathName, -5) != '.html') {
+                                               $linkObj['linkparam'] = 'subcategory';
+                                               $linkObj['bid'] = $catid;
+                                               $subcat_id = $this->getRequestPathInfo($linkObj);
+                                               if (!empty($subcat_id)) {
+                                                       $_REQUEST[$subrequest] = intval($subcat_id);
+                                                       $subcatid = intval($subcat_id);
+                                                       $sc = $i;
+                                               }
+                                       }
+                               // item ?
+                                       if (substr($pathName, -5) == '.html') {
+                                               $linkObj['linkparam'] = 'item';
+                                               $item_id = $this->getRequestPathInfo($linkObj);
+                                               if (!empty($item_id)) {
+                                                       $itemid = intval($item_id);
+                                                       $iLink = TRUE;
+                                               }
+                                       }
+                               break;
+                       }
+                       if (preg_match('/^[0-9page]$/', $pathName)) $exLink = $pathName;
+                       $i++;
+               }
+
+// FancyURL redirect to Customized URL if use it
+// HTTP status 301 "Moved Permanentry"
+               if ($red_uri) {
+                       header('HTTP/1.1 301 Moved Permanently');
+                       header('Location: ' . $red_uri);
+                       exit;
+               }
+
+               $request_path = end($v_path);
+               $feeds = ($request_path == 'rss1.xml' || $request_path == 'index.rdf' || $request_path == 'rss2.xml' || $request_path == 'atom.xml');
+
+// finish decode
+               if (!$exLink && !$feeds) {
+// URL Not Found
+                       if (substr(end($v_path), -5) == '.html' && !$iLink) {
+                               $notFound = TRUE;
+                               if (!empty($subcatid)) {
+                                       $uri = createCategoryLink($catid) . $this->_createSubCategoryLink($subcatid);
+                               } elseif (!empty($catid)) {
+                                       $uri = createCategoryLink($catid);
+                               } else {
+                                       $uri = createBlogidLink($blogid);
+                               }
+                       } elseif (count($v_path) > $sc && !empty($subcatid) && !$iLink) {
+                               $notFound = TRUE;
+                               $uri = createCategoryLink($catid) . $this->_createSubCategoryLink($subcatid);
+                       } elseif (count($v_path) >= 2 && !$subcatid && !$iLink) {
+                               $notFound = TRUE;
+                               if (isset($catid)) {
+                                       $uri = createCategoryLink($catid);
+                               } else {
+                                       $uri = createBlogidLink($blogid);
+                               }
+                       } elseif (reset($v_path) && !$catid && !$subcatid && !$iLink) {
+                               $notFound = TRUE;
+                               $uri = createBlogidLink($blogid);
+                       } else {
+// Found
+// setting $CONF['Self'] for other plugins
+                               $uri = createBlogidLink($blogid);
+                               $CONF['Self'] = rtrim($uri, '/');
+                               $complete = TRUE;
+                               return ;
+                       }
+               } else {
+                       $uri = createBlogidLink($blogid);
+                       $CONF['Self'] = rtrim($uri, '/');
+                       $complete = TRUE;
+                               return ;
+               }
+// Behavior Not Found
+               if ($notFound) {
+                       if (substr($uri, -1) != '/') $uri .= '/';
+                       if ($this->getOption('customurl_notfound') == '404') {
+                               header('HTTP/1.1 404 Not Found');
+                               doError(_NO_SUCH_URI);
+                               exit;
+                       } else {
+                               header('HTTP/1.1 303 See Other');
+                               header('Location: ' . $uri);
+                               exit;
+                       }
+               }
+       }
+
+// decode 'path name' to 'id'
+       function getRequestPathInfo($linkObj)
+       {
+               $query = 'SELECT obj_id as result FROM %s WHERE obj_name = "%s" AND obj_bid = %d AND obj_param = "%s"';
+               $ObjID = quickQuery(sprintf($query, _CUSTOMURL_TABLE, $this->quote_smart($linkObj['name']), $this->quote_smart($linkObj['bid']), $this->quote_smart($linkObj['linkparam'])));
+               if(!$ObjID) {
+                       return;
+               } else {
+                       return intval($ObjID);
+               }
+       }
+
+// Receive TrackBack ping
+       function _trackback($bid, $path)
+       {
+               $blog_id = intval($bid);
+               $TrackBack = $this->pluginCheck('TrackBack');
+               if ($TrackBack) {
+                       if (substr($path, -5, 5) == '.html') {
+                               $linkObj = array ('linkparam' => 'item', 'bid' => $blog_id, 'name' => $path);
+                               $item_id = $this->getRequestPathInfo($linkObj);
+                               if ($item_id) {
+                                       $tb_id = intval($item_id);
+                               } else {
+                                       doError(_NO_SUCH_URI);
+                               }
+                       } else {
+                               $tb_id = intval($path);
+                       }
+                       $TrackBack->handlePing($tb_id);
+               }
+               return;
+       }
+
+       function event_GenerateURL($data)
+       {
+               global $CONF, $manager, $blogid;
+               if ($data['completed']) return;
+
+               $mcategories = $this->pluginCheck('MultipleCategories');
+               if ($mcategories) {
+                       if (method_exists($mcategories, 'getRequestName')) {
+                               $mcategories->event_PreSkinParse(array());
+                               global $subcatid;
+                               $subrequest = $mcategories->getRequestName();
+                       }
+               }
+               $OP_ArchiveKey  = $this->getOption('customurl_archive');
+               $OP_ArchivesKey = $this->getOption('customurl_archives');
+               $OP_MemberKey   = $this->getOption('customurl_member');
+               $params = $data['params'];
+               switch ($data['type']) {
+                       case 'item':
+                               if (!is_numeric($params['itemid'])) return;
+                               $item_id = intval($params['itemid']);
+                               $bid = getBlogIDFromItemID($item_id);
+                               if ($this->getBlogOption($bid, 'use_customurl') == 'no') return;
+                               $query = 'SELECT obj_name as result FROM %s WHERE obj_param = "item" AND obj_id = %d';
+                               $path = quickQuery(sprintf($query, _CUSTOMURL_TABLE, $item_id));
+                               if ($path) {
+                                       $objPath = $path;
+                               } else {
+                                       if (!$this->_isValid(array('item', 'inumber', $item_id))) {
+                                               $objPath = _NOT_VALID_ITEM;
+                                       } else {
+                                               $y = $m = $d = $temp = '';
+                                               $tque = 'SELECT itime as result FROM %s WHERE inumber = %d';
+                                               $itime = quickQuery( sprintf($tque ,sql_table('item'), intval($item_id) ) );
+                                               sscanf($itime,'"%d-%d-%d %s"',$y,$m,$d,$temp);
+                                               $ikey = TEMPLATE::fill($this->getOption('customurl_dfitem'), array ('year' => $y, 'month' => $m, 'day' => $d));
+                                               $ipath = $ikey . '_' . $item_id;
+                                               $query = 'SELECT ititle as result FROM %s WHERE inumber = %d';
+                                               $iname = quickQuery(sprintf($query, sql_table('item'), $item_id));
+                                               $this->RegistPath($item_id, $ipath, $bid, 'item', $iname, TRUE);
+                                               $objPath = $ipath . '.html';
+                                       }
+                               }
+                               if ($params['extra']['catid'] && $subcatid) {
+                                       $params['extra'][$subrequest] = intval($subcatid);
+                               }
+                               if ($bid != $blogid) {
+                                       $burl = $this->_generateBlogLink(intval($bid));
+                               } else {
+                                       $burl = $this->_generateBlogLink(intval($blogid));
+                               }
+                       break;
+                       case 'member':
+                               if (!is_numeric($params['memberid']) || $this->getBlogOption(intval($blogid), 'use_customurl') == 'no') return;
+                               $member_id = intval($params['memberid']);
+                               $path = $this->getMemberOption($member_id, 'customurl_mname');
+                               if ($path) {
+                                       $data['url'] = $this->_generateBlogLink(intval($blogid)) . '/' . $OP_MemberKey . '/' . $path . '.html';
+                                       $data['completed'] = TRUE;
+                                       return;
+                               } else {
+                                       if (!$this->_isValid(array('member', 'mnumber', $member_id))) {
+                                               $data['url'] = $this->_generateBlogLink(intval($blogid)) . '/' . _NOT_VALID_MEMBER;
+                                               $data['completed'] = TRUE;
+                                               return;
+                                       } else {
+                                               $query = 'SELECT mname as result FROM %s WHERE mnumber = %d';
+                                               $mname = quickQuery(sprintf($query, sql_table('member'), $member_id));
+                                               $this->RegistPath($member_id, $mname, 0, 'member', $mname, TRUE);
+                                               $data['url'] = $this->_generateBlogLink(intval($blogid)) . '/' . $OP_MemberKey . '/' . $mname . '.html';
+                                               $data['completed'] = TRUE;
+                                               return;
+                                       }
+                               }
+                       break;
+                       case 'category':
+                               if (!is_numeric($params['catid'])) return;
+                               $cat_id = intval($params['catid']);
+                               $bid = getBlogidFromCatID($cat_id);
+                               if ($this->getBlogOption(intval($bid), 'use_customurl') == 'no') return;
+                               $objPath = $this->_generateCategoryLink($cat_id);
+                               if ($bid != $blogid) {
+                                       $burl = $this->_generateBlogLink(intval($bid));
+                               }
+                       break;
+                       case 'archivelist':
+                               if ($this->getBlogOption(intval($blogid), 'use_customurl') == 'no') return;
+                               $objPath = $OP_ArchivesKey . '/';
+                               $bid = $blogid;
+                               if ($subcatid) {
+                                       $params['extra'][$subrequest] = intval($subcatid);
+                               }
+                       break;
+                       case 'archive':
+                               if ($this->getBlogOption(intval($blogid), 'use_customurl') == 'no') return;
+                               sscanf($params['archive'],'%d-%d-%d',$y,$m,$d);
+                               if ($d) {
+                                       $arc = sprintf('%04d-%02d-%02d',$y,$m,$d);
+                               } else {
+                                       $arc = sprintf('%04d-%02d',$y,$m);
+                               }
+                               $objPath = $OP_ArchiveKey . '/' . $arc . '/';
+                               $bid = $blogid;
+                               if ($subcatid) {
+                                       $params['extra'][$subrequest] = intval($subcatid);
+                               }
+                       break;
+                       case 'blog':
+                               if (!is_numeric($params['blogid'])) return;
+                               $bid = intval($params['blogid']);
+                               $burl = $this->_generateBlogLink($bid);
+                       break;
+                       default:
+                               return;
+               }
+               if (!$burl) $burl = $this->_generateBlogLink(intval($blogid));
+
+               //NP_Analyze AdminArea check
+               $aplugin = $this->pluginCheck('Analyze');
+               if ($aplugin) {
+                       $aadmin = str_replace('/', '\/', $aplugin->getAdminURL());
+                       $p_arr = explode('/', serverVar('SCRIPT_NAME'));
+                       $tmp = array_pop($p_arr);
+                       $p_info = implode('\/', $p_arr);
+               }
+               if ($p_info) {
+                       if (strpos($aadmin, $p_info)) $CONF['UsingAdminArea'] = TRUE;
+               }
+               //NP_Analyze AdminArea check end
+
+               if ($bid != $blogid && !$CONF['UsingAdminArea']) $params['extra'] = array();
+               if ($objPath || $data['type'] == 'blog') {
+                       $LinkURI = $this->_addLinkParams($objPath, $params['extra']);
+                       if ($LinkURI) {
+                               $data['url'] =  $burl . '/' . $LinkURI;
+                       } else {
+                               $data['url'] = $burl;
+                       }
+                       $isArchives = ((preg_match('/' . $OP_ArchivesKey . '/', $data['url'])) || (preg_match('/' . $OP_ArchiveKey . '/', $data['url'])));
+                       $isItem = (substr($data['url'], -5, 5) == '.html');
+                       $isDirectory = (substr($data['url'], -1) == '/');
+                       if ($isArchives && !$isItem && !$isDirectory) {
+                               $data['url'] .= '/';
+                       }
+                       $data['completed'] = TRUE;
+                       if (strstr ($data['url'], '//')) $link = preg_replace("/([^:])\/\//", "$1/", $data['url']);
+                       return $data;
+               }
+       }
+
+       function _createSubCategoryLink($scid)
+       {
+               $scids = $this->getParents(intval($scid));
+               $subcatids = explode('/', $scids);
+               $eachPath = array();
+               foreach ($subcatids as $sid) {
+                       $subcat_id = intval($sid);
+                       $query = 'SELECT obj_name as result FROM %s WHERE obj_id = %d AND obj_param = "%s"';
+                       $path = quickQuery(sprintf($query, _CUSTOMURL_TABLE, $subcat_id, 'subcategory'));
+                       if ($path) {
+                               $eachPath[] = $path;
+                       } else {
+                               if (!$this->_isValid(array('plug_multiple_categories_sub', 'scatid', $subcat_id))) {
+                                       return $url = _NOT_VALID_SUBCAT;
+                               } else {
+                                       $scpath = $this->getOption('customurl_dfscat') . '_' . $subcat_id;
+                                       $query = 'SELECT catid as result FROM %s WHERE scatid = %d';
+                                       $cid= quickQuery(sprintf($query, _C_SUBCAT_TABLE, $subcat_id));
+                                       if (!$cid) return 'no_such_subcat=' . $subcat_id . '/';
+                                       $this->RegistPath($subcat_id, $scpath, $cid, 'subcategory', 'subcat_' . $subcat_id, TRUE);
+                                       $eachPath[] = $scpath;
+                               }
+                       }
+               }
+               $subcatPath = @join('/', $eachPath);
+               return $subcatPath . '/';
+       }
+
+       function getParents($subid)
+       {
+               $subcat_id = intval($subid);
+               $query = 'SELECT scatid, parentid FROM %s WHERE scatid = %d';
+               $res = sql_query(sprintf($query, _C_SUBCAT_TABLE, $subcat_id));
+               list($sid, $parent) = mysql_fetch_row($res);
+               if ($parent != 0) {
+                       $r = $this->getParents($parent) . '/' . $sid;
+               } else {
+                       $r = $sid;
+               }
+               return $r;
+       }
+
+       function _generateCategoryLink($cid)
+       {
+               global $CONF;
+               $cat_id = intval($cid);
+               $path = $this->getCategoryOption($cat_id, 'customurl_cname');
+               if ($path) {
+                       return $path . '/';
+               } else {
+                       if (!$this->_isValid(array('category', 'catid', $cat_id))) {
+                               return $url = _NOT_VALID_CAT;
+                       } else {
+                               $cpath = $this->getOption('customurl_dfcat') . '_' . $cat_id;
+                               $this->RegistPath($cat_id, $cpath, getBlogIDFromCatID($cat_id), 'category', 'catid_'.$cat_id, TRUE);
+                               return $cpath . '/';
+                       }
+               }
+       }
+
+       function _generateBlogLink($bid)
+       {
+               global $manager, $CONF;
+               $blog_id = intval($bid);
+               if ($this->getBlogOption($blog_id, 'use_customurl') == 'no') {
+                       $b =& $manager->getBlog($blog_id);
+                       $burl = $b->getURL();
+               } else {
+                       if ($blog_id == $CONF['DefaultBlog']) {
+                               $burl = trim($CONF['IndexURL'], '/');
+                       } else {
+                               $query = 'SELECT burl as result FROM %s WHERE bnumber = %d';
+                               $burl = quickQuery(sprintf($query, sql_table('blog'), $blog_id));
+                               if ($burl) {
+                                       if (substr($burl, -4, 4) == '.php') {
+                                               $path = $this->getBlogOption($blog_id, 'customurl_bname');
+                                               if ($path) {
+                                                       $burl = $CONF['IndexURL'] . $path;
+                                               } else {
+                                                       $query = 'SELECT bshortname as result FROM %s WHERE bnumber = %d';
+                                                       $bpath = quickQuery(sprintf($query, sql_table('blog'), $blog_id));
+                                                       $this->RegistPath($blog_id, $bpath, 0, 'blog', $bpath, TRUE);
+                                                       $burl = $CONF['IndexURL'] . $bpath;
+                                               }
+                                               $burl_update = 'UPDATE %s SET burl = "%s" WHERE bnumber = %d';
+                                               sql_query(sprintf($burl_update, sql_table('blog'), $this->quote_smart($burl), $blog_id));
+                                       }
+                               } else {
+                                       $burl = _NOT_VALID_BLOG;
+                               }
+                       }
+               }
+               return trim($burl, '/');
+       }
+
+       function _addLinkParams($link, $params)
+       {
+               global $CONF, $manager, $catid;
+               $isArchives  = ((preg_match('/' . $this->getOption('customurl_archives') . '/', $link)) || (preg_match('/' . $this->getOption('customurl_archive') . '/', $link)));
+               $mcategories = $this->pluginCheck('MultipleCategories');
+               if ($mcategories) {
+                       if (method_exists($mcategories,"getRequestName")) {
+                               $mcategories->event_PreSkinParse(array());
+                               global $subcatid;
+                               $subrequest = $mcategories->getRequestName();
+                       }
+               }
+               if (!$subrequest) $subrequest = 'subcatid';
+               if (is_array($params)) {
+                       foreach ($params as $param => $value) {
+                               switch ($param) {
+                                       case 'catid':
+                                               $catlink = $this->_generateCategoryLink(intval($value));
+                                       break;
+                                       case $subrequest:
+                                               if ($mcategories) {
+                                                       $sublink = $this->_createSubCategoryLink(intval($value));
+                                               }
+                                       break;
+                               }
+                       }
+                       $tagparam = (preg_match('/^tag\//', $link));
+                       if (substr($link, -5, 5) == '.html' || $tagparam || $isArchives) {
+                               $link = $catlink . $sublink . $link;
+                       } else {
+                               $link .= $catlink . $sublink;
+                       }
+               }
+               if (strstr ($link, '//')) {
+                       $link = preg_replace("/([^:])\/\//", "$1/", $link);
+               }
+               return $link;
+       }
+
+       function doSkinVar($skinType, $link_type = '', $target = '', $title = '')
+       {
+               global $blogid;
+               if ($skinType == 'item' && $link_type == 'trackback') {
+                       global $itemid, $CONF;
+                       if ($this->getBlogOption($blogid, 'use_customurl') == 'yes') {
+                               $que = 'SELECT obj_name as result FROM %s WHERE obj_param = "item" AND obj_id = %d';
+                               $itempath = quickQuery(sprintf($que, _CUSTOMURL_TABLE, $itemid));
+                               $uri = $CONF['BlogURL'] . '/trackback/' . $itempath;
+// /item_123.trackback
+//                             $itempath = substr($itempath, 0, -5) . '.trackback';
+//                             $uri = $CONF['BlogURL'] . '/' . $itempath;
+                       } else {
+                               $uri = $CONF['ActionURL'] . '?action=plugin&amp;name=TrackBack&amp;tb_id='.$itemid;
+                       }
+                       echo $uri;
+                       return;
+               }
+               // $data == type / id || name / 'i'd || 'n'ame
+               // ex. =>       [(b)log / blogid [|| shortname / 'i'd || 'n'ame]]
+               //                      (c)at  / catid [|| cname / 'i'd || 'n'ame]
+               //                      (s)cat / subcatid [|| sname / 'i'd || 'n'ame]
+               //                      [(i)tem /] itemid [/ 'path']
+               //                      (m)ember / mnumber [|| mname / 'i'd || 'n'ame]
+               //
+               // if second param is null, third param is id
+               // if param is null, generate blog link
+               if (!$link_type) {
+                       $link_params = '0, b/' . intval($blogid) . '/i,' . $target . ',' . $title;
+               } else {
+                       $l_params = explode("/", $link_type);
+                       if (count($l_params) == 1) {
+                               $link_params = array(0, 'b/' . intval($link_type) . '/i,' . $target . ',' . $title);
+                       } else {
+                               $link_params = array(0, $link_type . ',' . $target . ',' . $title);
+                       }
+               }
+               echo $this->URL_Callback($link_params);
+       }
+
+       function doTemplateVar(&$item, $link_type = '', $target = '', $title = '')
+       {
+               if ($link_type == 'trackback') {
+                       global $CONF;
+                       if ($this->getBlogOption(getBlogIDFromItemID(intval($item->itemid)), 'use_customurl') == 'yes') {
+                               $que = 'SELECT obj_name as result FROM %s WHERE obj_param = "item" AND obj_id = %d';
+                               $itempath = quickQuery(sprintf($que, _CUSTOMURL_TABLE, intval($item->itemid)));
+                               $uri = $CONF['BlogURL'] . '/trackback/' . $itempath;
+// /item_123.trackback
+//                             $itempath = substr($itempath, 0, -5) . '.trackback';
+//                             $uri = $CONF['BlogURL'] . '/' . $itempath;
+                       } else {
+                               $uri = $CONF['ActionURL'] . '?action=plugin&amp;name=TrackBack&amp;tb_id='.intval($item->itemid);
+                       }
+                       echo $uri;
+                       return;
+               }
+               if (!$link_type) {
+                       $link_params = array(0, 'i/' . intval($item->itemid) . '/i,' . $target . ',' . $title);
+               } else {
+                       $link_params = array(0, $link_type . ',' . $target . ',' . $title);
+               }
+               echo $this->URL_Callback($link_params);
+       }
+
+       function URL_Callback($data)
+       {
+               $l_data         = explode(",", $data[1]);
+               $l_type         = $l_data[0];
+               $target         = $l_data[1];
+               $title          = $l_data[2];
+               $item_id        = intval($this->currentItem->itemid);
+               if (!$l_type) {
+                       $link_params = array ('i', $item_id, 'i');
+               } else {
+                       $link_data = explode("/", $l_type);
+                       if (count($link_data) == 1) {
+                               $link_params = array ('i', intval($l_type), 'i');
+                       } elseif (count($link_data) == 2) {
+                               if ($link_data[1] == 'path') {
+                                       $link_params = array ('i', $link_data[0], 'path');
+                               } else {
+                                       $link_params = array ($link_data[0], intval($link_data[1]), 'i');
+                               }
+                       } else {
+                               $link_params = array ($link_data[0], $link_data[1], $link_data[2]);
+                       }
+               }
+               $url = $this->_genarateObjectLink($link_params);
+               if ($target) {
+                       if ($title) {
+                               $ObjLink = '<a href="' . htmlspecialchars($url) . '" title="' . htmlspecialchars($title) . '">' . htmlspecialchars($target) . '</a>';
+                       } else {
+                               $ObjLink = '<a href="' . htmlspecialchars($url) . '" title="' . htmlspecialchars($target) . '">' . htmlspecialchars($target) . '</a>';
+                       }
+               } else {
+                       $ObjLink = htmlspecialchars($url);
+               }
+               return $ObjLink;
+       }
+
+       function _isValid($data)
+       {
+               $query = 'SELECT * FROM %s WHERE %s = %d';
+               $res = sql_query(sprintf($query, sql_table($data[0]), $data[1], $this->quote_smart($data[2])));
+               return (mysql_num_rows($res) != 0);
+       }
+
+       function _genarateObjectLink($data)
+       {
+               global $CONF, $manager, $blog;
+               $ext = substr(serverVar('REQUEST_URI'), -4);
+               if ($ext == '.rdf' || $ext == '.xml') $CONF['URLMode'] = 'pathinfo';
+               if ($CONF['URLMode'] != 'pathinfo') return;
+               $query = 'SELECT %s as result FROM %s WHERE %s = "%s"';
+               switch ($data[0]) {
+                       case 'b':
+                               if ($data[2] == 'n') {
+                                       $bid = getBlogIDFromName($data[1]);
+                               } else {
+                                       $bid = $data[1];
+                               }
+                               $blog_id = intval($bid);
+                               if (!$this->_isValid(array('blog', 'bnumber', $blog_id))) {
+                                       $url = _NOT_VALID_BLOG;
+                               } else {
+                                       $url = $this->_generateBlogLink($blog_id) . '/';
+                               }
+                       break;
+                       case 'c':
+                               if ($data[2] == 'n') {
+                                       $cid = getCatIDFromName($data[1]);
+                               } else {
+                                       $cid = $data[1];
+                               }
+                               $cat_id = intval($cid);
+                               if (!$this->_isValid(array('category', 'catid', $cat_id))) {
+                                       $url = _NOT_VALID_CAT;
+                               } else {
+                                       $bid = getBlogIDFromCatID($cat_id);
+                                       $blink = $this->_generateBlogLink(intval($bid));
+                                       $url = $blink . '/' . $this->_generateCategoryLink($cat_id, '');
+                               }
+                       break;
+                       case 's':
+                               $mcategories = $this->pluginCheck('MultipleCategories');
+                               if ($mcategories) {
+                                       if (method_exists($mcategories, "getRequestName")) {
+                                               if ($data[2] == 'n') {
+                                                       $scid = quickQuery(sprintf($query, 'scatid', _C_SUBCAT_TABLE, 'sname', $this->quote_smart($data[1])));
+                                               } else {
+                                                       $scid = $data[1];
+                                               }
+                                               $sub_id = intval($scid);
+                                               if (!$this->_isValid(array('plug_multiple_categories_sub', 'scatid', $sub_id))) {
+                                                       $url = _NOT_VALID_SUBCAT;
+                                               } else {
+                                                       $cid = quickQuery(sprintf($query, 'catid', _C_SUBCAT_TABLE, 'scatid', intVal($sub_id)));
+                                                       $subrequest = $mcategories->getRequestName();
+                                                       $url = createCategoryLink(intval($cid), array($subrequest => $sub_id));
+                                               }
+                                       }
+                               }
+                       break;
+                       case 'i':
+                               if (!$this->_isValid(array('item', 'inumber', intval($data[1])))) {
+                                       $url = _NOT_VALID_ITEM;
+                               } else {
+                                       $blink = $this->_generateBlogLink(getBlogIDFromItemID(intval($data[1])));
+                                       $i_query = 'SELECT obj_name as result FROM %s WHERE obj_param = "item" AND obj_id = %d';
+                                       $path = quickQuery(sprintf($i_query, _CUSTOMURL_TABLE, intval($data[1])));
+                                       if ($path) {
+                                               if ($data[2] == 'path') {
+                                                       $url = $path;
+                                               } else {
+                                                       $url = $blink . '/' . $path;
+                                               }
+                                       } else {
+                                               if ($data[2] == 'path') {
+                                                       $url = $CONF['ItemKey'] . '/' . $data[1];
+                                               } else {
+                                                       $url = $blink . '/' . $CONF['ItemKey'] . '/' . $data[1];
+                                               }
+                                       }
+                               }
+                       break;
+                       case 'm':
+                               if ($data[2] == 'n') {
+                                       $mid = quickQuery(sprintf($query, 'mnumber', sql_table('member'), 'mname', $this->quote_smart($data[1])));
+                               } else {
+                                       $mid = $data[1];
+                               }
+                               $member_id = intval($mid);
+                               if (!$this->_isValid(array('member', 'mnumber', $member_id))) {
+                                       $url = _NOT_VALID_MEMBER;
+                               } else {
+                                       $url = createMemberLink($member_id, '');
+                               }
+                       break;
+               }
+               return $url;
+       }
+
+       function event_PreSendContentType($data)
+       {
+               global $blogid, $CONF;
+
+               $ext = substr(serverVar('REQUEST_URI'), -4);
+               if ($ext == '.rdf' || $ext == '.xml') {
+                       $p_info = trim(serverVar('PATH_INFO'), '/');
+                       $path_arr = explode('/', $p_info);
+                       switch (end($path_arr)) {
+                               case 'rss1.xml':
+                               case 'index.rdf':
+                               case 'rss2.xml':
+                               case 'atom.xml':
+                                       $data['contentType'] = 'application/xml';
+                                       break;
+                               default:
+                                       break;
+                       }
+               }
+       }
+
+       function event_InitSkinParse($data)
+       {
+               global $blogid, $CONF;
+               $ext = substr(serverVar('PATH_INFO'), -4);
+               if ($ext != '.rdf' && $ext != '.xml') {
+                       return;
+               } else {
+                       $p_info = trim(serverVar('PATH_INFO'), '/');
+                       $path_arr = explode('/', $p_info);
+                       switch (end($path_arr)) {
+                               case 'rss1.xml':
+                               case 'index.rdf':
+                                       $skinName = 'feeds/rss10';
+                                       break;
+                               case 'rss2.xml':
+                                       $skinName = 'feeds/rss20';
+                                       break;
+                               case 'atom.xml':
+                                       $skinName = 'feeds/atom';
+                                       break;
+                       }
+                       if (SKIN::exists($skinName)) {
+                               ob_start();
+                               $skin =& SKIN::createFromName($skinName);
+                               $data['skin']->SKIN($skin->getID());
+                               $feed = ob_get_contents();
+                               ob_end_clean();
+                               $eTag = '"'.md5($feed).'"';
+                               header('Etag: '.$eTag);
+                               if ($eTag == serverVar('HTTP_IF_NONE_MATCH')) { 
+                                       header("HTTP/1.0 304 Not Modified");
+                                       header('Content-Length: 0');
+                               }
+                       }
+               }
+       }
+
+// merge NP_RightURL
+       function event_PreSkinParse($data)
+       {
+               global $CONF, $manager, $blog, $catid, $itemid, $subcatid;
+               global $memberid;
+
+/*             $mcategories = $this->pluginCheck('MultipleCategories');
+               if ($mcategories) {
+                       if (method_exists($mcategories, "getRequestName")) {
+                               $mcategories->event_PreSkinParse(array());
+                               global $subcatid;
+                               if ($subcatid && !$catid) {
+                                       $catid = intval($mcategories->_getParentCatID(intval($subcatid)));
+                                       if (!$catid) {
+                                               $subcatid = null;
+                                               $catid = null;
+                                       }
+                               } elseif ($subcatid) {
+                                       $pcatid = intval($mcategories->_getParentCatID(intval($subcatid)));
+                                       if ($pcatid != $catid) $subcatid = null;
+                               }
+                       }
+               }*/
+               if (!$blog) {
+                       $b =& $manager->getBlog($CONF['DefaultBlog']);
+               } else {
+                       $b =& $blog;
+               }
+               $blogurl = $b->getURL();
+               
+               if (!$blogurl) {
+                       if($blog) {
+                               $b_tmp =& $manager->getBlog($CONF['DefaultBlog']);
+                               $blogurl = $b_tmp->getURL();
+                       }
+                       if (!$blogurl) {
+                               $blogurl = $CONF['IndexURL'];
+                               if ($CONF['URLMode'] != 'pathinfo'){
+                                       if ($data['type'] == 'pageparser') {
+                                               $blogurl .= 'index.php';
+                                       } else {
+                                               $blogurl = $CONF['Self'];
+                                       }
+                               }
+                       }
+               }
+               if ($CONF['URLMode'] == 'pathinfo'){
+                       if(substr($blogurl, -1) == '/')  $blogurl = substr($blogurl,0,-1);
+               }
+               $CONF['BlogURL'] = $blogurl;
+               $CONF['ItemURL'] = $blogurl;
+               $CONF['CategoryURL'] = $blogurl;
+               $CONF['ArchiveURL'] = $blogurl;
+               $CONF['ArchiveListURL'] = $blogurl;
+               $CONF['SearchURL'] = $blogurl;
+//             $CONF['MemberURL'] = $blogurl;
+       }
+
+       function event_PreItem($data)
+       {
+               global $CONF, $manager;
+
+               $this->currentItem = &$data['item']; 
+               $pattern = '/<%CustomURL\((.*)\)%>/';
+               $data['item']->body = preg_replace_callback ($pattern, array (&$this, 'URL_Callback'), $data['item']->body);
+               if ($data['item']->more) {
+                       $data['item']->more = preg_replace_callback ($pattern, array (&$this, 'URL_Callback'), $data['item']->more);
+               }
+
+               $itemid = intval($data['item']->itemid);
+               $itemblog =& $manager->getBlog(getBlogIDFromItemID($itemid));
+               $blogurl = $itemblog->getURL();
+               if (!$blogurl) {
+                       $b =& $manager->getBlog($CONF['DefaultBlog']);
+                       if (!($blogurl = $b->getURL())) {
+                               $blogurl = $CONF['IndexURL'];
+                               if ($CONF['URLMode'] != 'pathinfo'){
+                                       if ($data['type'] == 'pageparser') {
+                                               $blogurl .= 'index.php';
+                                       } else {
+                                               $blogurl = $CONF['Self'];
+                                       }
+                               }
+                       }
+               }
+               if ($CONF['URLMode'] == 'pathinfo'){
+                       if(substr($blogurl, -1) == '/')  $blogurl = substr($blogurl,0,-1);
+               }
+               $CONF['BlogURL'] = $blogurl;
+               $CONF['ItemURL'] = $blogurl;
+               $CONF['CategoryURL'] = $blogurl;
+               $CONF['ArchiveURL'] = $blogurl;
+               $CONF['ArchiveListURL'] = $blogurl;
+//             $CONF['MemberURL'] = $blogurl;
+       }
+
+       function event_PostItem($data)
+       {
+               global $CONF, $manager, $blog;
+               if (!$blog) {
+                       $b =& $manager->getBlog($CONF['DefaultBlog']);
+               } else {
+                       $b =& $blog;
+               }
+               $blogurl = $b->getURL();
+               if (!$blogurl) {
+                       if($blog) {
+                               $b_tmp =& $manager->getBlog($CONF['DefaultBlog']);
+                               $blogurl = $b_tmp->getURL();
+                       }
+                       if (!$blogurl) {
+                               $blogurl = $CONF['IndexURL'];
+                               if ($CONF['URLMode'] != 'pathinfo'){
+                                       if ($data['type'] == 'pageparser') {
+                                               $blogurl .= 'index.php';
+                                       } else {
+                                               $blogurl = $CONF['Self'];
+                                       }
+                               }
+                       }
+               }
+               if ($CONF['URLMode'] == 'pathinfo'){
+                       if(substr($blogurl, -1) == '/')  $blogurl = substr($blogurl,0,-1);
+               }
+               $CONF['BlogURL'] = $blogurl;
+               $CONF['ItemURL'] = $blogurl;
+               $CONF['CategoryURL'] = $blogurl;
+               $CONF['ArchiveURL'] = $blogurl;
+               $CONF['ArchiveListURL'] = $blogurl;
+//             $CONF['MemberURL'] = $CONF['Self'];
+       }
+// merge NP_RightURL end
+
+       function event_PostDeleteBlog ($data)
+       {
+               $query = 'DELETE FROM %s WHERE obj_id = %d AND obj_param = "%s"';
+               $pquery = 'DELETE FROM %s WHERE obj_bid = %d AND obj_param= "%s"';
+               sql_query(sprintf($query, _CUSTOMURL_TABLE, $data['blogid'], 'blog'));
+               sql_query(sprintf($pquery, _CUSTOMURL_TABLE, $data['blogid'], 'item'));
+               $cnm = sql_query(sprintf('SELECT catid FROM %s WHERE cblog = %d', sql_table('category'), intval($data['blogid'])));
+               while ($c = mysql_fetch_object($cnm)) {
+                       sql_query(sprintf($pquery, _CUSTOMURL_TABLE, intval($c->catid), 'subcategory'));
+                       sql_query(sprintf($query, _CUSTOMURL_TABLE, intval($c->catid), 'category'));
+               }
+       }
+
+       function event_PostDeleteCategory ($data)
+       {
+               $query = 'DELETE FROM %s WHERE obj_id = %d AND obj_param = "%s"';
+               $squery = 'DELETE FROM %s WHERE obj_bid = %d AND obj_param = "%s"';
+               sql_query(sprintf($query, _CUSTOMURL_TABLE, intval($data['catid']), 'category'));
+               sql_query(sprintf($squery, _CUSTOMURL_TABLE, intval($data['catid']), 'subcategory'));
+       }
+
+       function event_PostDeleteItem ($data)
+       {
+               $query = 'DELETE FROM %s WHERE obj_id = %d AND obj_param = "%s"';
+               sql_query(sprintf($query, _CUSTOMURL_TABLE, intval($data['itemid']), 'item'));
+       }
+
+       function event_PostDeleteMember ($data)
+       {
+               $query = 'DELETE FROM %s WHERE obj_id = %d AND obj_param = "%s"';
+               sql_query(sprintf($query, _CUSTOMURL_TABLE, intval($data['member']->id), 'member'));
+       }
+
+       function event_PostAddBlog ($data)
+       {
+               $this->RegistPath(intval($data['blog']->blogid), $data['blog']->settings['bshortname'], 0, 'blog', $data['blog']->settings['bshortname'], TRUE);
+               $this->setBlogOption(intval($data['blog']->blogid), 'customurl_bname', $data['blog']->settings['bshortname']);
+       }
+
+       function event_PostAddCategory ($data)
+       {
+               global $CONF;
+               if (!$data['blog']->blogid) {
+                       $query = 'SELECT cblog as result FROM %s WHERE catid = %d';
+                       $bid = quickQuery(sprintf($query, sql_table('category'), intval($data['catid'])));
+               } else {
+                       $bid = $data['blog']->blogid;
+               }
+               if (!$data['name']) {
+                       $query = 'SELECT cname as result FROM %s WHERE catid = %d';
+                       $name = quickQuery(sprintf($query, sql_table('category'), intval($data['catid'])));
+               } else {
+                       $name = $data['name'];
+               }
+               $this->RegistPath(intval($data['catid']), $this->getOption('customurl_dfcat').'_'.$data['catid'], intval($bid), 'category', $name, TRUE);
+               $this->setCategoryOption(intval($data['catid']), 'customurl_cname', $CONF['CategoryKey'].'_'.$data['catid']);
+       }
+
+       function event_PostAddItem ($data)
+       {
+               $tpath = requestVar('plug_custom_url_path');
+               $tque = 'SELECT itime as result FROM %s WHERE inumber = %d';
+               $itime = quickQuery( sprintf($tque ,sql_table('item'), intval($data['itemid']) ) );
+//             $itimestamp = strtotime($itime);
+//             $tt = explode(',', date('Y,m,d', $itimestamp));
+               $y = $m = $d = $temp = '';
+               sscanf($itime, '"%d-%d-%d %s"', $y, $m, $d, $temp);
+               $ipath = TEMPLATE::fill($tpath, array ('year' => $y, 'month' => $m, 'day' => $d));
+               $query = 'SELECT ititle as result FROM %s WHERE inumber = %d';
+               $iname = quickQuery(sprintf($query, sql_table('item'), intval($data['itemid'])));
+               $this->RegistPath(intval($data['itemid']), $ipath, intval(getBlogIDFromItemID(intval($data['itemid']))), 'item', $iname, TRUE);
+       }
+
+       function event_PostRegister ($data)
+       {
+               $this->RegistPath(intval($data['member']->id), $data['member']->displayname, 0, 'member', $data['member']->displayname, TRUE);
+               $this->setMemberOption(intval($data['member']->id), 'customurl_mname', $data['member']->displayname);
+       }
+
+       function event_AddItemFormExtras(&$data)
+       {
+               $this->createItemForm();
+       }
+
+       function event_EditItemFormExtras(&$data)
+       {
+               $this->createItemForm(intval($data['itemid']));
+       }
+
+       function event_PostUpdateItem($data)
+       {
+               $tpath = requestVar('plug_custom_url_path');
+               $tque = 'SELECT itime as result FROM %s WHERE inumber = %d';
+               $itime = quickQuery( sprintf($tque ,sql_table('item'), intval($data['itemid']) ) );
+//             $itimestamp = strtotime($itime);
+//             $tt = explode(',', date('Y,m,d', $itimestamp));
+               $y = $m = $d = $temp = '';
+               sscanf($itime, '"%d-%d-%d %s"', $y, $m, $d, $temp);
+               $ipath = TEMPLATE::fill($tpath, array ('year' => $y, 'month' => $m, 'day' => $d));
+               $query = 'SELECT ititle as result FROM %s WHERE inumber = %d';
+               $iname = quickQuery(sprintf($query, sql_table('item'), intval($data['itemid'])));
+               $this->RegistPath(intval($data['itemid']), $ipath, intval(getBlogIDFromItemID(intval($data['itemid']))), 'item', $iname);
+       }
+
+       function createItemForm($item_id = 0)
+       {
+               global $CONF;
+               if ($item_id) {
+                       $query = 'SELECT obj_name as result FROM %s WHERE obj_param = "item" AND obj_id = %d';
+                       $res = quickQuery(sprintf($query, _CUSTOMURL_TABLE, intval($item_id)));
+                       $ipath = substr($res, 0, strlen($res)-5);
+               } else {
+                       $ipath = $this->getOption('customurl_dfitem');
+               }
+               echo <<<OUTPUT
+<h3>Custom URL</h3>
+<p>
+<label for="plug_custom_url">Custom Path:</label>
+<input id="plug_custom_url" name="plug_custom_url_path" value="{$ipath}" />
+</p>
+OUTPUT;
+       }
+
+       function event_PrePluginOptionsUpdate($data)
+       {
+               $blog_option = ($data['optionname'] == 'customurl_bname');
+               $cate_option = ($data['optionname'] == 'customurl_cname');
+               $memb_option = ($data['optionname'] == 'customurl_mname');
+               $arch_option = ($data['optionname'] == 'customurl_archive');
+               $arvs_option = ($data['optionname'] == 'customurl_archives');
+               $memd_option = ($data['optionname'] == 'customurl_member');
+               if ($blog_option || $cate_option || $memb_option) {
+                       if ($data['context'] == 'member' ) {
+                               $blogid = 0;
+                               $query = 'SELECT mname as result FROM %s WHERE mnumber = %d';
+                               $name = quickQuery(sprintf($query, sql_table('member'), intval($data['contextid'])));
+                       } elseif ($data['context'] == 'category') {
+                               $blogid = getBlogIDFromCatID(intval($data['contextid']));
+                               $query = 'SELECT cname as result FROM %s WHERE catid = %d';
+                               $name = quickQuery(sprintf($query, sql_table('category'), intval($data['contextid'])));
+                       } else {
+                               $blogid = 0;
+                               $query = 'SELECT bname as result FROM %s WHERE bnumber = %d';
+                               $name = quickQuery(sprintf($query, sql_table('blog'), intval($data['contextid'])));
+                       }
+                       $msg = $this->RegistPath(intval($data['contextid']), $data['value'], intval($blogid), $data['context'], $name);
+                       if ($msg) {
+                               $this->error($msg);
+                               exit;
+                       }
+               } elseif ($arch_option || $arvs_option || $memd_option) {
+                       if (!ereg("^[-_a-zA-Z0-9]+$", $data['value'])) {
+                               $name = substr($data['optionname'], 8);
+                               $msg = array (1, _INVALID_ERROR, $name, _INVALID_MSG);
+                               $this->error($msg);
+                               exit;
+                       } else {
+                               return;
+                       }
+               }
+               return;
+       }
+
+       function event_PostMoveItem($data)
+       {
+               $query = 'UPDATE %s SET obj_bid = %d WHERE obj_param = "%s" AND obj_id = %d';
+               sql_query(sprintf($query, _CUSTOMURL_TABLE, intval($data['destblogid']), 'item', intval($data['itemid'])));
+       }
+
+       function event_PostMoveCategory($data)
+       {
+               $query = 'UPDATE %s SET obj_bid = %d WHERE obj_param = "%s" AND obj_id = %d';
+               sql_query(sprintf($query, _CUSTOMURL_TABLE, intval($data['destblog']->blogid), 'category', intval($data['catid'])));
+       }
+
+       function RegistPath($objID, $path, $bid, $oParam, $name, $new = FALSE )
+       {
+               global $CONF;
+               switch($oParam) {
+                       case 'item':
+                       case 'member':
+                               if (preg_match('/.html$/', $path))
+                                       $path = substr($path, 0, -5);
+                       break;
+                       case 'blog':
+                       case 'category':
+                       case 'subcategory':
+                               break;
+                       default :
+                               return;
+                               break;
+               }
+               $bid = intval($bid);
+               $objID = intval($objID);
+               $name = rawurlencode($name);
+
+               if ($new && $oParam == 'item') {
+                       $tque = 'SELECT itime as result FROM %s WHERE inumber = %d';
+                       $itime = quickQuery( sprintf($tque ,sql_table('item'), intval($objID) ) );
+//                     $itimestamp = strtotime($itime);
+//                     $tt = explode(',', date('Y,m,d', $itimestamp));
+                       $y = $m = $d = $temp = '';
+                       sscanf($itime, '"%d-%d-%d %s"', $y, $m, $d, $temp);
+                       $ikey = TEMPLATE::fill($this->getOption('customurl_dfitem'), array ('year' => $y, 'month' => $m, 'day' => $d));
+                               if ($path == $ikey) {
+                                       $path = $ikey . '_' . $objID;
+                               }
+               } elseif (!$new && strlen($path) == 0) {
+                       $del_que = 'DELETE FROM %s WHERE obj_id = %d AND obj_param = "%s"';
+                       sql_query(sprintf($del_que, _CUSTOMURL_TABLE, intval($objID), $oParam));
+                       $msg = array (0, _DELETE_PATH, $name, _DELETE_MSG);
+                       return $msg;
+                       exit;
+               }
+
+               $dotslash = array ('.', '/');
+               $path = str_replace ($dotslash, '_', $path);
+               if (!ereg("^[-_a-zA-Z0-9]+$", $path)) {
+                       $msg = array (1, _INVALID_ERROR, $name, _INVALID_MSG);
+                       return $msg;
+                       exit;
+               }
+
+               $tempPath = $path;
+               if ($oParam == 'item' || $oParam == 'member') $tempPath .= '.html';
+               $conf_que = 'SELECT obj_id FROM %s WHERE obj_name = "%s" AND obj_bid = %d AND obj_param = "%s" AND obj_id != %d';
+               $res = sql_query(sprintf($conf_que, _CUSTOMURL_TABLE, $tempPath, $bid, $oParam, $objID));
+               if ($res && mysql_num_rows($res)) {
+                       $msg = array (0, _CONFLICT_ERROR, $name, _CONFLICT_MSG);
+                       $path .= '_'.$objID;
+               }
+               if ($oParam == 'category' && !$msg) {
+                       $conf_cat = 'SELECT obj_id FROM %s WHERE obj_name = "%s" AND obj_param = "blog"';
+                       $res = sql_query(sprintf($conf_cat, _CUSTOMURL_TABLE, $tempPath));
+                       if ($res && mysql_num_rows($res)) {
+                               $msg = array (0, _CONFLICT_ERROR, $name, _CONFLICT_MSG);
+                               $path .= '_'.$objID;
+                       }
+               }
+               if ($oParam == 'blog' && !$msg) {
+                       $conf_blg = 'SELECT obj_id FROM %s WHERE obj_name = "%s" AND obj_param = "category"';
+                       $res = sql_query(sprintf($conf_blg, _CUSTOMURL_TABLE, $tempPath));
+                       if ($res && mysql_num_rows($res)) {
+                               $msg = array (0, _CONFLICT_ERROR, $name, _CONFLICT_MSG);
+                               $path .= '_'.$objID;
+                       }
+               }
+
+               $newPath = $path;
+               if ($oParam == 'item' || $oParam == 'member') $newPath .= '.html';
+               $query = 'SELECT * FROM %s WHERE obj_id = %d AND obj_param = "%s"';
+               $res = sql_query(sprintf($query, _CUSTOMURL_TABLE, $objID, $oParam));
+               $row = mysql_fetch_object($res);
+               $pathID = $row->id;
+               if ($pathID) {
+                       $query = 'UPDATE %s SET obj_name = "%s" WHERE id = %d';
+                       sql_query(sprintf($query, _CUSTOMURL_TABLE, $newPath, $pathID));
+               } else {
+                       $query = 'INSERT INTO %s (obj_param, obj_name, obj_id, obj_bid) VALUES ("%s", "%s", %d, %d)';
+                       sql_query(sprintf($query, _CUSTOMURL_TABLE, $oParam, $newPath, $objID, $bid));
+               }
+               switch($oParam) {
+                       case 'blog':
+                               $this->setBlogOption($objID, 'customurl_bname', $path);
+                       break;
+                       case 'category':
+                               $this->setCategoryOption($objID, 'customurl_cname', $path);
+                       break;
+                       case 'member':
+                               $this->setMemberOption($objID, 'customurl_mname', $path);
+                       break;
+                       default :
+                       break;
+               }
+               return $msg;
+       }
+
+       function error($msg = '')
+       {
+               global $admin;
+
+               $admin->pagehead();
+               echo $msg[1].' : '.$msg[2].'<br />';
+               echo $msg[3].'<br />';
+               echo '<a href="index.php" onclick="history.back()">'._BACK.'</a>';
+               $admin->pagefoot();
+               return;
+       }
+
+       function quote_smart($value)
+       {
+               if (get_magic_quotes_gpc()) $value = stripslashes($value);
+               if (!is_numeric($value)) {
+                       $value = mysql_real_escape_string($value);
+               } elseif (is_numeric($value)) {
+                       $value = intval($value);
+               }
+               return $value;
+       }
+}
+?>
diff --git a/trunk/NP_CustomURL/customurl/default_help.html b/trunk/NP_CustomURL/customurl/default_help.html
new file mode 100644 (file)
index 0000000..bf13243
--- /dev/null
@@ -0,0 +1,170 @@
+<h3>Outline of plug-in</h3>
+
+<p>
+
+It is a plug-in that replaces dynamic URL generated with NucleusCMS with static URL of a free name.<br />
+<em style="color:#cc0000;">Operation only in FancyURL mode and required 'mod-rewrite'.</em><br />
+Categories, the Sub-Categories, Archive list, etc. are considered to be a directory respectively.When narrowing it by the category, it becomes an image that refers to the index file that exists in the directory of a category concerned.<br />
+<ul style="margin:0 0 25px 12px;">ex.
+<li>Image of access to Categories:
+<ul><li>http://example.jp/nucleuscms/</li></ul></li>
+<li>Image of access to Sub-Categories:
+<ul><li>http://example.jp/nucleuscms/plugins/</li></ul></li>
+<li>Image of access to Archives:
+<ul><li>http://example.jp/archives/</li><li>http://example.jp/archives/nucleuscms/</li></ul></li>
+</ul>
+Member's detailed page and individual item page become images accessed a file concerned html file.<br />
+<ul style="margin:0 0 25px 12px;">ex.
+<li>http://example.jp/nucleuscms/plugins/NP_CustomURL.html</li>
+<li>http://example.jp/new_nucleus_comming_soon.html</li>
+<li>http://example.jp/member/Hiroyuki.html</li>
+</ul>
+
+</p>
+
+<h3>Installation and operation beginning procedure</h3>
+
+<p>
+
+<ol style="margin:0 0 25px 12px;">
+<li>After up-loading the "NP_CustomURL.php" file and the "customurl" directory that can be done by developing the downloaded compression file to the "plugins" directory of the server.It installs it from the management area.</li>
+<li>First of all, "URL mode" is changed to "Fancy" on "Global setting" page of the management screen.</li>
+<li>"fancyurls.config.php" is copied to a top directory according to the procedure of FancyURLs and it edits it.<br />At this time, copying it should not copy the following file with "fancyurls.config.php" file alone.</li>
+<li>Next, "index.php" is edited."<code>$CONF['Self']</code>" and the line that is are rewritten as "<code>$CONF['Self'] = '.'</code>" and One line is written "<code>$curl_blogid = 1;</code>" and it adds. ("1" is ID of Brog accessed by "index.php".)
+<blockquote><pre style="overflow:auto;">&lt;?php
+// This file will generate and return the main page of the site
+$CONF = array();
+$CONF['Self'] = '.';
+$curl_blogid = 1;
+
+include('./config.php');
+include('./fancyurls.config.php');
+
+selector();
+
+?&gt;
+</pre></blockquote>
+</li>
+<li>Next, <code>.htaccess</code> is edited.<ul>
+    <li>The content is here.<blockquote><pre style="overflow:auto;">RewriteEngine on
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^(.*)$ index.php?curl=$1 [L,QSA]
+</pre></blockquote>
+Even if nothing is written now by these four lines alone, it is safe.</li></ul></li>
+</ol>
+It is preparation completion by this.<br />
+<br />
+Note:Please delete or save operation in another directory the file for FancyURLs with FancyURLs now.It is not necessary because everything has been received by this plug-in.<br />
+</p>
+
+<h3>How to use.</h3>
+
+<p>
+
+<ul>
+<li style="margin-top:3px;">The option is additional to Brog item category member's edit page respectively, and apply a favorite name, please.</li>
+<li style="margin-top:3px;">These edit displays do not go out when new addition of the member and new addition of the category on a "setting of Brog" page, and edit it respectively, please after it adds it.</li>
+<li style="margin-top:3px;">The name of the default when newly adding it,Blog as [shortname],Categories as [category_(catid)],Sub-Categories as [subcategory_(scatid)],Item as [item_(itemid)],Member as [login-name].<br />
+       Path has been generated to all the subBrog item category category members who existed in Brog when the plug-in is installed with the automatic operation.</li>
+<li style="margin-top:3px;">The name in the same key in Brog the same cannot overlap and take care, please.<br />
+       When path that tried to be registered overlaps, each ID is added in the form of '_ id'.<br />
+       Even if it is same Brog, the category, the subcategory, and the item can apply the same name.<br />
+       In a word, "http://example.jp/nucleuscms/nucleuscms/nucleuscms.html" becomes effective path.</li>
+<li style="margin-top:3px;">".html" is automatically added to path of the member and the item.</li>
+<li style="margin-top:3px;">"Member directory", "Archive directory", and "Archive list directory" are revokable in the edit display of the plug-in.An initial value is a value of each "<code>$CONF['***Key']</code>".</li>
+<li style="margin-top:3px;">The character that can be used as a directory name and a file name is only a-z,A-Z,0-9,-,_.<br />
+       "/" and "." included in the specified character string are automatically converted into "_".<br />
+       When URL is generated, capital letters and small letters of the alphabet are distinguished.However, when accessing it, it doesn't distinguish.</li>
+<li style="margin-top:3px;">The directory name for the Sub-Categories can be edited only on the management screen now.<br />
+       The data base has been updated about the subcategory newly added in the timing of the link generation.</li>
+<li style="margin-top:3px;">When the directory name is made a blank by the management screen and the edit display, the name is deleted from the data base, and URL becomes past FancyURLs.</li>
+<li style="margin-top:3px;">The same name cannot be applied to path for Brog and path for the category.</li>
+<li style="margin-top:3px;">The access with URL is possible even after this plug-in is installed so far.</li>
+<li style="margin-top:3px;">It can be selected whether to change URI of each Brog by the option.</li>
+</ul>
+
+</P>
+
+<h3>Skin/Template variable</h3>
+
+<p>
+It is possible to fill it in skin, the template, and in the article.<br />
+Useage:<code>&lt;%CustomURL(link ahead, link text, title text)%&gt;</code><br />
+<ul>
+<li>link ahead:kind link ahead/id or name/specified type
+       <ul>
+               <li>Paragraph 1:One of i, c, s, b, and m.Each initial of item, category, subcategory, blog, and member.</li>
+               <li>Paragraph 2:Id or name link ahead.The name is not a path name but is "Category name" and "Shortname of Brog", etc.When the item is selected the link ahead, specifying it for here becomes only id.</li>
+               <li>Paragraph 3:"i" and filling in when id, "n" and filling in when name is specified by paragraph 2.</li>
+       </ul>
+</li>
+<li>link text:Character string placed between a tag.Only URL is generated when omitted.</li>
+<li>title text:It is set to the "title" attribute of a tag.If the link text exists, it is set to the change when omitted.Even if only the title is specified without specifying the link text, the link tag is not generated.</li>
+<li>It can be written &lt:%CustomURL%&gt; by omitting all parameters.In this case, URI of default is written by the filling in place.
+       <ul>
+               <li>skin:URI to the top page of present "Brog" is written.</li>
+               <li>template:URI to the written item is written.(Replacement of &lt;%itemlink%&gt;)</li>
+               <li>article:URI to oneself is written.</li>
+       </ul>
+</li>
+</ul>
+Filling in example:
+<ul>
+       <li>When id links with the item of 123:&lt;a href="&lt;%CustomURL(i/123/i)%&gt;"&gt;'Here is freely written.'&lt;/a&gt;<br />
+       Written character string:&lt;a href="http://blog.example.jp/item_123.html"&gt;'Here is freely written.'&lt;/a&gt;</li>
+       <li>When the category name writes URI of the category of "Diary":&lt;%CustomURL(c/Diary/n)%&gt;<br />
+       Written character string(When id of "Diary" category is 12)\81Fhttp://blog.example.jp/category_12/</li>
+       <li>When you set the link of Brog to shortening name "bibouroku" to the link from the character string "This Brog":&lt;%CustomURL(c/bibouroku/n, This Blog)%&gt;<br />
+       Written character string:&lt;a href="http://blog.example.jp/"&gt;This Blog&lt;/a&gt;</li>
+</ul>
+When only id is filled in like skin template article both "&lt;%CustomURL(123)%&gt;", URI to the item with the id is written.<br />
+Moreover, passing set to the item with the id like item_123 can be written by writing "&lt;%CustomURL(123/path)%&gt;" only for the item.<br />
+</p>
+
+<h3>Operation report and bug report</h3>
+
+<p>...following URL.. I hope the comment or the track back the operation report and bug report.<br />
+<a href="http://shizuki.kinezumi.net/NucleusCMS/Plugins/NP_CustomURL/NP_CustomURL.html">
+http://shizuki.kinezumi.net/NucleusCMS/Plugins/NP_CustomURL/NP_CustomURL.html</a></p>
+
+<h3>Version history</h3>
+
+<ul>
+<li>Version 0.2.1:
+       <ul>
+       <li>Making of Sub-Categories multistep URL</li>
+       <li>Trouble not to be able to delete the data of the subcategory when the category and Brog are deleted is corrected.</li>
+       <li>Other correction.</li>
+       </ul>
+</li>
+<li>Version 0.1.9:
+       <ul>
+       <li>It corresponds to the movement between Brog of the category and the item.</li>
+       </ul>
+</li>
+<li>Version 0.1.8a:
+       <ul>
+       <li>Correction according to timing change in passing registration of new Sub-Categories.</li>
+       <li>To select whether to use customized URI of each Brog, the option is added.</li>
+       <li>Correction of Help file.</li>
+       </ul>
+</li>
+<li>Version 0.1.8:
+       <ul>
+       <li>It corresponds to trouble that URI to 'General' category made by the automatic operation when Brog is newly made doesn't operate normally.</li>
+       <li>It corresponds to trouble that URI of "Category", "Subcategory", and "Item" that belongs to deleted Brog remained in the table when Brog is deleted.</li>
+       <li>When the link is generated, the timing of the registration of passing of new Sub-Category is changed.(When URI has been set on the management screen before the link is generated, set URI is used.)</li>
+       <li>It is corrected that item URI was not normally displayed on the management page.</li>
+       </ul>
+</li>
+<li>Version 0.1.7:
+       <ul>
+       <li>It rewrites it almost completely.</li>
+       <li>When the track back is transmitted when a new item is added, trouble not to be able to transmit URL in the track back origin correctly is corrected.</li>
+       <li>When passing the subcategory is edited from the management screen, trouble to which the list is not displayed is corrected.</li>
+       </ul>
+</li>
+<li>Version 0.1.5: Version of opening to the public.</li>
+<li>Version 0.01: First version(Remodeling version of NP_Path)</li>
+</ul>
diff --git a/trunk/NP_CustomURL/customurl/help.html b/trunk/NP_CustomURL/customurl/help.html
new file mode 100644 (file)
index 0000000..0506b04
--- /dev/null
@@ -0,0 +1 @@
+<script language="JavaScript" src="./plugins/customurl/help.php"></script>
\ No newline at end of file
diff --git a/trunk/NP_CustomURL/customurl/help.php b/trunk/NP_CustomURL/customurl/help.php
new file mode 100644 (file)
index 0000000..b684ad6
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+       include('../../../config.php');
+       $language = ereg_replace( '[\\|/]', '', getLanguageName());
+       $url = './'.$language.'_help.html';
+       if(file_exists($url)){
+               $message=file($url);
+       }
+       else{
+               $message=file('./default_help.html');
+       }
+       $linenumber=sizeof($message);
+       $i=0;
+       while($i<$linenumber){
+               $message[$i] = trim($message[$i], "\n\0\r");
+               $message[$i] = mb_ereg_replace("'", "\\'", $message[$i]);
+               $message[$i] = mb_ereg_replace('&', '\\&', $message[$i]);
+               $message[$i] = mb_ereg_replace('"', '\\"', $message[$i]);
+               $message[$i] = mb_ereg_replace('/', '\\/', $message[$i]);
+               $message[$i] = mb_ereg_replace('    ', '\\&nbsp;\\&nbsp;\\&nbsp;\\&nbsp;', $message[$i]);
+               print ("document.write('{$message[$i]}\\n');");
+               $i++;
+       }
+?>
\ No newline at end of file
diff --git a/trunk/NP_CustomURL/customurl/index.php b/trunk/NP_CustomURL/customurl/index.php
new file mode 100644 (file)
index 0000000..dcb5142
--- /dev/null
@@ -0,0 +1,346 @@
+<?php
+//
+//     URL configuration plugin "NP_CustomURL" ADMIN page
+//
+
+       // if your 'plugin' directory is not in the default location,
+       // edit this variable to point to your site directory
+       // (where config.php is)
+       $strRel = '../../../';
+
+       include($strRel . 'config.php');
+       include($DIR_LIBS . 'PLUGINADMIN.php');
+
+       // create the admin area page
+       $oPluginAdmin = new PluginAdmin('CustomURL');
+
+       $language = ereg_replace( '[\\|/]', '', getLanguageName());
+       if (file_exists($oPluginAdmin->plugin->getDirectory().'language/'.$language.'.php')) {
+               include_once($oPluginAdmin->plugin->getDirectory().'language/'.$language.'.php');
+       }else {
+               include_once($oPluginAdmin->plugin->getDirectory().'language/english.php');
+       }
+
+       if (!($member->isLoggedIn() && $member->isAdmin())) {
+               ACTIONLOG::add(WARNING, _ACTIONLOG_DISALLOWED . $HTTP_SERVER_VARS['REQUEST_URI']);
+               $myAdmin->error(_ERROR_DISALLOWED);
+       }
+
+class CustomURL_ADMIN
+{
+
+       function CustomURL_ADMIN()
+       {
+               global $manager, $CONF, $oPluginAdmin;
+
+               $this->plugin =& $oPluginAdmin->plugin;
+               $this->name = $this->plugin->getName();
+               $this->adminurl = $this->plugin->getAdminURL();
+               $this->editurl = $CONF['adminURL'];
+               $this->table = sql_table('plug_customurl');
+               $this->uScat = ($manager->pluginInstalled('NP_MultipleCategories') == TRUE);
+               if ($manager->pluginInstalled('NP_MultipleCategories')) {
+                       $mplugin =& $manager->getPlugin('NP_MultipleCategories');
+                       if (method_exists($mplugin,"getRequestName")) {
+                               $this->mcadmin = $mplugin->getAdminURL();
+                               global $subcatid;
+                       }
+               }
+
+       }
+
+       function action($action)
+       {
+               $methodName = 'action_'.$action;
+               if (method_exists($this, $methodName)) {
+                       call_user_func(array(&$this, $methodName));
+               } else {
+                       $this->error(_BADACTION . " ($action)");
+               }
+       }
+
+       function disallow()
+       {
+               global $HTTP_SERVER_VARS;
+
+               ACTIONLOG::add(WARNING, _ACTIONLOG_DISALLOWED . $HTTP_SERVER_VARS['REQUEST_URI']);
+               $msg = array (0, _ERROR_DISALLOWED, '***', _DISALLOWED_MSG);
+               $this->error($msg);
+       }
+
+       function error($msg = '')
+       {
+               global $oPluginAdmin;
+
+               $oPluginAdmin->start();
+               echo $msg[1].'name : '.$msg[2].'<br />';
+               echo $msg[3].'<br />';
+               echo '<a href="'.$this->adminurl.'index.php" onclick="history.back()">'._BACK.'</a>';
+               $oPluginAdmin->end();
+               exit;
+       }
+
+       function action_blogview($msg = '')
+       {
+               global $CONF, $oPluginAdmin;
+
+               $oPluginAdmin->start();
+               echo '<h2><a id="pagetop">'._ADMIN_AREA_TITLE.'</a></h2>';
+               echo '<ul style="list-style:none;"><li><a href="'.$this->editurl.'index.php?action=pluginoptions&amp;plugid='.$this->plugin->getID().'">'._OPTION_SETTING.'</a></li>';
+               echo '<li><a href="'.$this->adminurl.'index.php?action=memberview">'._FOR_MEMBER_SETTING.'</a></li></ul>';
+               echo '<p>'.$msg;
+               $this->print_tablehead(_BLOG_LIST_TITLE, _LISTS_ACTIONS);
+               $res = sql_query(sprintf('SELECT %s,%s,%s FROM %s', bname, bnumber, bshortname, sql_table('blog')));
+               while ($b = mysql_fetch_object($res)) {
+               $forCatURI = $this->adminurl.'index.php?action=goCategory&amp;blogid='.$b->bnumber;
+               $forItemURI = $this->adminurl.'index.php?action=goItem&amp;blogid='.$b->bnumber;
+               $data = array (
+                               'oid'                   =>      $b->bnumber,
+                               'obd'                   =>      0,
+                               'opr'                   =>      'blog',
+                               'name'                  =>      $b->bname,
+                               'ret'                   =>      'blogview',
+                               'ed_URL'                =>      $this->edhiturl.'index.php?action=blogsettings&blogid='.$b->bnumber,
+                               'desc'                  =>      '[<a href="'.$forItemURI.'" style="font-size:x-small;">'._FOR_ITEMS_SETTING.'</a>]&nbsp;
+                               [<a href="'.$forCatURI.'" style="font-size:x-small;">'._FOR_CATEGORY_SETTING.'</a>]',
+                               'path'                  =>      $this->plugin->getBlogOption($b->bnumber, 'customurl_bname'),
+                               'setting_text'  =>      _BLOG_SETTING
+                               );
+               $this->print_tablerow($data);
+               }
+                       echo '</tbody></table>';
+               echo '</p>';
+               $oPluginAdmin->end();
+       }
+
+       function action_categoryview($bid, $msg = '')
+       {
+               global $CONF, $oPluginAdmin;
+               $bname = getBlognameFromID($bid);
+
+               $oPluginAdmin->start();
+               echo '<h2><a id="pagetop">'._ADMIN_AREA_TITLE.'</a></h2>';
+               echo '<ul style="list-style:none;"><li><a href="'.$this->editurl.'index.php?action=pluginoptions&amp;plugid='.$this->plugin->getID().'">'._OPTION_SETTING.'</a></li>';
+               echo '<li><a href="'.$this->adminurl.'index.php?action=blogview">'._FOR_BLOG_SETTING.'</a></li>';
+               echo '<li><a href="'.$this->adminurl.'index.php?action=goItem&amp;blogid='.$bid.'">'._FOR_ITEMS_SETTING.'</a></li>';
+               echo '<li><a href="'.$this->adminurl.'index.php?action=memberview">'._FOR_MEMBER_SETTING.'</a></li></ul>';
+               echo '<p>'.$msg;
+                       echo '<h3 style="padding-left: 0px">'.$bname.'</h3>';
+                       $this->print_tablehead(_LISTS_CAT_NAME, _LISTS_DESC);
+                       $cnm = sql_query(sprintf('SELECT catid, cname, cdesc FROM %s WHERE cblog = %d', sql_table('category'), $bid));
+                       while ($c = mysql_fetch_object($cnm)) {
+                               $data = array (
+                                               'oid'           =>      $c->catid,
+                                               'obd'           =>      $bid,
+                                               'opr'           =>      'category',
+                                               'name'          =>      $c->cname,
+                                               'ret'           =>      'catoverview',
+                                               'ed_URL'        =>      $this->edhiturl.'index.php?action=categoryedit&blogid='.$bid.'&catid='.$c->catid,
+                                               'desc'          =>      $c->cdesc,
+                                               'path'          =>      $this->plugin->getCategoryOption($c->catid, 'customurl_cname')
+                                               );
+                               $this->print_tablerow($data);
+                               if ($this->uScat) {
+                                       $scnm = sql_query(sprintf('SELECT scatid, sname, sdesc FROM %s WHERE catid = %d', sql_table('plug_multiple_categories_sub'), $c->catid));
+                                       while ($sc = mysql_fetch_object($scnm)) {
+                                               $scpt = sql_query(sprintf('SELECT obj_name FROM %s WHERE obj_param = "subcategory" AND obj_bid = %d AND obj_id = %d', $this->table, $c->catid, $sc->scatid));
+                                               $scp = mysql_fetch_object($scpt);
+                                               $data = array (
+                                                               'oid'           =>      $sc->scatid,
+                                                               'obd'           =>      $c->catid,
+                                                               'opr'           =>      'subcategory',
+                                                               'name'          =>      '&raquo;'.$sc->sname,
+                                                               'ret'           =>      'catoverview',
+                                                               'ed_URL'        =>      $this->mcadmin.'index.php?action=scatedit&catid='.$c->catid.'&scatid='.$sc->scatid,
+                                                               'desc'          =>      $sc->sdesc,
+                                                               'path'          =>      $scp->obj_name
+                                                               );
+                                               $this->print_tablerow($data);
+                                       }
+                               }
+                       }
+                       echo '</tbody></table>';
+                       echo '<a href="'.$this->adminurl.'index.php" onclick="history.back()">'._BACK.'</a>';
+               echo '</p>';
+               $oPluginAdmin->end();
+       }
+
+       function action_memberview($msg = '')
+       {
+               global $CONF, $oPluginAdmin;
+
+               $oPluginAdmin->start();
+               echo '<h2>'._ADMIN_AREA_TITLE.'</h2>';
+               echo '<ul style="list-style:none;"><li><a href="'.$this->editurl.'index.php?action=pluginoptions&amp;plugid='.$this->plugin->getID().'">'._OPTION_SETTING.'</a></li>';
+               echo '<li><a href="'.$this->adminurl.'index.php?action=blogview">'._FOR_BLOG_SETTING.'</a></li></ul>';
+               echo '<p>'.$msg;
+               $this->print_tablehead(_LOGIN_NAME, _MEMBERS_REALNAME);
+               $res = sql_query(sprintf('SELECT %s,%s,%s FROM %s', mname, mnumber, mrealname, sql_table('member')));
+               while ($m = mysql_fetch_object($res)) {
+                       $data = array (
+                                       'oid'           =>      $m->mnumber,
+                                       'obd'           =>      0,
+                                       'opr'           =>      'member',
+                                       'name'          =>      $m->mname,
+                                       'ret'           =>      'memberview',
+                                       'ed_URL'        =>      $this->edhiturl.'index.php?action=memberedit&memberid='.$m->mnumber,
+                                       'desc'          =>      $m->mrealname,
+                                       'path'          =>      $this->plugin->getMemberOption($m->mnumber, 'customurl_mname')
+                                       );
+                       $this->print_tablerow($data);
+               }
+               echo '</tbody></table></p>';
+               $oPluginAdmin->end();
+       }
+
+       function action_itemview($bid, $msg = '')
+       {
+               global $CONF, $oPluginAdmin;
+
+               $oPluginAdmin->start();
+               echo '<h2>'._ADMIN_AREA_TITLE.'</h2>';
+               echo '<ul style="list-style:none;"><li><a href="'.$this->editurl.'index.php?action=pluginoptions&amp;plugid='.$this->plugin->getID().'">'._OPTION_SETTING.'</a></li>';
+               echo '<li><a href="'.$this->adminurl.'index.php?action=blogview">'._FOR_BLOG_SETTING.'</a></li>';
+               echo '<li><a href="'.$this->adminurl.'index.php?action=goCategory&amp;blogid='.$bid.'">'._FOR_CATEGORY_SETTING.'</a></li>';
+               echo '<li><a href="'.$this->adminurl.'index.php?action=memberview">'._FOR_MEMBER_SETTING.'</a></li></ul>';
+               echo '<p><h3>'.$msg.'</h3>';
+               $this->print_tablehead(_LISTS_TITLE, _LISTS_ITEM_DESC);
+               $res = sql_query(sprintf('SELECT %s,%s,%s FROM %s WHERE iblog = %d ORDER BY itime DESC', ititle, inumber, ibody, sql_table('item'), $bid));
+               while ($i = mysql_fetch_object($res)) {
+                       $temp_res = quickQuery('SELECT obj_name as result FROM '.sql_table('plug_customurl').' WHERE obj_param = "item" AND obj_id = '.$i->inumber);
+                       $ipath = substr($temp_res, 0, (strlen($temp_res)-5));
+                       $data = array (
+                                       'oid'           =>      $i->inumber,
+                                       'obd'           =>      $bid,
+                                       'opr'           =>      'item',
+                                       'name'          =>      $i->ititle,
+                                       'ret'           =>      'itemview',
+                                       'ed_URL'        =>      $this->edhiturl.'index.php?action=itemedit&itemid='.$i->inumber,
+                                       'desc'          =>      mb_substr(strip_tags($i->ibody), 0, 80),
+//                                     'path'          =>      $this->plugin->getItemOption($i->inumber, 'customurl_iname')
+                                       'path'          =>      $ipath
+                                       );
+                       $this->print_tablerow($data);
+               }
+               echo '</tbody></table></p>';
+               $oPluginAdmin->end();
+       }
+
+       function print_tablehead($o_name, $o_desc)
+       {
+               global $oPluginAdmin;
+
+               $NAME = $o_name;
+               $DESC = $o_desc;
+               $PATH = _LISTS_PATH;
+               $ACTION = _LISTS_ACTIONS;
+echo <<< TABLE_HEAD
+       <table>
+               <thead>
+                       <tr>
+                               <th>{$NAME}</th>
+                               <th>{$DESC}</th>
+                               <th style="width:180px;">{$PATH}</th>
+                               <th style="width:80px;">{$ACTION}</th>
+                       </tr>
+               </thead>
+               <tbody>
+TABLE_HEAD;
+       }
+
+       function print_tablerow($data)
+       {
+               global $oPluginAdmin;
+
+               $updateText = _SETTINGS_UPDATE_BTN;
+               $edit = _EDIT;
+echo <<< TBODY
+                       <tr onmouseover="focusRow(this);" onmouseout="blurRow(this);">
+                               <form method="post" action="{$this->adminurl}index.php" />
+                               <input type="hidden" name="action" value="pathupdate" />
+                               <input type="hidden" name="oid" value="{$data['oid']}" />
+                               <input type="hidden" name="obd" value="{$data['obd']}" />
+                               <input type="hidden" name="opr" value="{$data['opr']}" />
+                               <input type="hidden" name="name" value="{$data['name']}" />
+                               <input type="hidden" name="ret" value="{$data['ret']}" />
+                               <td>{$data['name']}&nbsp;&nbsp;<a href="{$data['ed_URL']}" style="font-size:xx-small;">[{$edit}]</a></td>
+                               <td>{$data['desc']}</td>
+                               <td><input type="text" name="path" size="32" value="{$data['path']}"/></td>
+                               <td><input type="submit" name="update" value="{$updateText}" /></td>
+                               </form>
+                       </tr>
+TBODY;
+       }
+
+       function action_pathupdate()
+       {
+               global $oPluginAdmin;
+
+               $o_oid = RequestVar('oid');
+               $o_bid = RequestVar('obd');
+               $o_param = RequestVar('opr');
+               $o_name = RequestVar('name');
+               $newPath = RequestVar('path');
+               $action = RequestVar('ret');
+
+               $msg = $this->plugin->RegistPath($o_oid, $newPath, $o_bid, $o_param, $o_name);
+               if ($msg) {
+                       $this->error($msg);
+                       if ($msg[0] != 0) {
+                               return;
+                               exit;
+                       }
+               }
+               $mesage = _UPDATE_SUCCESS;
+               switch($action) {
+                       case 'catoverview':
+                               if ($o_param == 'subcategory') {
+                                       $bid = getBlogIDFromCatID($o_bid);
+                               } else {
+                                       $bid = $o_bid;
+                               }
+                               $this->action_categoryview($bid, _UPDATE_SUCCESS);
+                       break;
+                       case 'memberview':
+                               $this->action_memberview(_UPDATE_SUCCESS);
+                       break;
+                       case 'blogview':
+                               $this->action_blogview(_UPDATE_SUCCESS);
+                       break;
+                       case 'itemview':
+                               $this->action_itemview($o_bid, _UPDATE_SUCCESS);
+                       break;
+                       default:
+                               echo _UPDATE_SUCCESS;
+                       break;
+               }
+               return;
+       }
+
+       function action_goItem()
+       {
+               global $oPluginAdmin;
+
+               $bid = $_GET['blogid'];
+               $this->action_itemview($bid);
+       }
+
+       function action_goCategory()
+       {
+               global $oPluginAdmin;
+
+               $bid = $_GET['blogid'];
+               $this->action_categoryview($bid);
+       }
+
+}
+
+$myAdmin = new CustomURL_ADMIN();
+
+if (requestVar('action')) {
+       $myAdmin->action(requestVar('action'));
+} else {
+       $myAdmin->action('blogview');
+}
+
+?>
\ No newline at end of file
diff --git a/trunk/NP_CustomURL/customurl/japanese-euc_help.html b/trunk/NP_CustomURL/customurl/japanese-euc_help.html
new file mode 100644 (file)
index 0000000..d57d643
--- /dev/null
@@ -0,0 +1,260 @@
+<h3>¥×¥é¥°¥¤¥ó¤Î³µÍ×</h3>
+
+<p>
+
+NucleusCMS¤ÇºîÀ®¤·¤¿web¥µ¥¤¥È¤Î¥¢¥¤¥Æ¥à¡¦¥«¥Æ¥´¥ê¤Ë¹¥¤­¤Ê̾Á°¤ò¤Ä¤±¤Æ¡¢ÀÅŪURL¤È¤·¤Æ¥ê¥ó¥¯¤òÀ¸À®¤·¤Þ¤¹¡£<br />
+<em style="color:#cc0000;">FancyURL¥â¡¼¥É¤Ç¤Î¤ß¤ÎÆ°ºî¡¢µÚ¤Ómod_Rewriteɬ¿Ü¤Ç¤¹</em><br />
+¥«¥Æ¥´¥ê¡¢¥µ¥Ö¥«¥Æ¥´¥ê¡¢¥¢¡¼¥«¥¤¥Ö¥ê¥¹¥ÈÅù¤ò¡¢¤½¤ì¤¾¤ì¥Ç¥£¥ì¥¯¥È¥ê¤È¤ß¤Ê¤·¡¢¥«¥Æ¥´¥ê¤Ç¹Ê¤ê¹þ¤ó¤À»þ¤ÏÅö³º¥«¥Æ¥´¥ê¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ëindex¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥¤¥á¡¼¥¸¤Ë¤Ê¤ê¤Þ¤¹<br />
+<ul style="margin:0 0 25px 12px;">ex.
+<li>¥«¥Æ¥´¥ê¤Ø¤Î¥¢¥¯¥»¥¹¤Î¥¤¥á¡¼¥¸:
+<ul><li>http://example.jp/nucleuscms/</li></ul></li>
+<li>¥µ¥Ö¥«¥Æ¥´¥ê¤Ø¤Î¥¢¥¯¥»¥¹¤Î¥¤¥á¡¼¥¸:
+<ul><li>http://example.jp/nucleuscms/plugins/</li></ul></li>
+<li>¥¢¡¼¥«¥¤¥Ö¤Ø¤Î¥¢¥¯¥»¥¹¤Î¥¤¥á¡¼¥¸:
+<ul><li>http://example.jp/archives/</li><li>http://example.jp/archives/nucleuscms/</li></ul></li>
+</ul>
+¥á¥ó¥Ð¡¼¤Î¾ÜºÙ¥Ú¡¼¥¸¤È¸ÄÊÌ¥¢¥¤¥Æ¥à¥Ú¡¼¥¸¤Ï¡¢Åö³ºhtml¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤¹¤ë¥¤¥á¡¼¥¸¤Ë¤Ê¤ê¤Þ¤¹<br />
+<ul style="margin:0 0 25px 12px;">ex.
+<li>http://example.jp/nucleuscms/plugins/NP_CustomURL.html</li>
+<li>http://example.jp/new_nucleus_comming_soon.html</li>
+<li>http://example.jp/member/Hiroyuki.html</li>
+</ul>
+
+</p>
+
+<h3>¥¤¥ó¥¹¥È¡¼¥ë¡¦Æ°ºî³«»Ï¼ê½ç</h3>
+
+<p>
+
+<ol style="margin:0 0 25px 12px;">
+<li>¥À¥¦¥ó¥í¡¼¥É¤·¤¿¥Õ¥¡¥¤¥ë¤ò²òÅष¤Æ½ÐÍ褿¡ÖNP_CustomURL.php¡×¥Õ¥¡¥¤¥ë¤È¡Öcustomurl¡×¥Ç¥£¥ì¥¯¥È¥ê¤ò¥µ¡¼¥Ð¤Î plugins ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¢¥Ã¥×¥í¡¼¥É¸å¡¢¡Ö¥×¥é¥°¥¤¥ó¤Î´ÉÍý¡×¥Ú¡¼¥¸¤Ç¡ÖCustomURL¡×¤òÁªÂò¤·¤Æ¡Ö¥×¥é¥°¥¤¥ó¤Î¥¤¥ó¥¹¥È¡¼¥ë¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹<br />
+(¤³¤Îʸ¾Ï¤òÆɤó¤Ç¤¤¤ë¤È¤¤¤¦¤³¤È¤Ï¡¢¤³¤³¤Þ¤Ç¤Ï½ÐÍè¤Æ¤¤¤ë¤È»×¤¤¤Þ¤¹)</li>
+<li>¤Þ¤º»Ï¤á¤Ë¡¢´ÉÍý²èÌ̤Ρ֥°¥í¡¼¥Ð¥ëÀßÄê¡×¥Ú¡¼¥¸¤Ç¡ÖURL ¥â¡¼¥É¡×¤ò¡ÖFancy¡×¤ËÊѹ¹¤·¤Þ¤¹</li>
+<li>Ä̾ï¤Î¡Öextra¡×¥Ç¥£¥ì¥¯¥È¥ê¤Î¡Öfancyurls.config.php¡×¤ò¡¢FancyURLs¤Î¼ê½çÄ̤ê¥È¥Ã¥×¥Ç¥£¥ì¥¯¥È¥ê¤Ø¥³¥Ô¡¼¤·¤ÆÊÔ½¸¤·¤Þ¤¹<br />¤³¤Î¤È¤­¥³¥Ô¡¼¤¹¤ë¤Î¤Ï¡Öfancyurls.config.php¡×¥Õ¥¡¥¤¥ë¤À¤±¤Ç¡¢¸å¤Î¥Õ¥¡¥¤¥ë¤Ï¥³¥Ô¡¼¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤»¤ó</li>
+<li>¼¡¤Ë¡Öindex.php¡×¤òÊÔ½¸¤·¤Þ¤¹¤Î <code>$CONF['Self']</code> ¤Î¹Ô¤ò <code>$CONF['Self'] = '.'</code> ¤Ë½ñ¤­´¹¤¨¡¢ <code>$curl_blogid = 1;</code>("1"¤Ï¡Öindex.php¡×¤Ç¥¢¥¯¥»¥¹¤¹¤ë¥Ö¥í¥°¤ÎID) ¤È°ì¹Ô½ñ¤­²Ã¤¨¤Þ¤¹
+<blockquote><pre style="overflow:auto;">&lt;?php
+// This file will generate and return the main page of the site
+$CONF = array();
+$CONF['Self'] = '.';
+$curl_blogid = 1;
+
+include('./config.php');
+include('./fancyurls.config.php');
+
+selector();
+
+?&gt;
+</pre></blockquote>
+</li>
+<li>¼¡¤Ë<code>.htaccess</code>¤òÊÔ½¸¤·¤Þ¤¹<ul>
+    <li>ÆâÍƤϤ³¤Á¤é<blockquote><pre style="overflow:auto;">RewriteEngine on
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^(.*)$ index.php?curl=$1 [L,QSA]
+</pre></blockquote>
+¤³¤Î4¹Ô¤À¤±¤Ç¡¢¸å¤Ï²¿¤â½ñ¤«¤Ê¤¯¤Æ¤âÂç¾æÉפǤ¹</li></ul></li>
+</ol>
+¤³¤ì¤Ç½àÈ÷´°Î»¤Ç¤¹<br />
+<br />
+Ãí1¡§¸½ºß FancyURLs ¤Ç±¿ÍѤµ¤ì¤Æ¤¤¤ëÊý¤Ï¡¢Fancy ÍѤΥե¡¥¤¥ë¤òºï½ü¤¹¤ë¤«Ê̥ǥ£¥ì¥¯¥È¥ê¤ØÂàÈò¤·¤Æ¤¯¤À¤µ¤¤¡£¤¹¤Ù¤Æ¤³¤Î¥×¥é¥°¥¤¥ó¤Ç¼õ¤±¤Æ¤¤¤ë¤Î¤ÇɬÍפ¢¤ê¤Þ¤»¤ó<br />
+¤Þ¤¿¡¢²¼µ­¥×¥é¥°¥¤¥óÍѤÎFancy¥Õ¥¡¥¤¥ë¤ÏÁȤ߹þ¤ßºÑ¤ß¤Ç¤¹¤Î¤ÇÉÔÍפǤ¹
+<ul>
+<li>³Æ¥Ú¡¼¥¸¥¹¥¤¥Ã¥ÁÍÑ¡Öpage¡×¥Õ¥¡¥¤¥ë</li>
+<li>¥¿¥°ÍÑ¡Ötag¡×¥Õ¥¡¥¤¥ë(¡ÖNP_TagEX¡×¡ÖNP_MultiTags¡×ξÊýÂбþ¡£¡ÖNP_MultiTags¡×¤Î¡Ö¥¿¥°¥¯¥¨¥ê¡¼ ¡×¤ÎÊѹ¹¤Ë¤âÂбþ¤·¤Æ¤¤¤Þ¤¹)</li>
+<li>¡ÖNP_Trackback¡×¤Î¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¼õ¿®ÀìÍÑ¡Ötrackback¡×¥Õ¥¡¥¤¥ë</li>
+</ul>
+</p>
+
+<h3>»È¤¤Êý</h3>
+
+<p>
+
+<ul>
+<li style="margin-top:3px;">¥Ö¥í¥°¡¦¥¢¥¤¥Æ¥à¡¦¥«¥Æ¥´¥ê¡¦¥á¥ó¥Ð¡¼¤ÎÊÔ½¸¥Ú¡¼¥¸¤Ë¤½¤ì¤¾¤ì¥ª¥×¥·¥ç¥ó¤¬Äɲ䷤Ƥ¢¤ê¤Þ¤¹¤Î¤Ç¡¢¹¥¤­¤Ê̾Á°¤ò¤Ä¤±¤Æ¤¯¤À¤µ¤¤</li>
+<li style="margin-top:3px;">¥á¥ó¥Ð¡¼¤Î¿·µ¬Äɲá¢µÚ¤Ó¡Ö¥Ö¥í¥°¤ÎÀßÄê¤ÎÊÔ½¸¡×¥Ú¡¼¥¸¤«¤é¤Î¥«¥Æ¥´¥ê¤Î¿·µ¬Äɲäλþ¤Ë¤Ï¤³¤ì¤é¤ÎÊÔ½¸²èÌ̤¬½Ð¤Þ¤»¤ó¤Î¤Ç¡¢Äɲä·¤¿¤¢¤È¤Ë¤½¤ì¤¾¤ìÊÔ½¸¤·¤Æ¤¯¤À¤µ¤¤</li>
+<li style="margin-top:3px;">¿·µ¬Äɲûþ¤Î¥Ç¥Õ¥©¥ë¥È¤Î̾Á°¤Ï¡¢¥Ö¥í¥°¤Ï[¥·¥ç¡¼¥È¥Í¡¼¥à]¥«¥Æ¥´¥ê¡¼¤Ï[category_(catid)]¡¢¥¢¥¤¥Æ¥à¤Ï[item.html]¡¢¥á¥ó¥Ð¡¼¤Ï[¥í¥°¥¤¥ó¥Í¡¼¥à.html]¤¬¤½¤ì¤¾¤ìÀßÄꤵ¤ì¤Þ¤¹<br />
+       ¤Ê¤ª¡¢¥×¥é¥°¥¤¥ó¤Î¥¤¥ó¥¹¥È¡¼¥ë»þ¤Ë¥Ö¥í¥°¤Ë¸ºß¤·¤¿Á´¤Æ¤Î¥Ö¥í¥°¡¦¥¢¥¤¥Æ¥à¡¦¥«¥Æ¥´¥ê¡¦¥á¥ó¥Ð¡¼¤Ë¤Ï¼«Æ°¤Ç¥Ñ¥¹¤òÀ¸À®ºÑ¤ß¤Ç¤¹</li>
+<li style="margin-top:3px;">Ʊ°ì¥Ö¥í¥°Æ⡢Ʊ°ì¥­¡¼¤Ç¤Î̾Á°¤Ï½ÅÊ£¤Ç¤­¤Þ¤»¤ó¤Î¤Çµ¤¤ò¤Ä¤±¤Æ¤¯¤À¤µ¤¤<br />
+       ÅÐÏ¿¤·¤è¤¦¤È¤·¤¿¥Ñ¥¹¤¬½ÅÊ£¤·¤Æ¤¤¤¿¾ì¹ç¤Ï¡¢ËöÈø¤Ë¤½¤ì¤¾¤ì¤ÎID¤¬'_id'¤Î·Á¤ÇÄɲ䵤ì¤Þ¤¹<br />
+       Æ±°ì¥Ö¥í¥°¤Ç¤¢¤Ã¤Æ¤â¡¢¥«¥Æ¥´¥ê¡¼¤È¥µ¥Ö¥«¥Æ¥´¥ê¡¼¡¢¥¢¥¤¥Æ¥à¤ÏƱ¤¸Ì¾Á°¤ò¤Ä¤±¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹<br />
+       ¤Ä¤Þ¤ê¡¢http://example.jp/nucleuscms/nucleuscms/nucleuscms.html¤ÏÍ­¸ú¤Ê¥Ñ¥¹¤È¤Ê¤ê¤Þ¤¹</li>
+<li style="margin-top:3px;">¥á¥ó¥Ð¡¼¡¢µÚ¤Ó¥¢¥¤¥Æ¥à¤Î¥Ñ¥¹¤Ë¤Ï¡¢ËöÈø¤Ë¼«Æ°Åª¤Ë[.html]¤¬Éղ䵤ì¤ë¤Î¤Ç¡¢ÊÔ½¸»þ¤Ë[.html]¤ò¤Ä¤±¤Ê¤¤¤è¤¦¤Ëµ¤¤ò¤Ä¤±¤Æ¤¯¤À¤µ¤¤<br />
+       ¤¦¤Ã¤«¤êÉÕ¤±¤Æ¤·¤Þ¤¦¤È¡¢[item_html.html]¤È¤¤¤¦¤è¤¦¤Ê¡¢¤Ê¤ó¤À¤«¤è¤¯²ò¤é¤Ê¤¤¥Õ¥¡¥¤¥ë̾¤¬½ÐÍè¾å¤¬¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹</li>
+<li style="margin-top:3px;">¥á¥ó¥Ð¡¼¥Ç¥£¥ì¥¯¥È¥ê¡¢¥¢¡¼¥«¥¤¥Ö¥Ç¥£¥ì¥¯¥È¥ê¡¢¥¢¡¼¥«¥¤¥Ö¥ê¥¹¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ï¥×¥é¥°¥¤¥ó¤ÎÊÔ½¸²èÌ̤ÇÊѹ¹¤Ç¤­¤Þ¤¹¡£½é´üÃͤϤ½¤ì¤¾¤ì¤Î<code>$CONF['***Key']</code>¤ÎÃͤˤʤäƤ¤¤Þ¤¹</li>
+<li style="margin-top:3px;">¥Ç¥£¥ì¥¯¥È¥ê̾¡¢µÚ¤Ó¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ»ÈÍѤǤ­¤ëʸ»ú¤ÏȾ³Ñ±Ñ¿ô»ú(a-z,A-Z,0-9)¤ÈȾ³Ñ¥Ï¥¤¥Õ¥ó(-)¤ÈȾ³Ñ¥¢¥ó¥À¡¼¥Ð¡¼(_)¤Î¤ß¤Ç¤¹<br />
+       ¤Ê¤ª¡¢»ØÄꤵ¤ì¤¿Ê¸»úÎó¤ÎÃæ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë '/'(¥¹¥é¥Ã¥·¥å)¤ä'.'(¥Ô¥ê¥ª¥É)¤Ï¡¢¼«Æ°Åª¤Ë '_'(Ⱦ³Ñ¥¢¥ó¥À¡¼¥Ð¡¼)¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¤¬¡¢¤½¤ì°Ê³°¤Î¤È¤­¤Ï¥¨¥é¡¼¤òÊÖ¤·¤Þ¤¹<br />
+       URLÀ¸À®¤Î¤È¤­¤Ï¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤ÎÂçʸ»ú¾®Ê¸»ú¤Î¶èÊ̤Ϥ·¤Þ¤¹¤¬¡¢¥¢¥¯¥»¥¹¤Î¤È¤­¤ÏURL¤Î»ÈÍѾå¶èÊ̤Ǥ­¤Þ¤»¤ó<br />
+       Ä̾ï¤ÎHTML¥ê¥ó¥¯Æ±ÍÍ¡¢ http://example.jp/NucleusCMS/ ¤Èɽ¼¨¤·¤Æ¤¢¤ë¥ê¥ó¥¯¤ËÂФ·¡¢¥Ö¥é¥¦¥¶¤Î¥¢¥É¥ì¥¹Íó¤Ë http://example.jp/nucleuscms/ ¤Ç¥¢¥¯¥»¥¹²Äǽ¤Ç¤¹</li>
+<li style="margin-top:3px;">¥µ¥Ö¥«¥Æ¥´¥êÍѤΥǥ£¥ì¥¯¥È¥ê̾¤Ï¡¢¸½ºß´ÉÍý²èÌ̤ǤΤßÊÔ½¸²Äǽ¤Ç¤¹<br />
+       ¿·¤·¤¯Äɲ䵤줿¥µ¥Ö¥«¥Æ¥´¥ê¤Ë¤Ä¤¤¤Æ¤Ï¥ê¥ó¥¯À¸À®¤Î¥¿¥¤¥ß¥ó¥°¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤·¤Æ¤¤¤ë¤Î¤Ç¡¢¼ÂÍѾåÌäÂê¤Ê¤¤¤È»×¤¤¤Þ¤¹<br />
+       ¥Ç¥Õ¥©¥ë¥È¤Î¥µ¥Ö¥«¥Æ¥´¥êÍѥǥ£¥ì¥¯¥È¥ê̾¤Ï[subcatid_(subid)]¤Ç¤¹</li>
+<li style="margin-top:3px;">´ÉÍý²èÌÌ¡¢ÊÔ½¸²èÌ̤ǥǥ£¥ì¥¯¥È¥ê̾¤ò¶õÇò¤Ë¤·¤¿¾ì¹ç¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¤½¤Î̾Á°¤¬ºï½ü¤µ¤ì¡¢URL¤Ï½¾Íè¤ÎFancyURLs¤Î¤â¤Î¤Ë¤Ê¤ê¤Þ¤¹<br />
+       (⤷¥µ¥Ö¥«¥Æ¥´¥ê¡¼¤Ë¤Ä¤¤¤Æ¤Ï¡¢Äɲᦺï½ü¤Î¥¿¥¤¥ß¥ó¥°¤¬¥×¥é¥°¥¤¥ó¦¤ÇȽÃǤǤ­¤Ê¤¤¤¿¤á¡¢¡Ö¶õÇòʸ»úÎó = ¥Ç¥Õ¥©¥ë¥È̾¡×¤Ë¤Ê¤ê¤Þ¤¹)</li>
+<li style="margin-top:3px;">¥Ö¥í¥°¥¢¥¯¥»¥¹Íѥѥ¹¤È¥«¥Æ¥´¥ê¡¼¥¢¥¯¥»¥¹Íѥѥ¹¤Ë¤ÏƱ¤¸Ì¾Á°¤ò¤Ä¤±¤ë¤³¤È¤¬½ÐÍè¤Þ¤»¤ó<br />
+       ¤³¤ì¤Ï <code>hostname</code> ¤Î¼¡¤ËÍè¤ë¥Ñ¥¹Ì¾¤¬¥«¥Æ¥´¥ê¤Î¤â¤Î¤Ç¤¢¤ë¤Î¤«¥Ö¥í¥°¤Î¤â¤Î¤Ç¤¢¤ë¤Î¤«¤ò¸«Ê¬¤±¤ëÍ­¸ú¤Ê¼êÃʤ¬¸«¤Ä¤«¤é¤Ê¤¤¤¿¤á¤ÎÀ©¸Â¤Ç¤¹</li>
+<li style="margin-top:3px;">¥È¥Ã¥×¥Ç¥£¥ì¥¯¥È¥êľ²¼¤Ë¼Âºß¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê̾¤ä¥Õ¥¡¥¤¥ë̾¤ò¥Ñ¥¹¤È¤·¤ÆÅÐÏ¿¤¹¤ë¤³¤È¤Ï½ÐÍè¤Þ¤¹¤¬¡¢http¥µ¡¼¥Ð¤Ï¼Âºß¤¹¤ë¤â¤Î¤ÎÊý¤òÊÖ¤¹¤Î¤Ç¡¢¤³¤Î¥Ñ¥¹¤Ï»ö¼Â¾å̵¸ú¤È¤Ê¤ê¤Þ¤¹</li>
+<li style="margin-top:3px;">¤³¤Î¥×¥é¥°¥¤¥ó¤Î¥¤¥ó¥¹¥È¡¼¥ë¸å¤Ç¤â¡¢½¾Íè¤Î¥¯¥¨¥ê¼°¤ÎURL(ex. http://example.jp/index.php?catid=123)¤äFancyURLs¼°¤ÎURL(ex. http://example.jp/category/12/item/34)¤Ç¤Î¥¢¥¯¥»¥¹¤Ï²Äǽ¤Ç¤¹</li>
+<li style="margin-top:3px;">³Æ¥Ö¥í¥°Ëè¤Ë¥ª¥×¥·¥ç¥ó¤Ç URI ¤òÊѹ¹¤¹¤ë¡¦¤·¤Ê¤¤¤òÁªÂò¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¡Ö»ÈÍѤ·¤Ê¤¤¡×¤Ë¤·¤¿¾ì¹ç¤Ï¡¢Ä̾ï¤ÎFancyURLs(ex. http://example.jp/category/12/item/34)¤Ë¤Ê¤ê¤Þ¤¹<br />
+       ¤Þ¤¿¡Ö»ÈÍѤ·¤Ê¤¤¡×¤Ë¤·¤¿¾ì¹ç¤Ç¤â¡¢À¸À®¤µ¤ì¤ë URI ¤¬ FancyURLs ¤Ë¤Ê¤ë¤À¤±¤Ç¡¢¥«¥¹¥¿¥Þ¥¤¥º¤µ¤ì¤¿ URI ¤Ç¥ê¥¯¥¨¥¹¥È¤¬¤¢¤Ã¤¿¾ì¹ç¤Î¥ê¥ó¥¯¤ÏÀ®Î©¤·¤Þ¤¹¤Î¤Ç¡¢¤³¤Î¥×¥é¥°¥¤¥ó¤Î»ÈÍѤò¤ä¤á¤ë¾ì¹ç¤Ê¤É¤Ï³°Éô¤«¤é¤Î¥ê¥ó¥¯¤Î½ñ¤­´¹¤¨¤¬Á´¤Æ½ª¤ï¤ë¤Þ¤Ç¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç¡Ö»ÈÍѤ·¤Ê¤¤¡×¤òÁªÂò¤·¤¿¾õÂ֤Ǥα¿ÍѤˤè¤Ã¤Æ¥¹¥à¡¼¥º¤Ë°Ü¹Ô¤Ç¤­¤ë¤È»×¤¤¤Þ¤¹</li>
+<li style="margin-top:3px;">¥Ç¥Õ¥©¥ë¥È¤ÇÀ¸À®¤µ¤ì¤ëURI¤ÎÀÜƬ¸ì¤Ï¥ª¥×¥·¥ç¥ó²èÌ̤ÇÊѹ¹¤Ç¤­¤Þ¤¹</li>
+<li style="margin-top:3px;">¥¢¥¤¥Æ¥à¤ÎÀÜƬ¸ì¤Î¤ß¡¢<%year%>¡¢<%month%>¡¢<%day%>¤Î³ÆÊÑ¿ô¤¬»ÈÍѤǤ­¤Þ¤¹<br />¤³¤ÎÃͤò<%month%>-<%day%>¤È¤·¤¿¾ì¹ç¡¢¥¢¥¤¥Æ¥à¤ÎÅê¹Æ»þ¤Ë¼«Æ°¤ÇºîÀ®¤µ¤ì¤ëURI¤Ï¡Ö08-21_(id)¡×¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹</li>
+</ul>
+
+</P>
+
+<h3>¥¹¥­¥ó¡¦¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô</h3>
+
+<p>
+¥¹¥­¥ó¡¦¥Æ¥ó¥×¥ì¡¼¥È¡¢µÚ¤Óµ­»öÃæ¤Ëµ­Æþ¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹<br />
+µ­ÆþÊýË¡¡§<code>&lt;%CustomURL(¥ê¥ó¥¯Àè, ¥ê¥ó¥¯Ê¸»úÎó, ¥ê¥ó¥¯¥¿¥¤¥È¥ë)%&gt;</code><br />
+<ul>
+<li>¥ê¥ó¥¯À衧¥ê¥ó¥¯Àè¤Î¼ïÎà/id ¤Þ¤¿¤Ï̾Á°/»ØÄê¼ïÊÌ
+       <ul>
+               <li>Âè°ì¥Ñ¥é¥°¥é¥Õ¡§i¡¢c¡¢s¡¢b¡¢m ¤Î¤¤¤º¤ì¤«¡£¤½¤ì¤¾¤ì¡¢item¡¢category¡¢subcategory¡¢blog¡¢member ¤ÎƬʸ»ú</li>
+               <li>ÂèÆó¥Ñ¥é¥°¥é¥Õ¡§¥ê¥ó¥¯Àè¤Î id¡¢¤â¤·¤¯¤Ï̾Á°¡£Ì¾Á°¤Ï¥Ñ¥¹Ì¾¤Ç¤Ï¤Ê¤¯¡¢¡Ö¥«¥Æ¥´¥ê¡¼Ì¾¡×¡Ö¥Ö¥í¥°¤Îû½Ì̾¡×Åù¤Ë¤Ê¤ê¤Þ¤¹¡£¥ê¥ó¥¯Àè¤Ë¥¢¥¤¥Æ¥à¤òÁªÂò¤·¤¿¾ì¹ç¤Ï¡¢¤³¤³¤Ë»ØÄê¤Ç¤­¤ë¤Î¤Ï id ¤Î¤ß¤Ë¤Ê¤ê¤Þ¤¹</li>
+               <li>Âè»°¥Ñ¥é¥°¥é¥Õ¡§ÂèÆó¥Ñ¥é¥°¥é¥Õ¤Ë id ¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï 'i' ¡¢Ì¾Á°¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï 'n' ¤Èµ­Æþ¤·¤Æ¤¯¤À¤µ¤¤</li>
+       </ul>
+</li>
+<li>¥ê¥ó¥¯Ê¸»úÎó¡§a ¥¿¥°¤Ë¶´¤Þ¤ì¤ëʸ»úÎó¡£¾Êά¤µ¤ì¤¿¾ì¹ç¤Ï url ¤Î¤ß¤¬À¸À®¤µ¤ì¤Þ¤¹</li>
+<li>¥ê¥ó¥¯¥¿¥¤¥È¥ë¡§a ¥¿¥°¤Î¡Ötitle¡×°À­¤ËÀßÄꤵ¤ì¤Þ¤¹¡£¾Êά¤µ¤ì¤¿¾ì¹ç¤Ï¡¢¥ê¥ó¥¯Ê¸»úÎó¤¬Â¸ºß¤¹¤ì¤ÐÊѤï¤ê¤ËÀßÄꤵ¤ì¤Þ¤¹¡£¥ê¥ó¥¯Ê¸»úÎó¤ò»ØÄꤻ¤º¤Ë¥¿¥¤¥È¥ë¤Î¤ß¤ò»ØÄꤷ¤Æ¤â¥ê¥ó¥¯¥¿¥°¤ÏÀ¸À®¤µ¤ì¤Þ¤»¤ó</li>
+<li>Á´¤Æ¤Î¥Ñ¥é¥á¡¼¥¿¤ò¾Êά¤·¤Æ&lt;%CustomURL%&gt;¤È½ñ¤¯¤³¤È¤â½ÐÍè¤Þ¤¹¡£¤³¤Î¾ì¹ç¤Ïµ­Æþ¾ì½ê¤Ë¤è¤Ã¤Æ¥Ç¥Õ¥©¥ë¥È¤Î URI ¤¬½ñ¤­½Ð¤µ¤ì¤Þ¤¹
+       <ul>
+               <li>¥¹¥­¥ó¡¡¡¡¡¡¡§ÁªÂòÃæ¤Î¡Ö¥Ö¥í¥°¡×¤Î¥È¥Ã¥×¥Ú¡¼¥¸¤Ø¤Î URI ¤¬½ñ¤­½Ð¤µ¤ì¤Þ¤¹¤¹</li>
+               <li>¥Æ¥ó¥×¥ì¡¼¥È¡§½ñ¤­½Ð¤µ¤ì¤ë¥¢¥¤¥Æ¥à¤Ø¤Î URI ¤¬½ñ¤­½Ð¤µ¤ì¤Þ¤¹(&lt;%itemlink%&gt;¤ÎÃÖ¤­´¹¤¨)</li>
+               <li>µ­»öÃæ¡¡¡¡¡¡¡§¼«Ê¬¼«¿È¤Ø¤Î URI ¤¬½ñ¤­½Ð¤µ¤ì¤Þ¤¹</li>
+       </ul>
+</li>
+</ul>
+µ­ÆþÎ㡧
+<ul>
+       <li>id ¤¬123¤Î¥¢¥¤¥Æ¥à¤Ë¥ê¥ó¥¯¤¹¤ë¾ì¹ç¡§&lt;a href="&lt;%CustomURL(i/123/i)%&gt;"&gt;'¤³¤³¤Ï¼«Í³¤Ë½ñ¤­¹þ¤ó¤Ç¤¯¤À¤µ¤¤'&lt;/a&gt;<br />
+       ½ñ¤­½Ð¤µ¤ì¤ëʸ»úÎó¡§&lt;a href="http://blog.example.jp/item_123.html"&gt;'¤³¤³¤Ï¼«Í³¤Ë½ñ¤­¹þ¤ó¤Ç¤¯¤À¤µ¤¤'&lt;/a&gt;</li>
+       <li>¥«¥Æ¥´¥ê¡¼Ì¾¤¬¡ÖÆüµ­¡×¤Î¥«¥Æ¥´¥ê¡¼¤Î URI ¤ò½ñ¤­½Ð¤¹¾ì¹ç¡§&lt;%CustomURL(c/Æüµ­/n)%&gt;<br />
+       ½ñ¤­½Ð¤µ¤ì¤ëʸ»úÎó(¡ÖÆüµ­¡×¥«¥Æ¥´¥ê¡¼¤Îid¤¬12¤Î¾ì¹ç)¡§http://blog.example.jp/category_12/</li>
+       <li>¥Ö¥í¥°¤Îû½Ì̾¡Öbibouroku¡×¤Ø¤Î¥ê¥ó¥¯¤ò¡Ö¤³¤Î¥Ö¥í¥°¡×¤È¤¤¤¦Ê¸»úÎ󤫤é¤Î¥ê¥ó¥¯¤ËÀßÄꤹ¤ë¾ì¹ç¡§&lt;%CustomURL(c/bibouroku/n, ¤³¤Î¥Ö¥í¥°)%&gt;<br />
+       ½ñ¤­½Ð¤µ¤ì¤ëʸ»úÎó¡§&lt;a href="http://blog.example.jp/"&gt;¤³¤Î¥Ö¥í¥°&lt;/a&gt;</li>
+</ul>
+¥¹¥­¥ó¡¦¥Æ¥ó¥×¥ì¡¼¥È¡¦µ­»ö¶¦¤Ë¡¢&lt;%CustomURL(123)%&gt;¤Î¤è¤¦¤Ë id ¤Î¤ß¤òµ­Æþ¤·¤¿¾ì¹ç¤Ï¡¢¤½¤Î id ¤ò»ý¤Ä¥¢¥¤¥Æ¥à¤Ø¤Î URI ¤¬½ñ¤­½Ð¤µ¤ì¤Þ¤¹<br />
+¤Þ¤¿¥¢¥¤¥Æ¥à¤Î¾ì¹ç¤Î¤ß¡¢&lt;%CustomURL(123/path)%&gt;¤È½ñ¤¯¤³¤È¤Ç¡¢item_123 ¤Î¤è¤¦¤Ë¤½¤Î id ¤ò»ý¤Ä¥¢¥¤¥Æ¥à¤ËÀßÄꤷ¤¿¥Ñ¥¹¤ò½ñ¤­½Ð¤¹¤³¤È¤¬½ÐÍè¤Þ¤¹<br />
+</p>
+
+<h3>Æ°ºîÊó¹ð¡¦¥Ð¥°¥ì¥Ý¡¼¥È</h3>
+
+<p>Æ°ºîÊó¹ð¡¦¥Ð¥°¥ì¥Ý¡¼¥È¤Ï¡¢°Ê²¼¤ÎURL¤Ë¥³¥á¥ó¥È¡¦¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤ò¤ª´ê¤¤¤·¤Þ¤¹<br />
+<a href="http://shizuki.kinezumi.net/NucleusCMS/Plugins/NP_CustomURL/NP_CustomURL.html">
+http://shizuki.kinezumi.net/NucleusCMS/Plugins/NP_CustomURL/NP_CustomURL.html</a></p>
+
+<h3>¥Ð¡¼¥¸¥ç¥óÍúÎò</h3>
+
+<ul>
+<li>Version 0.2.3: ÉÔ¶ñ¹ç½¤Àµ¡¦µ¡Ç½ÄɲÃ
+       <ul>
+       <li>¥ê¥À¥¤¥ì¥¯¥È¼þ¤ê¤Ë¥Ð¥°¤¬¤¢¤Ã¤¿¤Î¤Ç½¤Àµ</li>
+       <li>¡Ö¥«¥¹¥¿¥Þ¥¤¥º¤µ¤ì¤¿URL¤ò»ÈÍѤ¹¤ë¡×¤ò¡Ö¤Ï¤¤¡×¤Ë¤·¤Æ¤¤¤ë»þ¡¢µìÍè¤ÎFancuURL¤Ç¥¢¥¯¥»¥¹¤·¤Æ¤­¤¿¥¯¥é¥¤¥¢¥ó¥È¤Ë301¤òÊÖ¤·¤Æ¥ê¥À¥¤¥ì¥¯¥È¤¹¤ë¤è¤¦¤ËÊѹ¹</li>
+       </ul>
+</li>
+<li>Version 0.2.2a: ÉÔ¶ñ¹ç½¤Àµ
+       <ul>
+       <li>SQL¥¤¥ó¥¸¥§¥¯¥·¥ç¥ó¤ò°ú¤­µ¯¤³¤¹²ÄǽÀ­¤¬¤¢¤ëÀȼåÀ­¤ËÂнè</li>
+       </ul>
+</li>
+<li>Version 0.2.2: ÉÔ¶ñ¹ç½¤Àµ¡¦µ¡Ç½ÄɲÃ
+       <ul>
+       <li>¥Ð¥°¥Õ¥£¥Ã¥¯¥¹</li>
+       <li>¥¢¥¤¥Æ¥à¡¦¥«¥Æ¥´¥ê¡¼¡¦¥µ¥Ö¥«¥Æ¥´¥ê¡¼¤Î¿·µ¬ºîÀ®»þ¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÀÜƬ¸ì¤Î¥ª¥×¥·¥ç¥ó¤Ç¤ÎÊѹ¹¤ËÂбþ<br />
+       ¥¢¥¤¥Æ¥à¤ÎÀÜƬ¸ì¤Î¤ß¥Æ¥ó¥×¥ì¡¼¥È²½</li>
+       </ul>
+</li>
+<li>Version 0.2.1a: ÉÔ¶ñ¹ç½¤Àµ
+       <ul>
+       <li>¥Ð¥°¥Õ¥£¥Ã¥¯¥¹</li>
+       </ul>
+</li>
+<li>Version 0.2.1: µ¡Ç½ÄɲÃ
+       <ul>
+       <li>¥µ¥Ö¥«¥Æ¥´¥ê¤Î¿ÃÊURL²½</li>
+       <li>¥«¥Æ¥´¥ê¡¦¥Ö¥í¥°¤Îºï½ü»þ¤Ë¥µ¥Ö¥«¥Æ¥´¥ê¤Î¥Ç¡¼¥¿¤¬¾Ãµî¤Ç¤­¤Æ¤¤¤Ê¤«¤Ã¤¿ÉÔ¶ñ¹ç¤ò½¤Àµ</li>
+       <li>¤½¤Î¾½¤Àµ</li>
+       </ul>
+</li>
+<li>Version 0.1.9: µ¡Ç½ÄɲÃ
+       <ul>
+       <li>¥«¥Æ¥´¥êµÚ¤Ó¥¢¥¤¥Æ¥à¤Î¥Ö¥í¥°´Ö°ÜÆ°¤ËÂбþ</li>
+       </ul>
+</li>
+<li>Version 0.1.8a: ÉÔ¶ñ¹ç½¤Àµ¡¦µ¡Ç½ÄɲÃ
+       <ul>
+       <li>¿·µ¬¥µ¥Ö¥«¥Æ¥´¥ê¤Î¥Ñ¥¹ÅÐÏ¿¤Î¥¿¥¤¥ß¥ó¥°Êѹ¹¤Ëȼ¤¦½¤Àµ</li>
+       <li>¥Ö¥í¥°Ëè¤Ë¥«¥¹¥¿¥Þ¥¤¥º¤·¤¿ URI ¤ò»ÈÍѤ¹¤ë¡¦¤·¤Ê¤¤¤òÁªÂò¤Ç¤­¤ë¤è¤¦¤Ë¥ª¥×¥·¥ç¥ó¤òÄɲÃ</li>
+       <li>¥Ø¥ë¥×¥Õ¥¡¥¤¥ë¤Î½¤Àµ</li>
+       </ul>
+</li>
+<li>Version 0.1.8: ÉÔ¶ñ¹ç½¤Àµ
+       <ul>
+       <li>¿·µ¬¥Ö¥í¥°ºîÀ®»þ¤Ë¼«Æ°¤ÇºîÀ®¤µ¤ì¤ë'General'¥«¥Æ¥´¥ê¡¼¤ËÂФ¹¤ëURI¤¬Àµ¾ï¤ËÆ°ºî¤·¤Ê¤«¤Ã¤¿ÉÔ¶ñ¹ç¤ËÂбþ</li>
+       <li>¥Ö¥í¥°¤òºï½ü¤·¤¿»þ¤Ë¡¢ºï½ü¤·¤¿¥Ö¥í¥°¤Ë°¤¹¤ë¡Ö¥«¥Æ¥´¥ê¡¼¡×¡Ö¥µ¥Ö¥«¥Æ¥´¥ê¡¼¡×¡Ö¥¢¥¤¥Æ¥à¡×¤ÎURI¤¬¥Æ¡¼¥Ö¥ë¤Ë»Ä¤Ã¤¿¤Þ¤Þ¤Ë¤Ê¤Ã¤Æ¤¤¤¿ÉÔ¶ñ¹ç¤ËÂбþ</li>
+       <li>¿·µ¬¥µ¥Ö¥«¥Æ¥´¥ê¡¼¤Î¥Ñ¥¹¤ÎÅÐÏ¿¤Î¥¿¥¤¥ß¥ó¥°¤ò¥ê¥ó¥¯¤¬À¸À®¤µ¤ì¤ë»þ¤ËÊѹ¹(¥ê¥ó¥¯À¸À®Á°¤Ë´ÉÍý²èÌ̤ÇURI¤òÀßÄꤷ¤Æ¤¤¤¿¾ì¹ç¤ÏÀßÄꤷ¤¿URI¤¬»ÈÍѤµ¤ì¤Þ¤¹)</li>
+       <li>´ÉÍý¥Ú¡¼¥¸¤Ç¥¢¥¤¥Æ¥àURI¤¬¤ª¤«¤·¤¯¤Ê¤Ã¤Æ¤¤¤¿¤Î¤ò½¤Àµ</li>
+       </ul>
+</li>
+<li>Version 0.1.7: ÉÔ¶ñ¹ç½¤Àµ
+       <ul>
+       <li>¤Û¤ÜÁ´ÌÌŪ¤Ë½ñ¤­Ä¾¤·</li>
+       <li>¿·µ¬¥¢¥¤¥Æ¥àÄɲûþ¤Ë¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¤òÁ÷¿®¤·¤¿»þ¤Ë¡¢¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¸µ¤ÎURL¤¬Àµ¤·¤¯Á÷¿®¤Ç¤­¤Ê¤«¤Ã¤¿</li>
+       <li>´ÉÍý²èÌ̤«¤é¥µ¥Ö¥«¥Æ¥´¥ê¤Î¥Ñ¥¹¤òÊÔ½¸¤·¤¿¤È¤­¤Ë¡¢¥ê¥¹¥È¤¬É½¼¨¤µ¤ì¤Ê¤«¤Ã¤¿</li>
+       </ul>
+</li>
+<li>Version 0.1.5: ¸ø³«¥Ð¡¼¥¸¥ç¥ó</li>
+<li>Version 0.01: ½é´ü¥Ð¡¼¥¸¥ç¥ó(NP_Path¤Î²þ¤¥Ð¡¼¥¸¥ç¥ó)</li>
+</ul>
+
+<h3>¼Õ¼­</h3>
+<p>
+Ëܥץ饰¥¤¥ó¤Î±Ñ¸ìÈÇ¥é¥ó¥²¡¼¥¸¥Õ¥¡¥¤¥ë¡¢µÚ¤Ó¥Ø¥ë¥×¥Õ¥¡¥¤¥ëºîÀ®¤ËÅö¤¿¤ê¤Þ¤·¤Æ¡¢Â¿Âç¤Ê¤ë¤´¶¨ÎϤò¤¤¤¿¤À¤­¤Þ¤·¤¿Tucker»á¤Ë¿´¤è¤ê´¶¼Õ¿½¤·¾å¤²¤Þ¤¹
+</p>
+
+<h3>¥×¥é¥°¥¤¥ó²þ¤¾ðÊó</h3>
+
+<p>
+
+¡ÖNP_TagEX¡×¤È¡ÖNP_ContentsList¡×¤Ç ¡Öhttp://example.jp/nucleuscms/plugins/tag/NP_CustomURL¡× ·Á¼°¤Î¥ê¥ó¥¯¤òɽ¼¨¤µ¤»¤ëÊýË¡<br />
+<br />
+¡ÖNP_TagEX¡×¤Î¾ì¹ç<br />
+¡¦°ìÈֺǸå¤Î¥Õ¥¡¥ó¥¯¥·¥ç¥ó<code>creatTagLink()</code>¤ÎºÇ¸å¤Î<code>return addLinkParams($link, $linkparams);</code>¤ÎľÁ°¤Ë¡¢¼¡¤Î¥³¡¼¥É¤òÁÞÆþ¤·¤Þ¤¹<br />
+<blockquote><pre style="overflow:auto;">global $manager;
+if ($manager->pluginInstalled('NP_CustomURL')) {
+    $customurls = $manager->getPlugin('NP_CustomURL');
+    $link = 'tag/' . $ready.$sep.$this->_rawencode($tag);
+    return $CONF['BlogURL'] . '/' . $customurls->_addLinkParams($link, $linkparams) . '/';
+}
+</pre></blockquote>
+¤³¤ì¤Ç¥¿¥°¤¬URL¤Î°ìÈֺǸå¤Ë¤Ê¤ê¤Þ¤¹<br />
+<br />
+¡ÖNP_ContentsList¡×¤Î¾ì¹ç<br />
+¡¦<code>doSkinVar()</code>¤Î467¹ÔÌÜÉնᡢ<code>$catdata['catlink']</code>¤ÎÀ¸À®¤¬½ªÎ»¤·¤¿¤È¤³¤í¤Ç¥µ¥Ö¥«¥Æ¥´¥ê¤Î¥ê¥ó¥¯¤òÀ¸À®¤¹¤ëľÁ°¡¢
+<blockquote><pre style="overflow:auto;">// sub category ---
+if ($subcat && (!$subcurrent || $catid == $catdata['catid']) && !$subnoOpen) {
+</pre></blockquote>
+¤ÎÁ°¤Î¹Ô¤Ë
+<blockquote><pre style="overflow:auto;">if ($CONF['URLMode'] == 'pathinfo' && $manager->pluginInstalled('NP_CustomURL')) {
+    $catdata['catlink'] = createCategoryLink($catdata['catid']);
+}
+</pre></blockquote>¤Î°ì¹Ô¤òÄɲ䷤ơ¢¥«¥Æ¥´¥ê¤Î¥ê¥ó¥¯¤ò¾å½ñ¤­¤·¤Þ¤¹<br />
+¤µ¤é¤Ë¤½¤³¤«¤é¤â¤¦¾¯¤·²¼¤Î
+<blockquote><pre style="overflow:auto;">$subdata['sublink'] = addLinkParams($catdata['catlink'], array($subrequest => $subdata['subcatid']));
+</pre></blockquote>
+¤È¤Ê¤Ã¤Æ¤¤¤ë¹Ô¤Î²¼¤Ë
+<blockquote><pre style="overflow:auto;">global $manager;
+if ($CONF['URLMode'] == 'pathinfo' && $manager->pluginInstalled('NP_CustomURL')) {
+    $customurls = $manager->getPlugin('NP_CustomURL');
+    $subdata['sublink'] = $customurls->_addLinkParams($catdata['catlink'], array($subrequest => $subdata['subcatid']));
+}
+</pre></blockquote>
+¤ÈÄɲá¢350¹ÔÌÜÉÕ¶á¤Î<code>$data['self'] = $data['blogurl'];</code>¤ÎÁ°¤Ë
+<blockquote><pre style="overflow:auto;">if ($CONF['URLMode'] == 'pathinfo' && $manager->pluginInstalled('NP_CustomURL')) {
+    $data['blogurl'] = createBlogidLink($data['blogid']);
+}
+</pre></blockquote>
+¤òÄɲ䷤ƽªÎ»¤Ç¤¹
+
+</p>
diff --git a/trunk/NP_CustomURL/customurl/japanese-utf8_help.html b/trunk/NP_CustomURL/customurl/japanese-utf8_help.html
new file mode 100644 (file)
index 0000000..31fe172
--- /dev/null
@@ -0,0 +1,260 @@
+<h3>プラグインの概要</h3>
+
+<p>
+
+NucleusCMSで作成したwebサイトのアイテム・カテゴリに好きな名前をつけて、静的URLとしてリンクを生成します。<br />
+<em style="color:#cc0000;">FancyURLモードでのみの動作、及びmod_Rewrite必須です</em><br />
+カテゴリ、サブカテゴリ、アーカイブリスト等を、それぞれディレクトリとみなし、カテゴリで絞り込んだ時は当該カテゴリのディレクトリにあるindexファイルを参照するイメージになります<br />
+<ul style="margin:0 0 25px 12px;">ex.
+<li>カテゴリへのアクセスのイメージ:
+<ul><li>http://example.jp/nucleuscms/</li></ul></li>
+<li>サブカテゴリへのアクセスのイメージ:
+<ul><li>http://example.jp/nucleuscms/plugins/</li></ul></li>
+<li>アーカイブへのアクセスのイメージ:
+<ul><li>http://example.jp/archives/</li><li>http://example.jp/archives/nucleuscms/</li></ul></li>
+</ul>
+メンバーの詳細ページと個別アイテムページは、当該htmlファイルにアクセスするイメージになります<br />
+<ul style="margin:0 0 25px 12px;">ex.
+<li>http://example.jp/nucleuscms/plugins/NP_CustomURL.html</li>
+<li>http://example.jp/new_nucleus_comming_soon.html</li>
+<li>http://example.jp/member/Hiroyuki.html</li>
+</ul>
+
+</p>
+
+<h3>インストール・動作開始手順</h3>
+
+<p>
+
+<ol style="margin:0 0 25px 12px;">
+<li>ダウンロードしたファイルを解凍して出来た「NP_CustomURL.php」ファイルと「customurl」ディレクトリをサーバの plugins ディレクトリにアップロード後、「プラグインの管理」ページで「CustomURL」を選択して「プラグインのインストール」ボタンをクリックします<br />
+(この文章を読んでいるということは、ここまでは出来ていると思います)</li>
+<li>まず始めに、管理画面の「グローバル設定」ページで「URL モード」を「Fancy」に変更します</li>
+<li>通常の「extra」ディレクトリの「fancyurls.config.php」を、FancyURLsの手順通りトップディレクトリへコピーして編集します<br />このときコピーするのは「fancyurls.config.php」ファイルだけで、後のファイルはコピーする必要がありません</li>
+<li>次に「index.php」を編集しますの <code>$CONF['Self']</code> の行を <code>$CONF['Self'] = '.'</code> に書き換え、 <code>$curl_blogid = 1;</code>("1"は「index.php」でアクセスするブログのID) と一行書き加えます
+<blockquote><pre style="overflow:auto;">&lt;?php
+// This file will generate and return the main page of the site
+$CONF = array();
+$CONF['Self'] = '.';
+$curl_blogid = 1;
+
+include('./config.php');
+include('./fancyurls.config.php');
+
+selector();
+
+?&gt;
+</pre></blockquote>
+</li>
+<li>次に<code>.htaccess</code>を編集します<ul>
+    <li>内容はこちら<blockquote><pre style="overflow:auto;">RewriteEngine on
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^(.*)$ index.php?curl=$1 [L,QSA]
+</pre></blockquote>
+この4行だけで、後は何も書かなくても大丈夫です</li></ul></li>
+</ol>
+これで準備完了です<br />
+<br />
+注1:現在 FancyURLs で運用されている方は、Fancy 用のファイルを削除するか別ディレクトリへ退避してください。すべてこのプラグインで受けているので必要ありません<br />
+また、下記プラグイン用のFancyファイルは組み込み済みですので不要です
+<ul>
+<li>各ページスイッチ用「page」ファイル</li>
+<li>タグ用「tag」ファイル(「NP_TagEX」「NP_MultiTags」両方対応。「NP_MultiTags」の「タグクエリー 」の変更にも対応しています)</li>
+<li>「NP_Trackback」のトラックバック受信専用「trackback」ファイル</li>
+</ul>
+</p>
+
+<h3>使い方</h3>
+
+<p>
+
+<ul>
+<li style="margin-top:3px;">ブログ・アイテム・カテゴリ・メンバーの編集ページにそれぞれオプションが追加してありますので、好きな名前をつけてください</li>
+<li style="margin-top:3px;">メンバーの新規追加、及び「ブログの設定の編集」ページからのカテゴリの新規追加の時にはこれらの編集画面が出ませんので、追加したあとにそれぞれ編集してください</li>
+<li style="margin-top:3px;">新規追加時のデフォルトの名前は、ブログは[ショートネーム]カテゴリーは[category_(catid)]、アイテムは[item.html]、メンバーは[ログインネーム.html]がそれぞれ設定されます<br />
+       なお、プラグインのインストール時にブログに存在した全てのブログ・アイテム・カテゴリ・メンバーには自動でパスを生成済みです</li>
+<li style="margin-top:3px;">同一ブログ内、同一キーでの名前は重複できませんので気をつけてください<br />
+       登録しようとしたパスが重複していた場合は、末尾にそれぞれのIDが'_id'の形で追加されます<br />
+       同一ブログであっても、カテゴリーとサブカテゴリー、アイテムは同じ名前をつけることが出来ます<br />
+       つまり、http://example.jp/nucleuscms/nucleuscms/nucleuscms.htmlは有効なパスとなります</li>
+<li style="margin-top:3px;">メンバー、及びアイテムのパスには、末尾に自動的に[.html]が付加されるので、編集時に[.html]をつけないように気をつけてください<br />
+       うっかり付けてしまうと、[item_html.html]というような、なんだかよく解らないファイル名が出来上がってしまいます</li>
+<li style="margin-top:3px;">メンバーディレクトリ、アーカイブディレクトリ、アーカイブリストディレクトリはプラグインの編集画面で変更できます。初期値はそれぞれの<code>$CONF['***Key']</code>の値になっています</li>
+<li style="margin-top:3px;">ディレクトリ名、及びファイル名として使用できる文字は半角英数字(a-z,A-Z,0-9)と半角ハイフン(-)と半角アンダーバー(_)のみです<br />
+       なお、指定された文字列の中に含まれている '/'(スラッシュ)や'.'(ピリオド)は、自動的に '_'(半角アンダーバー)に変換されますが、それ以外のときはエラーを返します<br />
+       URL生成のときはアルファベットの大文字小文字の区別はしますが、アクセスのときはURLの使用上区別できません<br />
+       通常のHTMLリンク同様、 http://example.jp/NucleusCMS/ と表示してあるリンクに対し、ブラウザのアドレス欄に http://example.jp/nucleuscms/ でアクセス可能です</li>
+<li style="margin-top:3px;">サブカテゴリ用のディレクトリ名は、現在管理画面でのみ編集可能です<br />
+       新しく追加されたサブカテゴリについてはリンク生成のタイミングでデータベースを更新しているので、実用上問題ないと思います<br />
+       デフォルトのサブカテゴリ用ディレクトリ名は[subcatid_(subid)]です</li>
+<li style="margin-top:3px;">管理画面、編集画面でディレクトリ名を空白にした場合は、データベースからその名前が削除され、URLは従来のFancyURLsのものになります<br />
+       (但しサブカテゴリーについては、追加・削除のタイミングがプラグイン側で判断できないため、「空白文字列 = デフォルト名」になります)</li>
+<li style="margin-top:3px;">ブログアクセス用パスとカテゴリーアクセス用パスには同じ名前をつけることが出来ません<br />
+       これは <code>hostname</code> の次に来るパス名がカテゴリのものであるのかブログのものであるのかを見分ける有効な手段が見つからないための制限です</li>
+<li style="margin-top:3px;">トップディレクトリ直下に実在するディレクトリ名やファイル名をパスとして登録することは出来ますが、httpサーバは実在するものの方を返すので、このパスは事実上無効となります</li>
+<li style="margin-top:3px;">このプラグインのインストール後でも、従来のクエリ式のURL(ex. http://example.jp/index.php?catid=123)やFancyURLs式のURL(ex. http://example.jp/category/12/item/34)でのアクセスは可能です</li>
+<li style="margin-top:3px;">各ブログ毎にオプションで URI を変更する・しないを選択することが出来ます。このオプションを「使用しない」にした場合は、通常のFancyURLs(ex. http://example.jp/category/12/item/34)になります<br />
+       また「使用しない」にした場合でも、生成される URI が FancyURLs になるだけで、カスタマイズされた URI でリクエストがあった場合のリンクは成立しますので、このプラグインの使用をやめる場合などは外部からのリンクの書き換えが全て終わるまで、このオプションで「使用しない」を選択した状態での運用によってスムーズに移行できると思います</li>
+<li style="margin-top:3px;">デフォルトで生成されるURIの接頭語はオプション画面で変更できます</li>
+<li style="margin-top:3px;">アイテムの接頭語のみ、<%year%>、<%month%>、<%day%>の各変数が使用できます<br />この値を<%month%>-<%day%>とした場合、アイテムの投稿時に自動で作成されるURIは「08-21_(id)」のようになります</li>
+</ul>
+
+</P>
+
+<h3>スキン・テンプレート変数</h3>
+
+<p>
+スキン・テンプレート、及び記事中に記入することが出来ます<br />
+記入方法:<code>&lt;%CustomURL(リンク先, リンク文字列, リンクタイトル)%&gt;</code><br />
+<ul>
+<li>リンク先:リンク先の種類/id または名前/指定種別
+       <ul>
+               <li>第一パラグラフ:i、c、s、b、m のいずれか。それぞれ、item、category、subcategory、blog、member の頭文字</li>
+               <li>第二パラグラフ:リンク先の id、もしくは名前。名前はパス名ではなく、「カテゴリー名」「ブログの短縮名」等になります。リンク先にアイテムを選択した場合は、ここに指定できるのは id のみになります</li>
+               <li>第三パラグラフ:第二パラグラフに id を指定した場合は 'i' 、名前を指定した場合は 'n' と記入してください</li>
+       </ul>
+</li>
+<li>リンク文字列:a タグに挟まれる文字列。省略された場合は url のみが生成されます</li>
+<li>リンクタイトル:a タグの「title」属性に設定されます。省略された場合は、リンク文字列が存在すれば変わりに設定されます。リンク文字列を指定せずにタイトルのみを指定してもリンクタグは生成されません</li>
+<li>全てのパラメータを省略して&lt;%CustomURL%&gt;と書くことも出来ます。この場合は記入場所によってデフォルトの URI が書き出されます
+       <ul>
+               <li>スキン   :選択中の「ブログ」のトップページへの URI が書き出されますす</li>
+               <li>テンプレート:書き出されるアイテムへの URI が書き出されます(&lt;%itemlink%&gt;の置き換え)</li>
+               <li>記事中   :自分自身への URI が書き出されます</li>
+       </ul>
+</li>
+</ul>
+記入例:
+<ul>
+       <li>id が123のアイテムにリンクする場合:&lt;a href="&lt;%CustomURL(i/123/i)%&gt;"&gt;'ここは自由に書き込んでください'&lt;/a&gt;<br />
+       書き出される文字列:&lt;a href="http://blog.example.jp/item_123.html"&gt;'ここは自由に書き込んでください'&lt;/a&gt;</li>
+       <li>カテゴリー名が「日記」のカテゴリーの URI を書き出す場合:&lt;%CustomURL(c/日記/n)%&gt;<br />
+       書き出される文字列(「日記」カテゴリーのidが12の場合):http://blog.example.jp/category_12/</li>
+       <li>ブログの短縮名「bibouroku」へのリンクを「このブログ」という文字列からのリンクに設定する場合:&lt;%CustomURL(c/bibouroku/n, このブログ)%&gt;<br />
+       書き出される文字列:&lt;a href="http://blog.example.jp/"&gt;このブログ&lt;/a&gt;</li>
+</ul>
+スキン・テンプレート・記事共に、&lt;%CustomURL(123)%&gt;のように id のみを記入した場合は、その id を持つアイテムへの URI が書き出されます<br />
+またアイテムの場合のみ、&lt;%CustomURL(123/path)%&gt;と書くことで、item_123 のようにその id を持つアイテムに設定したパスを書き出すことが出来ます<br />
+</p>
+
+<h3>動作報告・バグレポート</h3>
+
+<p>動作報告・バグレポートは、以下のURLにコメント・トラックバックをお願いします<br />
+<a href="http://shizuki.kinezumi.net/NucleusCMS/Plugins/NP_CustomURL/NP_CustomURL.html">
+http://shizuki.kinezumi.net/NucleusCMS/Plugins/NP_CustomURL/NP_CustomURL.html</a></p>
+
+<h3>バージョン履歴</h3>
+
+<ul>
+<li>Version 0.2.3: 不具合修正・機能追加
+       <ul>
+       <li>リダイレクト周りにバグがあったので修正</li>
+       <li>「カスタマイズされたURLを使用する」を「はい」にしている時、旧来のFancuURLでアクセスしてきたクライアントに301を返してリダイレクトするように変更</li>
+       </ul>
+</li>
+<li>Version 0.2.2a: 不具合修正
+       <ul>
+       <li>SQLインジェクションを引き起こす可能性がある脆弱性に対処</li>
+       </ul>
+</li>
+<li>Version 0.2.2: 不具合修正・機能追加
+       <ul>
+       <li>バグフィックス</li>
+       <li>アイテム・カテゴリー・サブカテゴリーの新規作成時のデフォルトの接頭語のオプションでの変更に対応<br />
+       アイテムの接頭語のみテンプレート化</li>
+       </ul>
+</li>
+<li>Version 0.2.1a: 不具合修正
+       <ul>
+       <li>バグフィックス</li>
+       </ul>
+</li>
+<li>Version 0.2.1: 機能追加
+       <ul>
+       <li>サブカテゴリの多段URL化</li>
+       <li>カテゴリ・ブログの削除時にサブカテゴリのデータが消去できていなかった不具合を修正</li>
+       <li>その他修正</li>
+       </ul>
+</li>
+<li>Version 0.1.9: 機能追加
+       <ul>
+       <li>カテゴリ及びアイテムのブログ間移動に対応</li>
+       </ul>
+</li>
+<li>Version 0.1.8a: 不具合修正・機能追加
+       <ul>
+       <li>新規サブカテゴリのパス登録のタイミング変更に伴う修正</li>
+       <li>ブログ毎にカスタマイズした URI を使用する・しないを選択できるようにオプションを追加</li>
+       <li>ヘルプファイルの修正</li>
+       </ul>
+</li>
+<li>Version 0.1.8: 不具合修正
+       <ul>
+       <li>新規ブログ作成時に自動で作成される'General'カテゴリーに対するURIが正常に動作しなかった不具合に対応</li>
+       <li>ブログを削除した時に、削除したブログに属する「カテゴリー」「サブカテゴリー」「アイテム」のURIがテーブルに残ったままになっていた不具合に対応</li>
+       <li>新規サブカテゴリーのパスの登録のタイミングをリンクが生成される時に変更(リンク生成前に管理画面でURIを設定していた場合は設定したURIが使用されます)</li>
+       <li>管理ページでアイテムURIがおかしくなっていたのを修正</li>
+       </ul>
+</li>
+<li>Version 0.1.7: 不具合修正
+       <ul>
+       <li>ほぼ全面的に書き直し</li>
+       <li>新規アイテム追加時にトラックバックを送信した時に、トラックバック元のURLが正しく送信できなかった</li>
+       <li>管理画面からサブカテゴリのパスを編集したときに、リストが表示されなかった</li>
+       </ul>
+</li>
+<li>Version 0.1.5: 公開バージョン</li>
+<li>Version 0.01: 初期バージョン(NP_Pathの改造バージョン)</li>
+</ul>
+
+<h3>謝辞</h3>
+<p>
+本プラグインの英語版ランゲージファイル、及びヘルプファイル作成に当たりまして、多大なるご協力をいただきましたTucker氏に心より感謝申し上げます
+</p>
+
+<h3>プラグイン改造情報</h3>
+
+<p>
+
+「NP_TagEX」と「NP_ContentsList」で 「http://example.jp/nucleuscms/plugins/tag/NP_CustomURL」 形式のリンクを表示させる方法<br />
+<br />
+「NP_TagEX」の場合<br />
+・一番最後のファンクション<code>creatTagLink()</code>の最後の<code>return addLinkParams($link, $linkparams);</code>の直前に、次のコードを挿入します<br />
+<blockquote><pre style="overflow:auto;">global $manager;
+if ($manager->pluginInstalled('NP_CustomURL')) {
+    $customurls = $manager->getPlugin('NP_CustomURL');
+    $link = 'tag/' . $ready.$sep.$this->_rawencode($tag);
+    return $CONF['BlogURL'] . '/' . $customurls->_addLinkParams($link, $linkparams) . '/';
+}
+</pre></blockquote>
+これでタグがURLの一番最後になります<br />
+<br />
+「NP_ContentsList」の場合<br />
+・<code>doSkinVar()</code>の467行目付近、<code>$catdata['catlink']</code>の生成が終了したところでサブカテゴリのリンクを生成する直前、
+<blockquote><pre style="overflow:auto;">// sub category ---
+if ($subcat && (!$subcurrent || $catid == $catdata['catid']) && !$subnoOpen) {
+</pre></blockquote>
+の前の行に
+<blockquote><pre style="overflow:auto;">if ($CONF['URLMode'] == 'pathinfo' && $manager->pluginInstalled('NP_CustomURL')) {
+    $catdata['catlink'] = createCategoryLink($catdata['catid']);
+}
+</pre></blockquote>の一行を追加して、カテゴリのリンクを上書きします<br />
+さらにそこからもう少し下の
+<blockquote><pre style="overflow:auto;">$subdata['sublink'] = addLinkParams($catdata['catlink'], array($subrequest => $subdata['subcatid']));
+</pre></blockquote>
+となっている行の下に
+<blockquote><pre style="overflow:auto;">global $manager;
+if ($CONF['URLMode'] == 'pathinfo' && $manager->pluginInstalled('NP_CustomURL')) {
+    $customurls = $manager->getPlugin('NP_CustomURL');
+    $subdata['sublink'] = $customurls->_addLinkParams($catdata['catlink'], array($subrequest => $subdata['subcatid']));
+}
+</pre></blockquote>
+と追加、350行目付近の<code>$data['self'] = $data['blogurl'];</code>の前に
+<blockquote><pre style="overflow:auto;">if ($CONF['URLMode'] == 'pathinfo' && $manager->pluginInstalled('NP_CustomURL')) {
+    $data['blogurl'] = createBlogidLink($data['blogid']);
+}
+</pre></blockquote>
+を追加して終了です
+
+</p>
diff --git a/trunk/NP_CustomURL/customurl/language/english.php b/trunk/NP_CustomURL/customurl/language/english.php
new file mode 100644 (file)
index 0000000..a73de0b
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+
+//PLUGIN MESSAGES
+       define('_DESCRIPTION',                  'This plugin generates the static link from website URL created by NucleusCMS.');
+       define('_OP_TABLE_DELETE',              'Drop tables on uninstall ?');
+       define('_OP_QUICK_LINK',                'Show in Quick Menu ?');
+       define('_OP_ITEM_PATH',                 'Plugin request URI');
+       define('_OP_BLOG_PATH',                 'Weblog request URI');
+       define('_OP_DEF_ITEM_KEY',              'Default prefix of Item request URI');
+       define('_OP_DEF_CAT_KEY',               'Default prefix of Categories request URI');
+       define('_OP_DEF_SCAT_KEY',              'Default prefix of Subcategories request URI');
+       define('_OP_USE_CURL',                  'Use URI alias in this weblog');
+       define('_OP_CATEGORY_PATH',             'Category request URI');
+       define('_OP_MEMBER_PATH',               'Member request URI');
+       define('_OP_ARCHIVE_DIR_NAME',  'Archive directory request URI');
+       define('_OP_ARCHIVES_DIR_NAME', 'Archives directory request URI');
+       define('_OP_MEMBER_DIR_NAME',   'Member directory request URI');
+       define('_INVALID_ERROR',                '<h2>Invalid path</h2>');
+       define('_INVALID_MSG',                  'Invalid caracter is included.<br /> Available characters are only  [A-Za-z0-9/-(hyphen)/_(underscore)]<br />And also extention is not allowed like [.html]');
+       define('_CONFLICT_ERROR',               '<h2>Specified URI already exists.</h2>');
+       define('_CONFLICT_MSG',                 'Special id is automatically added at the end of URI because specified URI already exists in this weblog.<br /> Please edit again if you want to chage URI.');
+       define('_DELETE_PATH',                  '<h2>Alias was successfully deleted.</h2>');
+       define('_DELETE_MSG',                   'Drop registered URI because of empty setting.<br /> Nomal FancyURL is applied for the link URI.');
+       define('_NO_SUCH_URI',                  'Unable to connect requested URI.<br /> Please check URI and try again.<br />
+Requested URI may exist in the other weblogs.<br />
+In case\81u/category_12/item_123.html\81v url type does not work, try \81u/category/12/item/123\81v. The change may load the contents.');
+       define('_NOT_VALID_BLOG',               'Specified weblog does not exist.');
+       define('_NOT_VALID_ITEM',               'Specified item does not exist.');
+       define('_NOT_VALID_CAT',                'Specified category does not exist.');
+       define('_NOT_VALID_SUBCAT',             'Specified subcategory does not exist.');
+       define('_NOT_VALID_MEMBER',             'Specified member does not exist.');
+       define('_ADMIN_TITLE',                  'URL CUSTOMIZE');
+       define('_QUICK_TIPS',                   'Manage link URI');
+       define('_ERROR_DISALLOWED',             'Access denied.');
+       define('_DISALLOWED_MSG',               'You do not log in or have the permission.');
+       define('_ADMIN_AREA_TITLE',             'Manage link URI');
+       define('_OPTION_SETTING',               'Back to option setting');
+       define('_FOR_ITEMS_SETTING',    'Manage item URI');
+       define('_FOR_MEMBER_SETTING',   'Manage member URI');
+       define('_FOR_CATEGORY_SETTING', 'Manage category URI');
+       define('_FOR_BLOG_SETTING',             'Manage weblog URI');
+       define('_EDIT',                                 'Edit');
+       define('_BLOG_LIST_TITLE',              'Weblog name');
+       define('_BLOG_URI_SETTING',             'Manage weblog access path');
+       define('_BLOG_URI_NAME',                'Weblog access path');
+       define('_BLOG_SETTING',                 'Edit weblogs');
+       define('_ITEM_SETTING',                 'Edit items');
+       define('_CATEGORY_SETTING',             'Edit categories');
+       define('_SUBCATEGORY_SETTING',  'Edit subcategories');
+       define('_MEMBER_SETTING',               'Edit members');
+       define('_LISTS_CAT_NAME',               'Category name/Subcategory name');
+       define('_LISTS_ITEM_DESC',              'Description');
+       define('_LISTS_PATH',                   'Access path');
+       define('_UPDATE_SUCCESS',               'Alias was successfully updated.');
+
+?>
\ No newline at end of file
diff --git a/trunk/NP_CustomURL/customurl/language/japanese-euc.php b/trunk/NP_CustomURL/customurl/language/japanese-euc.php
new file mode 100644 (file)
index 0000000..45f86ff
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+
+//PLUGIN MESSAGES
+       define('_DESCRIPTION',                  'NucleusCMS¤ÇºîÀ®¤·¤¿web¥µ¥¤¥È¤ÎURL¤òÀÅŪ¥ê¥ó¥¯¤È¤·¤ÆÀ¸À®¤·¤Þ¤¹<br />¾Ü¤·¤¯¤Ï¥Ø¥ë¥×¥Ú¡¼¥¸¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤');
+       define('_OP_TABLE_DELETE',              '¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤È¤­¤Ë¥Æ¡¼¥Ö¥ë¤òºï½ü¤·¤Þ¤¹¤«¡©');
+       define('_OP_QUICK_LINK',                '¥¯¥¤¥Ã¥¯¥á¥Ë¥å¡¼¤Ë¥·¥ç¡¼¥È¥«¥Ã¥È¤òÄɲä·¤Þ¤¹¤«¡©');
+       define('_OP_ITEM_PATH',                 '¤³¤Î¥¢¥¤¥Æ¥à¤Î¥ê¥¯¥¨¥¹¥È URI');
+       define('_OP_BLOG_PATH',                 '¤³¤Î¥Ö¥í¥°¤Î¥ê¥¯¥¨¥¹¥È URI');
+       define('_OP_DEF_ITEM_KEY',              '¿·µ¬ºîÀ®»þ¤Î¥¢¥¤¥Æ¥à¤ÎURI¤ÎÀÜƬ¸ì');
+       define('_OP_DEF_CAT_KEY',               '¿·µ¬ºîÀ®»þ¤Î¥«¥Æ¥´¥ê¡¼¤ÎURI¤ÎÀÜƬ¸ì');
+       define('_OP_DEF_SCAT_KEY',              '¿·µ¬ºîÀ®»þ¤Î¥µ¥Ö¥«¥Æ¥´¥ê¡¼¤ÎURI¤ÎÀÜƬ¸ì');
+       define('_OP_USE_CURL',                  '¤³¤Î¥Ö¥í¥°¤Ç URI ¤ÎÊÌ̾¤ò»ÈÍѤ¹¤ë');
+       define('_OP_CATEGORY_PATH',             '¤³¤Î¥«¥Æ¥´¥ê¡¼¤Î¥ê¥¯¥¨¥¹¥È URI');
+       define('_OP_MEMBER_PATH',               '¤³¤Î¥á¥ó¥Ð¡¼¤Î¥ê¥¯¥¨¥¹¥È URI');
+       define('_OP_ARCHIVE_DIR_NAME',  '¥¢¡¼¥«¥¤¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î Path ¤Î̾Á°');
+       define('_OP_ARCHIVES_DIR_NAME', '¥¢¡¼¥«¥¤¥Ö¥ê¥¹¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î Path ¤Î̾Á°');
+       define('_OP_MEMBER_DIR_NAME',   '¥á¥ó¥Ð¡¼¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î Path ¤Î̾Á°');
+       define('_INVALID_ERROR',                '<h2>¥Ñ¥¹¤¬ÉÔÀµ¤Ç¤¹</h2>');
+       define('_INVALID_MSG',                  '¥Ñ¥¹¤ËÉÔÀµ¤Êʸ»úÎ󤬻ØÄꤵ¤ì¤Þ¤·¤¿<br />»ÈÍѤǤ­¤ëʸ»ú¤Ï¡¢[¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È/¿ô»ú/-(¥Ï¥¤¥Õ¥ó)/_(¥¢¥ó¥À¡¼¥Ð¡¼)]¤Î¤ß(¤¹¤Ù¤ÆȾ³Ñ)¤Ç¤¹<br />¤Þ¤¿¡¢ËöÈø¤Ë[.html]Åù¤Î³ÈÄ¥»Ò¤ò¤Ä¤±¤ë¤³¤È¤Ï½ÐÍè¤Þ¤»¤ó');
+       define('_CONFLICT_ERROR',               '<h2>¥Ñ¥¹¤¬½ÅÊ£¤·¤Æ¤¤¤Þ¤¹</h2>');
+       define('_CONFLICT_MSG',                 'Ʊ°ì¥Ö¥í¥°Æâ¤Ë¤¹¤Ç¤Ë¸ºß¤¹¤ë¥Ñ¥¹¤¬»ØÄꤵ¤ì¤¿¤Î¤Ç¡¢¥Ñ¥¹¤ÎËöÈø¤Ë ID ¤¬Éղ䵤ì¤Þ¤·¤¿<br />¥Ñ¥¹¤òÊѹ¹¤¹¤ë¾ì¹ç¤Ï¡¢ºÆÅÙÊÔ½¸¤·¤Æ¤¯¤À¤µ¤¤');
+       define('_DELETE_PATH',                  '<h2>¥¨¥¤¥ê¥¢¥¹Ì¾¤òºï½ü¤·¤Þ¤·¤¿</h2>');
+       define('_DELETE_MSG',                   '¥Ñ¥¹¤È¤·¤Æ¶õÇò¤¬»ØÄꤵ¤ì¤¿¤¿¤á¡¢ÅÐÏ¿ºÑ¤ß¤Î¥Ñ¥¹¤òºï½ü¤·¤Þ¤·¤¿<br />¥ê¥ó¥¯ URI ¤Ë¤ÏÄ̾ï¤Î FancyURLs ¤Î¤â¤Î¤¬Å¬ÍѤµ¤ì¤Þ¤¹');
+       define('_NO_SUCH_URI',                  '¥ê¥¯¥¨¥¹¥È¤µ¤ì¤¿ URI ¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿<br />¤â¤¦°ìÅÙ URI ¤ò¤è¤¯³Î¤«¤á¤Æ¤¯¤À¤µ¤¤<br />¤¢¤ë¤¤¤Ï¡¢¤³¤Î¥µ¥¤¥ÈÆâ¤ÎÊÌ¤Î¥Ö¥í¥°¤«¤â¤·¤ì¤Þ¤»¤ó<br />¥¢¥¯¥»¥¹¤·¤¿URL¤¬¡Ö/category_12/item_123.html¡×¤Î·Á¼°¤À¤Ã¤¿¾ì¹ç¡¢¡Ö/category/12/item/123¡×¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤Èɽ¼¨¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹');
+       define('_NOT_VALID_BLOG',               '»ØÄꤵ¤ì¤¿¥Ö¥í¥°¤Ï¸ºß¤·¤Þ¤»¤ó');
+       define('_NOT_VALID_ITEM',               '»ØÄꤵ¤ì¤¿¥¢¥¤¥Æ¥à¤Ï¸ºß¤·¤Þ¤»¤ó');
+       define('_NOT_VALID_CAT',                '»ØÄꤵ¤ì¤¿¥«¥Æ¥´¥ê¡¼¤Ï¸ºß¤·¤Þ¤»¤ó');
+       define('_NOT_VALID_SUBCAT',             '»ØÄꤵ¤ì¤¿¥µ¥Ö¥«¥Æ¥´¥ê¡¼¤Ï¸ºß¤·¤Þ¤»¤ó');
+       define('_NOT_VALID_MEMBER',             '»ØÄꤵ¤ì¤¿¥á¥ó¥Ð¡¼¤Ï¸ºß¤·¤Þ¤»¤ó');
+       define('_ADMIN_TITLE',                  'URL CUSTOMIZE');
+       define('_QUICK_TIPS',                   '¥ê¥ó¥¯É½¼¨ÍÑ URI ¤Î´ÉÍý');
+       define('_ERROR_DISALLOWED',             '¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤»¤ó');
+       define('_DISALLOWED_MSG',               '¥í¥°¥¤¥ó¤·¤Æ¤¤¤Ê¤¤¤«¡¢¤Þ¤¿¤Ï´ÉÍý¼Ô¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó');
+       define('_ADMIN_AREA_TITLE',             '¥ê¥ó¥¯É½¼¨ÍÑ URI ¤Î´ÉÍý¥Ú¡¼¥¸');
+       define('_OPTION_SETTING',               '¤³¤Î¥×¥é¥°¥¤¥ó¤Î¥ª¥×¥·¥ç¥óÀßÄê¥Ú¡¼¥¸¤Ø°ÜÆ°');
+       define('_FOR_ITEMS_SETTING',    '¥¢¥¤¥Æ¥àÍÑ URI ´ÉÍý¥Ú¡¼¥¸¤Ø');
+       define('_FOR_MEMBER_SETTING',   '¥á¥ó¥Ð¡¼ÍÑ URI ´ÉÍý¥Ú¡¼¥¸¤Ø');
+       define('_FOR_CATEGORY_SETTING', '¥«¥Æ¥´¥ê¡¼ÍÑ URI ´ÉÍý¥Ú¡¼¥¸¤Ø');
+       define('_FOR_BLOG_SETTING',             '¥Ö¥í¥°ÍÑ URI ´ÉÍý¥Ú¡¼¥¸¤Ø');
+       define('_EDIT',                                 'ÊÔ½¸');
+       define('_BLOG_LIST_TITLE',              '¥Ö¥í¥°Ì¾');
+       define('_BLOG_URI_SETTING',             '¥Ö¥í¥°ÍÑ¥¢¥¯¥»¥¹¥Ñ¥¹´ÉÍý');
+       define('_BLOG_URI_NAME',                '¥Ö¥í¥°ÍÑ¥¢¥¯¥»¥¹¥Ñ¥¹');
+       define('_BLOG_SETTING',                 '¥Ö¥í¥°¤ÎÀßÄê¤ÎÊÔ½¸');
+       define('_ITEM_SETTING',                 '¥¢¥¤¥Æ¥à¤ÎÀßÄê¤ÎÊÔ½¸');
+       define('_CATEGORY_SETTING',             '¥«¥Æ¥´¥ê¡¼¤ÎÀßÄê¤ÎÊÔ½¸');
+       define('_SUBCATEGORY_SETTING',  '¥µ¥Ö¥«¥Æ¥´¥ê¡¼¤ÎÀßÄê¤ÎÊÔ½¸');
+       define('_MEMBER_SETTING',               '¥á¥ó¥Ð¡¼¤ÎÀßÄê¤ÎÊÔ½¸');
+       define('_LISTS_CAT_NAME',               '¥«¥Æ¥´¥ê̾/¥µ¥Ö¥«¥Æ¥´¥ê̾');
+       define('_LISTS_ITEM_DESC',              'ËÜʸ¤ÎËÁƬ');
+       define('_LISTS_PATH',                   '¥¢¥¯¥»¥¹ ¥Ñ¥¹');
+       define('_UPDATE_SUCCESS',               '¥¨¥¤¥ê¥¢¥¹Ì¾¤ò¹¹¿·¤·¤Þ¤·¤¿');
+
+?>
\ No newline at end of file
diff --git a/trunk/NP_CustomURL/customurl/language/japanese-utf8.php b/trunk/NP_CustomURL/customurl/language/japanese-utf8.php
new file mode 100644 (file)
index 0000000..fde0151
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+
+//PLUGIN MESSAGES
+       define('_DESCRIPTION',                  'NucleusCMSで作成したwebサイトのURLを静的リンクとして生成します<br />詳しくはヘルプページを参照してください');
+       define('_OP_TABLE_DELETE',              'アンインストールするときにテーブルを削除しますか?');
+       define('_OP_QUICK_LINK',                'クイックメニューにショートカットを追加しますか?');
+       define('_OP_ITEM_PATH',                 'このアイテムのリクエスト URI');
+       define('_OP_BLOG_PATH',                 'このブログのリクエスト URI');
+       define('_OP_DEF_ITEM_KEY',              '新規作成時のアイテムのURIの接頭語');
+       define('_OP_DEF_CAT_KEY',               '新規作成時のカテゴリーのURIの接頭語');
+       define('_OP_DEF_SCAT_KEY',              '新規作成時のサブカテゴリーのURIの接頭語');
+       define('_OP_USE_CURL',                  'このブログで URI の別名を使用する');
+       define('_OP_CATEGORY_PATH',             'このカテゴリーのリクエスト URI');
+       define('_OP_MEMBER_PATH',               'このメンバーのリクエスト URI');
+       define('_OP_ARCHIVE_DIR_NAME',  'アーカイブディレクトリへの Path の名前');
+       define('_OP_ARCHIVES_DIR_NAME', 'アーカイブリストディレクトリへの Path の名前');
+       define('_OP_MEMBER_DIR_NAME',   'メンバーディレクトリへの Path の名前');
+       define('_INVALID_ERROR',                '<h2>パスが不正です</h2>');
+       define('_INVALID_MSG',                  'パスに不正な文字列が指定されました<br />使用できる文字は、[アルファベット/数字/-(ハイフン)/_(アンダーバー)]のみ(すべて半角)です<br />また、末尾に[.html]等の拡張子をつけることは出来ません');
+       define('_CONFLICT_ERROR',               '<h2>パスが重複しています</h2>');
+       define('_CONFLICT_MSG',                 '同一ブログ内にすでに存在するパスが指定されたので、パスの末尾に ID が付加されました<br />パスを変更する場合は、再度編集してください');
+       define('_DELETE_PATH',                  '<h2>エイリアス名を削除しました</h2>');
+       define('_DELETE_MSG',                   'パスとして空白が指定されたため、登録済みのパスを削除しました<br />リンク URI には通常の FancyURLs のものが適用されます');
+       define('_NO_SUCH_URI',                  'リクエストされた URI にアクセスできませんでした<br />もう一度 URI をよく確かめてください<br />あるいは、このサイト内の別のブログかもしれません<br />アクセスしたURLが「/category_12/item_123.html」の形式だった場合、「/category/12/item/123」でアクセスすると表示される可能性があります');
+       define('_NOT_VALID_BLOG',               '指定されたブログは存在しません');
+       define('_NOT_VALID_ITEM',               '指定されたアイテムは存在しません');
+       define('_NOT_VALID_CAT',                '指定されたカテゴリーは存在しません');
+       define('_NOT_VALID_SUBCAT',             '指定されたサブカテゴリーは存在しません');
+       define('_NOT_VALID_MEMBER',             '指定されたメンバーは存在しません');
+       define('_ADMIN_TITLE',                  'URL CUSTOMIZE');
+       define('_QUICK_TIPS',                   'リンク表示用 URI の管理');
+       define('_ERROR_DISALLOWED',             'アクセスできません');
+       define('_DISALLOWED_MSG',               'ログインしていないか、または管理者権限がありません');
+       define('_ADMIN_AREA_TITLE',             'リンク表示用 URI の管理ページ');
+       define('_OPTION_SETTING',               'このプラグインのオプション設定ページへ移動');
+       define('_FOR_ITEMS_SETTING',    'アイテム用 URI 管理ページへ');
+       define('_FOR_MEMBER_SETTING',   'メンバー用 URI 管理ページへ');
+       define('_FOR_CATEGORY_SETTING', 'カテゴリー用 URI 管理ページへ');
+       define('_FOR_BLOG_SETTING',             'ブログ用 URI 管理ページへ');
+       define('_EDIT',                                 '編集');
+       define('_BLOG_LIST_TITLE',              'ブログ名');
+       define('_BLOG_URI_SETTING',             'ブログ用アクセスパス管理');
+       define('_BLOG_URI_NAME',                'ブログ用アクセスパス');
+       define('_BLOG_SETTING',                 'ブログの設定の編集');
+       define('_ITEM_SETTING',                 'アイテムの設定の編集');
+       define('_CATEGORY_SETTING',             'カテゴリーの設定の編集');
+       define('_SUBCATEGORY_SETTING',  'サブカテゴリーの設定の編集');
+       define('_MEMBER_SETTING',               'メンバーの設定の編集');
+       define('_LISTS_CAT_NAME',               'カテゴリ名/サブカテゴリ名');
+       define('_LISTS_ITEM_DESC',              '本文の冒頭');
+       define('_LISTS_PATH',                   'アクセス パス');
+       define('_UPDATE_SUCCESS',               'エイリアス名を更新しました');
+
+?>
\ No newline at end of file