{"id":345,"date":"2009-04-24T13:34:00","date_gmt":"2009-04-24T05:34:00","guid":{"rendered":""},"modified":"2013-11-27T21:02:19","modified_gmt":"2013-11-27T13:02:19","slug":"phpcms2008%e9%9d%99%e6%80%81%e9%a1%b5%e7%94%a8ajax%e8%b0%83%e7%94%a8%e8%af%84%e8%ae%ba","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/345.html","title":{"rendered":"Phpcms2008\u9759\u6001\u9875\u7528AJAX\u8c03\u7528\u8bc4\u8bba"},"content":{"rendered":"<p>\u5177\u4f53\u64cd\u4f5c\u6b65\u9aa4\u5982\u4e0b\uff1a<br \/>\n\u7b2c\u4e00\u6b65\uff1a\u4fee\u6539templates\/default\/phpcms\/show.html\u5373\u6587\u7ae0\u5185\u5bb9\u9875\u6a21\u677f<br \/>\n\u5728\u4f60\u6240\u60f3\u663e\u793a\u6700\u65b0\u8bc4\u8bba\u7684\u5730\u65b9\u52a0\u4e0a\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n<p>\u4ee3\u7801:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;div style=&quot;width:98%; margin:0 5px;&quot;&gt;\r\n&lt;style type=&quot;text\/css&quot;&gt;\r\n.titlew3zz{font-weight:bold; font-size:14px; background-color:#E4F3FC; color:#FF0000; height:30px; line-height:30px;}\r\n.commentbox{ border:1px solid #bde3fd; margin-top:10px;}\r\n.commenthead{ background:#EDF8FE; color:#09c; border:1px solid #fff; line-height:26px; height:26px; padding:0 6px;}\r\n.reply{ border:1px solid #bde3fd; border-left-width:5px; padding:5px 10px; font-size:12px; margin:10px auto; text-indent:0; line-height:180%; color:#454545;}\r\n.reply p{ margin:2px auto; text-indent:2em; line-height:150%;font-size:12px;}\r\n&lt;\/style&gt;\r\n&lt;div class=&quot;titlew3zz&quot;&gt;\u6700\u65b0\u5341\u6761\u8bc4\u8bba&lt;\/div&gt;\r\n{get sql=&quot;SELECT content,username,ip,addtime FROM `phpcms_comment` where keyid='$keyid' order by commentid desc&quot; rows=&quot;10&quot;}\r\n&lt;?php\r\n$r&#x5B;'content'] = str_replace( '&#x5B;quote]', '&lt;div class=&quot;reply&quot;&gt;', $r&#x5B;'content']);\r\n$r&#x5B;'content'] = str_replace( '&#x5B;blue]', '&lt;div href=&quot;#&quot; class =&quot;blue&quot;&gt;&lt;p&gt;', $r&#x5B;'content']);\r\n$r&#x5B;'content'] = str_replace( '&#x5B;\/quote]', '&lt;\/div&gt;', $r&#x5B;'content']);\r\n$r&#x5B;'content'] = str_replace( '&#x5B;\/blue]', '&lt;\/p&gt;&lt;\/div&gt;', $r&#x5B;'content']);\r\n?&gt;\r\n&lt;div class=&quot;commentbox&quot;&gt;\r\n   &lt;div class=&quot;commenthead&quot;&gt;&lt;span class=&quot;f_r&quot;&gt;{$r&#x5B;username]} \u53d1\u8868\u4e8e{date(&quot;Y-m-d H:i:s&quot;,$r&#x5B;addtime])}&lt;\/span&gt;&lt;strong&gt;{$r&#x5B;'ip_area']} IP\uff1a{$r&#x5B;'ip']}&lt;\/strong&gt;&lt;span&gt;{$r&#x5B;'url']}&lt;\/span&gt;&lt;\/div&gt;\r\n   &lt;div class=&quot;commenttext&quot;&gt;\r\n   {$r&#x5B;'content']}\r\n&lt;\/div&gt;\r\n&lt;\/div&gt;\r\n{\/get}\r\n   &lt;\/div&gt;\r\n<\/pre>\n<p>\u6309\u7167\u6211\u7684\u6548\u679c\u56fe\u662f\u52a0\u5728\uff1a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;div id=&quot;commnent_tag&quot;&gt;\r\n       &lt;a href=&quot;{$MODULE&#x5B;comment]&#x5B;url]}?keyid={$keyid}&amp;verify={$verify}&quot;&gt;&lt;img src=&quot;images\/comment.gif&quot; \/&gt;\r\n       \u5df2\u6709&lt;strong class=&quot;c_red&quot;&gt;&lt;span id=&quot;comments&quot;&gt;0&lt;\/span&gt;&lt;\/strong&gt;\u4f4d\u7f51\u53cb\u53d1\u8868\u4e86\u770b\u6cd5&lt;\/a&gt;\r\n   &lt;\/div&gt;\r\n<\/pre>\n<p>\u6b64\u6bb5\u4ee3\u7801\u540e\u9762\u7684\uff0c\u8bf7\u6309\u7167\u81ea\u5df1\u7684\u60f3\u6cd5\u8c03\u6574\u3002<br \/>\n\u8fd9\u91cc\u9762\u5305\u62ecCSS\u90fd\u662f\u5b8c\u6574\u7684\uff0c\u6240\u4ee5\u64cd\u4f5c\u66f4\u7b80\u5355\u4e86\u2026\u2026<br \/>\n\u5728<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;input type=&quot;hidden&quot; name=&quot;verify&quot; value=&quot;{$verify}&quot;\/&gt;\r\n<\/pre>\n<p>\u540e\u9762\u52a0\u4e0a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;input name=&quot;contentid&quot; type=&quot;hidden&quot; id=&quot;url&quot; value=&quot;{$contentid}&quot; \/&gt;\r\n<\/pre>\n<p>\u5728\u6b64\u6b64\u6a21\u677f\u4fee\u6539\u5b8c\u6bd5\uff0c\u4fee\u6539\u5b8c\u8fd9\u91cc\uff0c\u6211\u4eec\u8fd8\u8981\u5728templates\/default\/phpcms\/header.html\u5373\u7cfb\u7edf\u5934\u90e8\u6587\u4ef6\u6a21\u677f\u91cc\u9762\u52a0\u4e0a\u4e00\u53e5\u4ee3\u7801<br \/>\n\u5728<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;meta content=&quot;{$head&#x5B;keywords]}&quot; name=&quot;keywords&quot; \/&gt;\r\n<\/pre>\n<p>\u540e\u9762\u52a0\u4e0a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;meta http-equiv=&quot;Pragma&quot; content=&quot;no-cache&quot; \/&gt;\r\n<\/pre>\n<p>\u6b64\u4e3e\u7684\u4f5c\u7528\u5728\u6b64\u7981\u6b62\u6d4f\u89c8\u5668\u8bbf\u95ee\u7f13\u5b58\u6587\u4ef6\uff0c\u5728\u6d4b\u8bd5\u8fc7\u7a0b\u4e2d\u53d1\u73b0\uff0c\u6d4f\u89c8\u8bbf\u95ee\u7f13\u5b58\u6587\u4ef6\u4f1a\u5f71\u54cd\u5230\u5373\u65f6\u66f4\u65b0\uff0c\u5176\u5b9e\u5df2\u7ecf\u66f4\u65b0\u5185\u5bb9\u9875\uff0c\u4f46\u662f\u7531\u4e8e\u6d4f\u89c8\u5668\u8bbf\u95ee\u7f13\u5b58\u6587\u4ef6\uff0c\u81f4\u4f7f\u6211\u4eec\u9700\u8981\u5728\u5185\u5bb9\u9875\u5237\u65b0\u4e00\u4e0b\u624d\u80fd\u770b\u5230\u6700\u65b0\u7684\u5185\u5bb9\u9875\u5185\u5bb9\uff0c\u52a0\u4e0a\u6b64\u4ee3\u7801\uff0c\u5c31\u4e0d\u4f1a\u51fa\u73b0\u6b64\u72b6\u51b5\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65\uff1a\u4fee\u6539comment\/comment.php\u8bc4\u8bba\u7a0b\u5e8f\u6587\u4ef6<br \/>\n\u5728<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n$comments = new comment();\r\n<\/pre>\n<p>\u540e\u9762\u52a0\u4e0a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\nrequire_once PHPCMS_ROOT.'\/include\/html.class.php';\r\n$html = new html;\r\n<\/pre>\n<p>\u5728<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\nif($comments-&gt;add($commentid, $content, $keyid))\r\n<\/pre>\n<p>\u540e\u9762\u52a0\u4e0a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n$w3zz=explode(&quot;-&quot;,$keyid);\r\n   $mod = phpcms;\r\n   $html-&gt;show($w3zz&#x5B;3],1);\r\n<\/pre>\n<p>\u5728<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\nif($comments-&gt;addpost($content, $keyid))\r\n<\/pre>\n<p>\u540e\u9762\u52a0\u4e0a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n$mod = phpcms;\r\n$html-&gt;show($contentid,1);\r\n<\/pre>\n<p>\u4fee\u6539\u5b8c\u6bd5\uff0c\u770b\u770b\u6548\u679c\u2026\u2026<br \/>\n\u6700\u7ec8\u6548\u679c\u662f\uff0c\u4f1a\u5458\u8bc4\u8bba\u2013\u8fdb\u5165\u8bc4\u8bba\u5217\u8868\u2013\u70b9\u51fb\u6807\u9898\u8fd4\u56de\u5373\u53ef\u770b\u5230\u521a\u521a\u7684\u8bc4\u8bba\u2013\u8bc4\u8bba\u5217\u8868\u56de\u590d\u5176\u5b83\u4f1a\u5458[\u5f15\u7528]\u2013\u70b9\u51fb\u6807\u9898\u8fd4\u56de\u5185\u5bb9\u9875\u5373\u53ef\u770b\u5230\u521a\u521a\u5f15\u7528\u56de\u590d\u7684\u5185\u5bb9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5177\u4f53\u64cd\u4f5c\u6b65\u9aa4\u5982\u4e0b\uff1a \u7b2c\u4e00\u6b65\uff1a\u4fee\u6539templates\/default\/phpcms\/show.html\u5373\u6587\u7ae0\u5185\u5bb9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-345","post","type-post","status-publish","format-standard","hentry","category-code_related"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=345"}],"version-history":[{"count":1,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/345\/revisions"}],"predecessor-version":[{"id":5290,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/345\/revisions\/5290"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}