{"id":3186,"date":"2014-06-04T11:45:42","date_gmt":"2014-06-04T02:45:42","guid":{"rendered":"http:\/\/www.lancard.com\/blog\/?p=3186"},"modified":"2025-03-12T11:28:44","modified_gmt":"2025-03-12T02:28:44","slug":"basercms3%e7%b3%bb%e3%81%a7%e3%81%ae%e3%82%b5%e3%82%a4%e3%83%88%e3%83%9e%e3%83%83%e3%83%97%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%9e%e3%82%a4%e3%82%ba","status":"publish","type":"post","link":"https:\/\/www.lancard.com\/blog\/2014\/06\/04\/basercms3%e7%b3%bb%e3%81%a7%e3%81%ae%e3%82%b5%e3%82%a4%e3%83%88%e3%83%9e%e3%83%83%e3%83%97%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%9e%e3%82%a4%e3%82%ba\/","title":{"rendered":"baserCMS3\u7cfb\u3067\u306e\u30b5\u30a4\u30c8\u30de\u30c3\u30d7\u30ab\u30b9\u30bf\u30de\u30a4\u30ba"},"content":{"rendered":"<p>bserCMS3\u7cfb\u3078\u306e\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u304b\u3089\u306f\u3084\u534a\u5e74\u4ee5\u4e0a\u3001\u3084\u3063\u3068\u5f0a\u793e\u30b5\u30a4\u30c8\u30922.1.1\u304b\u30893.0.2\u3078\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u30d0\u30ea\u30d0\u30ea\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u3066\u3044\u308b\u306e\u3067\u8170\u304c\u5f15\u3051\u3066\u3044\u305f\u306e\u3067\u3059\u3002<\/p>\n<p>\u65ec\u3092\u5916\u3057\u3066\u3044\u305f\u308a\u3001\u30a4\u30ec\u30ae\u30e5\u30e9\u30fc\u306a\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3092\u3084\u3063\u3066\u3044\u305f\u308a\u3067\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u306b\u306f\u304b\u306a\u308a\u82e6\u52b4\u3057\u305f\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u8a71\u306f\u6b21\u306b\u3068\u3063\u3066\u304a\u304d\u307e\u3057\u3066\u3001\u307e\u305a\u306f\u4ee5\u524d\u66f8\u3044\u305f<a href=\"http:\/\/www.lancard.com\/blog\/2012\/06\/26\/basercms\u306e\u30b5\u30a4\u30c8\u30de\u30c3\u30d7\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\/\" title=\"baserCMS\u306e\u30b5\u30a4\u30c8\u30de\u30c3\u30d7\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\">\u300ebaserCMS\u306e\u30b5\u30a4\u30c8\u30de\u30c3\u30d7\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u300f<\/a>\u306e\u30d5\u30a9\u30ed\u30fc\u3092\u3002<\/p>\n<p>\u4e0a\u8a18\u8a18\u4e8b\u306e\u30b3\u30fc\u30c9\u3067\u3059\u304c\u3001\u30a2\u30c9\u30aa\u30f3\u30de\u30a4\u30b0\u30ec\u30fc\u30bf\u30fc(<a href=\"http:\/\/barket.jp\/products\/detail.php?product_id=11\" title=\"\u30a2\u30c9\u30aa\u30f3\u30de\u30a4\u30b0\u30ec\u30fc\u30bf\u30fc\" target=\"_blank\">http:\/\/barket.jp\/products\/detail.php?product_id=11<\/a>)\u3067\u30c6\u30fc\u30de\u3092\u5909\u63db\u3057\u305f\u3060\u3051\u3067\u306f(\u3084\u306f\u308a)\u52d5\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n<p>\u5c11\u3057\u4fee\u6b63\u304c\u5fc5\u8981\u3067\u3057\u305f\u306e\u3067\u4fee\u6b63\u5f8c\u306e\u5f0a\u793e\u306e\u30b5\u30a4\u30c8\u30de\u30c3\u30d7\u306e\u30b3\u30fc\u30c9\u3092\u7f6e\u3044\u3066\u304a\u304d\u307e\u3059\u3002\u53c2\u8003\u306b\u3069\u3046\u305e\u3002<\/p>\n<pre lang=\"php\">\r\n<?php\r\n\/**\r\n * [PUBLISH] \u30b5\u30a4\u30c8\u30de\u30c3\u30d7\r\n * \r\n * \u30ab\u30c6\u30b4\u30ea\u306e\u968e\u5c64\u69cb\u9020\u3092\u8868\u73fe\u3059\u308b\u70ba\u3001\u518d\u5e30\u547c\u3073\u51fa\u3057\u3092\u884c\u3046\r\n * $this->BcBaser->sitemap() \u3067\u547c\u3073\u51fa\u3059\r\n *\/\r\n\/\/\u3053\u3053\u304b\u3089\u8a2d\u5b9a\r\n\/\/\u8868\u793a\u3057\u306a\u3044url\r\n$disables = array(\r\n'\/index_test',\r\n);\r\n\r\n\/\/$inserts = array(before_url=>array(title, url),,,)\r\n\/\/before_url\u306e\u6b21\u306b\u633f\u5165url,title\u3067\u4f5c\u6210\u3057\u305f\u30a2\u30a4\u30c6\u30e0\u3092\u633f\u5165\r\n\/\/\u30d6\u30ed\u30b0\u3001\u30e1\u30fc\u30eb\u30d5\u30a9\u30fc\u30e0\u306a\u3069page\u4ee5\u5916\u3092\u9014\u4e2d\u306b\u633f\u5165\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u308b\u3002\r\n$inserts = array(\r\n'\/sitemap' => array('\u65b0\u7740\u60c5\u5831', '\/news'),\r\n'\/news' => array('\u304a\u554f\u3044\u5408\u308f\u305b', '\/contact'),\r\n'\/it-model\/faq' => array('\u30c0\u30a6\u30f3\u30b5\u30a4\u30b8\u30f3\u30b0\u306b\u3064\u3044\u3066\u306e\u304a\u554f\u3044\u5408\u308f\u305b', '\/contact_itmodel'),\r\n'\/roundcube\/faq' => array('Roundcube\u306b\u3064\u3044\u3066\u306e\u304a\u554f\u3044\u5408\u308f\u305b', '\/contact_roundcube'),\r\n'\/kolab\/faq' => array('Kolab\u306b\u3064\u3044\u3066\u306e\u304a\u554f\u3044\u5408\u308f\u305b', '\/contact_kolab'),\r\n);\r\n\/\/\u8a2d\u5b9a\u3053\u3053\u307e\u3067\r\n\r\n\/\/\u95a2\u6570\r\n$bcBaser = $this->BcBaser;\r\n$outputPageItem = function ($recursive, $title, $url) use (&$bcBaser) {\r\n?><li class=\"sitemap-category li-level-<?php echo $recursive ?>\"><?php $bcBaser->link($title, $url) ?><\/li><?php\r\necho PHP_EOL;\r\n};\r\n$outputCategoryItemHead = function ($recursive, $title='', $url='') use (&#038;$bcBaser) {\r\n?><li class=\"sitemap-page li-level-<?php echo $recursive ?>\"><?php\r\nif($url !== ''):\r\n$bcBaser->link($title, $url);\r\nelse:\r\necho $category_title;\r\nendif;\r\necho PHP_EOL;\r\n};\r\n$outputCategoryItemTail = function () {\r\n?><\/li><?php\r\necho PHP_EOL;\r\n};\r\n$getPageItemTitle = function ($page_record) {\r\nif($page_record['title'] !== '') {\r\n$title = $page_record['title'];\r\n} else {\r\n$title = $page_record['name'];\r\n}\r\nreturn $title;\r\n};\r\n\r\n$insertPageItem = function (&#038;$before_url, $recursive) use ($inserts, &#038;$outputPageItem, &#038;$insertPageItem) {\r\nif(array_key_exists($before_url, $inserts)) {\r\n$outputPageItem($recursive, $inserts[$before_url][0], $inserts[$before_url][1]);\r\n$before_url = $inserts[$before_url][1];\r\n$insertPageItem($before_url, $recursive);\r\n}\r\n};\r\n\r\n\/\/\u521d\u671f\u5316\r\nif(!isset($recursive)) {\r\n$recursive = 1;\r\n}\r\nif(!isset($category_title)) {\r\n$category_title = '';\r\n}\r\nif(!isset($category_url)) {\r\n$category_url = '';\r\n}\r\n$title = '';\r\n$url = '';\r\n$prefix = '';\r\nif(Configure::read('BcRequest.agent')) {\r\n$prefix = '\/'.Configure::read('BcRequest.agentAlias');\r\n}\r\n\r\n\/\/\u3053\u3053\u304b\u3089\u30e1\u30a4\u30f3\r\n?>\r\n\r\n<ul class=\"sitemap section ul-level-<?php echo $recursive ?>\">\r\n<?php\r\n\/\/print_r($pageList);\r\n\/\/\u30ab\u30c6\u30b4\u30ea\u672a\u767b\u9332\u306e\u6700\u4e0a\u5c64\u306b\u3042\u308b\u30da\u30fc\u30b8\u7fa4\r\nif(isset($pageList['pages'])):\r\n$before_url = $category_url;\r\nforeach($pageList['pages'] as $page):\r\n$insertPageItem($before_url, $recursive);\r\n$title = $getPageItemTitle($page['Page']);\r\nif(\r\n!in_array($page['Page']['url'], $disables)\/\/\u8868\u793a\u3057\u306a\u3044\u30ea\u30b9\u30c8\u306b\u306a\u3044\r\n&#038;&#038; ($page['Page']['url'] != $category_url || $title != $category_title)\/\/\u30ab\u30c6\u30b4\u30ea\u30fc\u3068\u540c\u5185\u5bb9\u3067\u306f\u306a\u3044\r\n){\r\n$outputPageItem($recursive, $title, $prefix.$page['Page']['url']);\r\n$before_url = $page['Page']['url'];\r\n}\r\nendforeach;\r\n$insertPageItem($before_url, $recursive);\r\nendif;\r\nif(isset($pageList['pageCategories'])):\r\nforeach($pageList['pageCategories'] as $pageCategories):\r\n$outputed_category_li = false;\/\/\u30ab\u30c6\u30b4\u30ea\u306eli\u304c\u51fa\u529b\u3055\u308c\u305f\u304b\u306e\u30d5\u30e9\u30b0\r\n$category_title = $pageCategories['PageCategory']['title'];\r\nif(!empty($pageCategories['PageCategory']['url'])):\r\n$category_url = $pageCategories['PageCategory']['url'];\r\n$outputed_category_li = true;\r\n$outputCategoryItemHead($recursive, $category_title, $prefix.$category_url);\r\nelse:\r\n$category_url = '';\r\nif(isset($pageCategories['children'])): \r\n$outputed_category_li = true;\r\n$outputCategoryItemHead($recursive, $category_title);\r\nendif;\r\nendif;\r\nif(isset($pageCategories['children'])): ?>\r\n<?php\r\n\/\/\u518d\u5e30\u547c\u3073\u51fa\u3057\r\n$this->BcBaser->element('sitemap', array(\r\n'pageList' => $pageCategories['children'],\r\n'category_title' => $category_title,\r\n'category_url' => $category_url,\r\n'recursive' => $recursive+1\r\n));\r\nendif;\r\nif($outputed_category_li):\r\n$outputCategoryItemTail();\r\nendif;\r\nendforeach;\r\nendif; ?>\r\n<\/ul>\r\n\r\n<\/pre>\n<p>\u30dd\u30a4\u30f3\u30c8\u306f\u300c$bcBaser = $this->BcBaser;\u300d\u3057\u3066$bcBaser\u3092\u7121\u5f62\u95a2\u6570\u306b\u6e21\u3057\u3066\u4f7f\u7528\u3059\u308b\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3186&#038;t=baserCMS3%E7%B3%BB%E3%81%A7%E3%81%AE%E3%82%B5%E3%82%A4%E3%83%88%E3%83%9E%E3%83%83%E3%83%97%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%9E%E3%82%A4%E3%82%BA&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3186&#038;p&#091;images&#093;&#091;0&#093;=&#038;p&#091;title&#093;=baserCMS3%E7%B3%BB%E3%81%A7%E3%81%AE%E3%82%B5%E3%82%A4%E3%83%88%E3%83%9E%E3%83%83%E3%83%97%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%9E%E3%82%A4%E3%82%BA\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"http:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3186&#038;text=baserCMS3%E7%B3%BB%E3%81%A7%E3%81%AE%E3%82%B5%E3%82%A4%E3%83%88%E3%83%9E%E3%83%83%E3%83%97%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%9E%E3%82%A4%E3%82%BA\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3186&#038;title=baserCMS3%E7%B3%BB%E3%81%A7%E3%81%AE%E3%82%B5%E3%82%A4%E3%83%88%E3%83%9E%E3%83%83%E3%83%97%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%9E%E3%82%A4%E3%82%BA\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-tumblr nolightbox\" data-provider=\"tumblr\" target=\"_blank\" rel=\"nofollow\" title=\"Share on tumblr\" href=\"https:\/\/tumblr.com\/share?s=&#038;v=3&#038;t=baserCMS3%E7%B3%BB%E3%81%A7%E3%81%AE%E3%82%B5%E3%82%A4%E3%83%88%E3%83%9E%E3%83%83%E3%83%97%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%9E%E3%82%A4%E3%82%BA&#038;u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3186\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"tumblr\" title=\"Share on tumblr\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/tumblr.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=baserCMS3%E7%B3%BB%E3%81%A7%E3%81%AE%E3%82%B5%E3%82%A4%E3%83%88%E3%83%9E%E3%83%83%E3%83%97%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%9E%E3%82%A4%E3%82%BA&#038;body=%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%99%E3%82%8B%EF%BC%9A:%20https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3186\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>bserCMS3\u7cfb\u3078\u306e\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u304b\u3089\u306f\u3084\u534a\u5e74\u4ee5\u4e0a\u3001\u3084\u3063\u3068\u5f0a\u793e\u30b5\u30a4\u30c8\u30922.1.1\u304b\u30893.0.2\u3078\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002 \u30d0\u30ea\u30d0\u30ea\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u3066\u3044\u308b\u306e\u3067\u8170\u304c\u5f15\u3051\u3066\u3044\u305f\u306e\u3067\u3059\u3002 \u65ec\u3092\u5916\u3057\u3066\u3044\u305f\u308a\u3001\u30a4\u30ec\u30ae\u30e5 [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[72,24],"class_list":["post-3186","post","type-post","status-publish","format-standard","hentry","category-php","tag-basercms","tag-cakephp"],"_links":{"self":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/3186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/comments?post=3186"}],"version-history":[{"count":10,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/3186\/revisions"}],"predecessor-version":[{"id":3493,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/3186\/revisions\/3493"}],"wp:attachment":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/media?parent=3186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/categories?post=3186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/tags?post=3186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}