{"id":1617,"date":"2012-04-21T14:22:07","date_gmt":"2012-04-21T05:22:07","guid":{"rendered":"http:\/\/codaholic.org\/?p=1617"},"modified":"2020-08-23T15:42:10","modified_gmt":"2020-08-23T06:42:10","slug":"movable-typephp%e3%81%8b%e3%82%89%e7%89%b9%e5%ae%9a%e3%81%aeid%e3%81%ae%e8%a8%98%e4%ba%8b%e3%81%ae%e3%82%bf%e3%82%a4%e3%83%88%e3%83%ab%e3%80%81%e6%9c%ac%e6%96%87%e3%80%81%e3%82%b9%e3%83%86%e3%83%bc","status":"publish","type":"post","link":"https:\/\/codaholic.org\/?p=1617","title":{"rendered":"[Movable Type] PHP \u304b\u3089\u7279\u5b9a\u306e ID \u306e\u8a18\u4e8b\u306e\u30bf\u30a4\u30c8\u30eb\u3001\u672c\u6587\u3001\u30b9\u30c6\u30fc\u30bf\u30b9\u7b49\u3092\u542b\u3093\u3060\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u5f97\u3059\u308b"},"content":{"rendered":"<p>Movable Type \u306f Perl \u3067\u4f5c\u3089\u308c\u3066\u3044\u307e\u3059\u304c\u3001PHP \u304b\u3089\u3082\u30c7\u30fc\u30bf\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002\u601d\u3063\u3066\u3044\u305f\u3088\u308a\u3082\u7c21\u5358\u306b PHP \u304b\u3089\u6307\u5b9a\u3057\u305f ID \u306e\u8a18\u4e8b\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u306e\u3067\u3001\u4e0b\u8a18\u306b\u8a18\u8f09\u3057\u307e\u3059\u3002\u52d5\u4f5c\u78ba\u8a8d\u3092\u884c\u3063\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u306f MTOS 5.12 \u3067\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u524d\u63d0\u3068\u3057\u3066 MT \u306e\u69cb\u6210\u30d5\u30a1\u30a4\u30eb\u306f DocumentRoot\/mt \u306b\u8a2d\u7f6e\u3055\u308c\u3066\u304a\u308a\u3001\u4e0b\u8a18\u306e PHP \u30d5\u30a1\u30a4\u30eb\u306f DocumentRoot \u306b\u8a2d\u7f6e\u3055\u308c\u308b\u3082\u306e\u3068\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-php\">&lt;?php\n    \/\/ MT\u306e\u30c7\u30fc\u30bf\u3092PHP\u304b\u3089\u6271\u3046\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002\n    require_once 'mt\/php\/mt.php';\n    require_once 'mt\/php\/lib\/MTUtil.php';\n\n    \/\/ \u53d6\u5f97\u3057\u305f\u3044\u8a18\u4e8b\u304c\u6240\u5c5e\u3057\u3066\u3044\u308b\u30d6\u30ed\u30b0\u306eID\u3068\u3001\u8a18\u4e8b\u306eID\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\n    $blog_id = 2;\n    $entry_id = 100;\n\n    \/\/ MT\u306e\u30c7\u30fc\u30bf\u3092\u6271\u3046\u305f\u3081\u306e\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\n    $mt = MT::get_instance($blog_id, 'mt\/mt-config.cgi');\n\n    \/\/ \u8a18\u4e8b\u306e\u53d6\u5f97\u306b\u4f7f\u3046\u30e1\u30bd\u30c3\u30c9\u306b\u6e21\u3059\u5f15\u6570\u3092\u6e96\u5099\u3057\u307e\u3059\u3002\n    \/\/ limit\u306f\u53d6\u5f97\u3059\u308b\u4ef6\u6570\u3067\u3059\u3002\u4eca\u56de\u306f1\u4ef6\u3060\u3051\u53d6\u5f97\u3057\u307e\u3059\u3002\n    $args['blog_id'] = $blog_id;\n    $args['entry_id'] = $entry_id;\n    $args['limit'] = 1;\n\n    \/\/ fetch_entries\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u60c5\u5831\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\n    \/\/ $entries\u306b\u306f\u53d6\u5f97\u3057\u305f\u8a18\u4e8b\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u914d\u5217\u3068\u3057\u3066\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002\n    $entries = $mt-&gt;db()-&gt;fetch_entries($args);\n\n    \/\/ \u4e2d\u8eab\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u4eca\u56de\u306f1\u4ef6\u3060\u3051\u306e\u53d6\u5f97\u306a\u306e\u30670\u756a\u76ee\u3060\u3051\u306b\u60c5\u5831\u304c\u5165\u3063\u3066\u3044\u307e\u3059\u3002\n    var_dump($entries[0]);\n<\/code><\/pre>\n<p>Movable Type\u3092PHP\u304b\u3089\u64cd\u4f5c\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3001\u3042\u307e\u308a\u60c5\u5831\u304c\u51fa\u56de\u3063\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u3002PHP\u304b\u3089MT\u3092\u64cd\u4f5c\u3067\u304d\u305f\u3089\u78ba\u5b9f\u306b\u4fbf\u5229\u306a\u306e\u3067\u3001\u3044\u308d\u3044\u308d\u3068\u8abf\u67fb\u3092\u3057\u3066\u8a18\u4e8b\u306b\u3057\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Movable Type \u306f Perl \u3067\u4f5c\u3089\u308c\u3066\u3044\u307e\u3059\u304c\u3001PHP \u304b\u3089\u3082\u30c7\u30fc\u30bf\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002\u601d\u3063\u3066\u3044\u305f\u3088\u308a\u3082\u7c21\u5358\u306b PHP \u304b\u3089\u6307\u5b9a\u3057\u305f ID \u306e\u8a18\u4e8b\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[10,4],"tags":[249,244],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8gd1W-q5","_links":{"self":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts\/1617"}],"collection":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1617"}],"version-history":[{"count":11,"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts\/1617\/revisions"}],"predecessor-version":[{"id":2419,"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts\/1617\/revisions\/2419"}],"wp:attachment":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1617"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}