{"id":1594,"date":"2018-04-21T12:12:26","date_gmt":"2018-04-21T04:12:26","guid":{"rendered":"http:\/\/www.baishitou.cn\/?p=1594"},"modified":"2018-04-21T12:12:26","modified_gmt":"2018-04-21T04:12:26","slug":"%e7%bb%87%e6%a2%a6dedecms%e7%9b%b8%e5%85%b3%e6%96%87%e7%ab%a0likearticle%e8%b0%83%e7%94%a8%e8%87%aa%e5%ae%9a%e4%b9%89%e9%99%84%e5%8a%a0%e5%ad%97%e6%ae%b5","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/1594.html","title":{"rendered":"\u7ec7\u68a6DEDECMS\u76f8\u5173\u6587\u7ae0likearticle\u8c03\u7528\u81ea\u5b9a\u4e49\u9644\u52a0\u5b57\u6bb5"},"content":{"rendered":"

\u7ec7\u68a6dedecms\u6587\u7ae0\u9875\u4e2d\u6211\u4eec\u7ecf\u5e38\u4f1a\u663e\u793a\u76f8\u5173\u6587\u7ae0\u4e4b\u7c7b\u7684\u6587\u7ae0\u5217\u8868\uff0c\u5c31\u9700\u8981\u4f7f\u7528{dede:likearticle}\u6807\u7b7e\uff0c\u4f46\u662f\u9ed8\u8ba4\u7684likearticle\u662f\u4e0d\u80fd\u663e\u793a\u81ea\u5b9a\u4e49\u7684\u9644\u52a0\u5b57\u6bb5\u7684\u3002<\/p>\n

\u89e3\u51b3\u65b9\u6cd5 :\u6253\u5f00 include\/taglib\/likearticle.lib.php\u00a0\u641c\u7d22<\/p>\n

if($keyword != '')<\/code><\/pre>\n

\u5728\u5b83\u4e0a\u9762\u52a0\u5165:<\/p>\n

\/\/\u83b7\u5f97\u9644\u52a0\u8868\u7684\u76f8\u5173\u4fe1\u606f\r\n$addField = \"\";\r\n$addJoin = \"\";\r\nif(is_object($refObj->ChannelUnit))\r\n{\r\n    $addtable  = $refObj->ChannelUnit->ChannelInfos['addtable'];\r\n    if($addtable!=\"\")\r\n    {\r\n        $addJoin = \" LEFT JOIN $addtable ON arc.id = \".$addtable.\".aid \";\r\n        $addField = \"\";\r\n        $fields = explode(\",\",$refObj->ChannelUnit->ChannelInfos['listfields']);\r\n        foreach($fields as $k=>$v)\r\n        {\r\n            $nfields[$v] = $k;\r\n        }\r\n        foreach($refObj->ChannelUnit->ChannelFields as $k=>$arr)\r\n        {\r\n            if(isset($nfields[$k]))\r\n            {\r\n                if(!empty($arr['rename']))\r\n                {\r\n                    $addField .= \",\".$addtable.\".\".$k.\" as \".$arr['rename'];\r\n                }\r\n                else\r\n                {\r\n                    $addField .= \",\".$addtable.\".\".$k;\r\n                }\r\n            }\r\n        }\r\n    }\r\n}<\/code><\/pre>\n

\u7ee7\u7eed\u641c\u7d22<\/p>\n

tp.sitepath<\/code><\/pre>\n

\u66ff\u6362\u4e3a<\/p>\n

tp.sitepath $addField<\/code><\/pre>\n

\u5171\u6709\u4e24\u5904.<\/p>\n

\u7ee7\u7eed\u641c\u7d22 :<\/p>\n

arc.typeid=tp.id<\/code><\/pre>\n

\u66ff\u6362\u4e3a:<\/p>\n

arc.typeid=tp.id $addJoin<\/code><\/pre>\n

\u8fd9\u4e2a \u4e5f\u6709\u4e24\u5904.<\/p>\n

\u6a21\u677f\u4e2d\u8c03\u7528\u81ea\u5b9a\u4e49\u5b57\u6bb5<\/h3>\n
{dede:likearticle row='10' col='' titlelen='100' infolen='200'}\r\n<a href=\"[field:arcurl\/]\">[field:title\/]<\/a>\r\n<p>\u4ef7\u683c:\uffe5[field:jiage\/]<\/p>\r\n{\/dede:likearticle}<\/code><\/pre>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

\u7ec7\u68a6dedecms\u6587\u7ae0\u9875\u4e2d\u6211\u4eec\u7ecf\u5e38\u4f1a\u663e\u793a\u76f8\u5173\u6587\u7ae0\u4e4b\u7c7b\u7684\u6587\u7ae0\u5217\u8868\uff0c\u5c31\u9700\u8981\u4f7f\u7528{dede:likearticle} […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[180],"class_list":["post-1594","post","type-post","status-publish","format-standard","hentry","category-web","tag-180"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/1594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/comments?post=1594"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/1594\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=1594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=1594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=1594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}