{"id":1177,"date":"2017-06-29T09:30:40","date_gmt":"2017-06-29T01:30:40","guid":{"rendered":"http:\/\/www.baishitou.cn\/?p=1177"},"modified":"2018-10-28T23:59:11","modified_gmt":"2018-10-28T15:59:11","slug":"dedecms%e7%bb%87%e6%a2%a6%e5%9b%be%e9%9b%86%e5%9c%a8%e9%a6%96%e9%a1%b5%e5%88%97%e8%a1%a8%e9%a1%b5%e8%b0%83%e7%94%a8%e5%b9%b6%e4%b8%94%e8%be%93%e5%87%ba%e8%87%aa%e5%ae%9a%e4%b9%89%e5%bc%a0%e6%95%b0","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/1177.html","title":{"rendered":"\u7ec7\u68a6dedecms\u56fe\u96c6\u5728\u9996\u9875\u5217\u8868\u9875\u8c03\u7528\u5e76\u4e14\u8f93\u51fa\u81ea\u5b9a\u4e49\u5f20\u6570"},"content":{"rendered":"
\u4e0d\u6539\u52a8\u5b98\u65b9\u6838\u5fc3\u6587\u4ef6\uff0c\u5728\u81ea\u5b9a\u4e49\u65b9\u6cd5\u6587\u4ef6\u91cc\u52a0\u5165\u4e2a\u65b9\u6cd5\u6765\u5b9e\u73b0<\/p>\n
function<\/span> Getimgurls<\/span>(<\/span>$aid<\/span>,<\/span>$num<\/span>=<\/span>4<\/span>)<\/span> \r\n{<\/span>\r\n global<\/span> $dsql<\/span>;<\/span>\r\n $imgurls<\/span> =<\/span> $result<\/span> =<\/span> ''<\/span>;<\/span>\r\n $imgrow<\/span> =<\/span> $dsql<\/span>-<\/span>><\/span>GetOne<\/span>(<\/span> \"Select imgurls From `#@__addonimages` where aid='$aid' \"<\/span>)<\/span>;<\/span>\r\n $imgurls<\/span> =<\/span> $imgrow<\/span>[<\/span>'imgurls'<\/span>]<\/span>;<\/span>\r\n if<\/span>(<\/span>$imgurls<\/span> !=<\/span> ''<\/span>)<\/span>\r\n {<\/span>\r\n $dtp<\/span> =<\/span> new<\/span> DedeTagParse<\/span>(<\/span>)<\/span>;<\/span>\r\n $dtp<\/span>-<\/span>><\/span>LoadSource<\/span>(<\/span>$imgurls<\/span>)<\/span>;<\/span>\r\n $images<\/span> =<\/span> array<\/span>(<\/span>)<\/span>;<\/span>\r\n if<\/span>(<\/span>is_array<\/span>(<\/span>$dtp<\/span>-<\/span>><\/span>CTags<\/span>)<\/span>)<\/span>\r\n {<\/span>\r\n foreach<\/span>(<\/span>$dtp<\/span>-<\/span>><\/span>CTags<\/span> as<\/span> $ctag<\/span>)<\/span>\r\n {<\/span>\r\n if<\/span>(<\/span>$ctag<\/span>-<\/span>><\/span>GetName<\/span>(<\/span>)<\/span> ==<\/span> 'img'<\/span>)<\/span>\r\n {<\/span>\r\n $row<\/span> =<\/span> array<\/span>(<\/span>)<\/span>;<\/span>\r\n $row<\/span>[<\/span>'width'<\/span>]<\/span> =<\/span> $ctag<\/span>-<\/span>><\/span>GetAtt<\/span>(<\/span>'width'<\/span>)<\/span>;<\/span>\r\n $row<\/span>[<\/span>'height'<\/span>]<\/span> =<\/span> $ctag<\/span>-<\/span>><\/span>GetAtt<\/span>(<\/span>'height'<\/span>)<\/span>;<\/span>\r\n $row<\/span>[<\/span>'imgsrc'<\/span>]<\/span> =<\/span> trim<\/span>(<\/span>$ctag<\/span>-<\/span>><\/span>GetInnerText<\/span>(<\/span>)<\/span>)<\/span>;<\/span>\r\n $row<\/span>[<\/span>'text'<\/span>]<\/span> =<\/span> $ctag<\/span>-<\/span>><\/span>GetAtt<\/span>(<\/span>'text'<\/span>)<\/span>;<\/span>\r\n $images<\/span>[<\/span>]<\/span> =<\/span> $row<\/span>;<\/span>\r\n }<\/span>\r\n }<\/span>\r\n }<\/span>\r\n $dtp<\/span>-<\/span>><\/span>Clear<\/span>(<\/span>)<\/span>;<\/span>\r\n $i<\/span> =<\/span> 0<\/span>;<\/span>\r\n foreach<\/span>(<\/span>$images<\/span> as<\/span> $row<\/span>)<\/span>\r\n {<\/span>\r\n if<\/span>(<\/span>$i<\/span> ==<\/span> $num<\/span>)<\/span> break<\/span>;<\/span>\r\n if<\/span>(<\/span>$row<\/span>[<\/span>'imgsrc'<\/span>]<\/span> !=<\/span> ''<\/span>)<\/span>\r\n {<\/span>\r\n $result<\/span> .<\/span>=<\/span> \"<li><div class='pic'><a title='{$row['text']}' href='{$row['imgsrc']}'><img src='{$row['imgsrc']}' mid='{$row['imgsrc']}' big='{$row['imgsrc']}' width='70' height='70'><\/a><\/div><\/li>\"<\/span>;<\/span>\r\n }<\/span>\r\n $i<\/span>++<\/span>;<\/span>\r\n }<\/span>\r\n return<\/span> $result<\/span>;<\/span>\r\n }<\/span> \r\n}<\/span><\/code><\/pre>\n<li><div class='pic'><a title='{$row['text']}' href='{$row['imgsrc']}'><img src='{$row['imgsrc']}' mid='{$row['imgsrc']}' big='{$row['imgsrc']}' width='70' height='70'><\/a><\/div><\/li><\/p>\n
\u6539\u6210\u4f60\u81ea\u5df1\u7684\uff0c\u6ce8\u610f\u5355\u53cc\u5f15\u53f7<\/p>\n
\u524d\u53f0\u6a21\u677f \u9996\u9875 \u6216\u8005 \u5217\u8868\u9875 \u4e2d\u8c03\u7528<\/h2>\n\nPHP<\/div>\n<\/div>\n[<\/span>field:<\/span>id function<\/span>=<\/span>Getimgurls<\/span>(<\/span>@me,<\/span>4<\/span>)<\/span>\/<\/span>]<\/span><\/code><\/pre>\n\u6570\u5b574\u662f\u8c03\u7528\u51e0\u5f20\u56fe\u7247<\/p>\n","protected":false},"excerpt":{"rendered":"
\u4e0d\u6539\u52a8\u5b98\u65b9\u6838\u5fc3\u6587\u4ef6\uff0c\u5728\u81ea\u5b9a\u4e49\u65b9\u6cd5\u6587\u4ef6\u91cc\u52a0\u5165\u4e2a\u65b9\u6cd5\u6765\u5b9e\u73b0 \u6253\u5f00 \\include\\extend.func.php […]<\/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":[43,649,648,180,650,338],"class_list":["post-1177","post","type-post","status-publish","format-standard","hentry","category-web","tag-dedecms","tag-649","tag-648","tag-180","tag-650","tag-338"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/1177","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=1177"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/1177\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=1177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=1177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=1177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}