{"id":136544,"date":"2011-02-25T07:18:02","date_gmt":"2011-02-24T22:18:02","guid":{"rendered":"https:\/\/ja.wordpress.org\/support\/2011\/02\/25\/ajaxcachephp%e3%82%a8%e3%83%a9%e3%83%bc\/"},"modified":"2011-02-25T07:18:02","modified_gmt":"2011-02-24T22:18:02","slug":"ajaxcachephp%e3%82%a8%e3%83%a9%e3%83%bc","status":"closed","type":"topic","link":"https:\/\/ja.wordpress.org\/support\/topic\/ajaxcachephp%e3%82%a8%e3%83%a9%e3%83%bc\/","title":{"rendered":"Ajax,cache.php\u30a8\u30e9\u30fc"},"content":{"rendered":"<p>\u30d5\u30ebAjax\u3067\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30e1\u30f3\u30c8\u3092\u6295\u7a3f\u3057\u305f\u3068\u304d\u3001\u8a72\u5f53\u30b3\u30e1\u30f3\u30c8\u3060\u3051\u3092\u8fd4\u3057\u3066\u7d42\u4e86\u3059\u308b\u3088\u3046\u306b\u4f5c\u3063\u3066\u3044\u307e\u3059\u304c\u3001<br \/>\n\u6295\u7a3f\u6642\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>add_action(&#8216;comment_post&#8217;, &#8216;myFunction&#8217;);<br \/>\n\u306e\u5f62\u3067\u30d5\u30c3\u30af\u3057\u3066\u3044\u307e\u3059\u304c\u3001<br \/>\n\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306b\u3088\u308b\u3068comment_post\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3059\u308b\u76f4\u524d\u306b\u30d5\u30c3\u30af\u3059\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3001<br \/>\n\u3053\u308c\u304c\u60aa\u3055\u3092\u3057\u3066\u3044\u308b\u306e\u3067\u3057\u3087\u3046\u304b\u3002<br \/>\n\u3082\u3057\u305d\u3046\u306a\u3089\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3057\u305f\u76f4\u5f8c\u306b\u30d5\u30c3\u30af\u3059\u308bAPI\u304b\u3001<br \/>\n\u4f55\u304b\u5225\u306e\u826f\u3044\u65b9\u6cd5\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u53c2\u8003\u306b\u3001\u30b3\u30fc\u30c9\u306e\u8a72\u5f53\u90e8\u5206\uff08\u4e00\u90e8\u7de8\u96c6\uff09\u3067\u3059\u3002<\/p>\n<p>&#8212;-function.php<\/p>\n<pre><code>function myFunction($arg){\n    global $myComments;\n    if(isset($_REQUEST[&#039;ajax&#039;])):\n        $q=$_REQUEST[&#039;ajax&#039;];\n        if($q==&#039;comment&#039;){\n        $myComments=$arg;\n        include(TEMPLATEPATH .&#039;\/lib\/comment-post.php&#039;);\n    }else{\n    }\n    exit();\n    endif;\n}\n\n----lib\/comment-post.php\n\nglobal $myComments;\n$args=array(ID=&gt;$myComments);\n$comment = get_comment($args);\nif($comment) {\n?&gt;\ndata={\nid:&#039;&lt;?php echo $myComments; ?&gt;&#039;,\nname:&#039;&lt;?php echo $comment-&gt;comment_author; ?&gt;&#039;,\navatar:&#039;&lt;?php echo get_avatar( $comment, 64 ); ?&gt;&#039;,\nscript:&#039;&lt;?php echo $comment-&gt;comment_content; ?&gt;&#039;,\ndate:&#039;&lt;?php echo $comment-&gt;comment_date; ?&gt;&#039;,\ntime:&#039;&lt;?php echo $comment-&gt;comment_date; ?&gt;&#039;\n};\n&lt;?php\n} \/\/if($comment)\n?&gt;<\/code><\/pre>\n<p>\u30a8\u30e9\u30fc\u5185\u5bb9\uff1a<br \/>\n&lt;b&gt;Warning&lt;\/b&gt;:  Illegal offset type in isset or empty in &lt;b&gt;\/path\/wp-includes\/cache.php&lt;\/b&gt; on line &lt;b&gt;352&lt;\/b&gt;<\/p>\n<p>&lt;b&gt;Warning&lt;\/b&gt;:  Illegal offset type in isset or empty in &lt;b&gt;\/path\/wp-includes\/cache.php&lt;\/b&gt; on line &lt;b&gt;360&lt;\/b&gt;<\/p>\n<p>&lt;b&gt;Warning&lt;\/b&gt;:  Illegal offset type in &lt;b&gt;\/path\/wp-includes\/cache.php&lt;\/b&gt; on line &lt;b&gt;363&lt;\/b&gt;<\/p>\n<p>\u53b3\u5bc6\u306b\u306f\u30a8\u30e9\u30fc\u3067\u306f\u306a\u3044\u3067\u3059\u304c\u3001\u3001\u3001<br \/>\nWarning\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u5f8c\u306b\u3001comment-post.php\u306b\u3088\u308bdata={&#8230;}\u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"template":"","class_list":["post-136544","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\/136544","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\/136544\/revisions"}],"wp:attachment":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=136544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}