SimplePie를 사용하여 내 페이지에 RSS 피드를 표시합니다. 이제 댓글의 개수를 표시하고 싶습니다.Simplepie and slash : comments
은 RSS :
<slash:comments>0</slash:comments>
가 어떻게 SimplePie를 함께이 문제를 보일 수 있는가?
SimplePie를 사용하여 내 페이지에 RSS 피드를 표시합니다. 이제 댓글의 개수를 표시하고 싶습니다.Simplepie and slash : comments
은 RSS :
<slash:comments>0</slash:comments>
가 어떻게 SimplePie를 함께이 문제를 보일 수 있는가?
이렇게하려면 $item->get_item_tags()
을 사용하고 싶습니다. 맞춰 보면 comments
태그와 함께 http://purl.org/rss/1.0/modules/slash/
네임 스페이스가 필요합니다.
$comments = $item->get_item_tags('http://purl.org/rss/1.0/modules/slash/', 'comments');
그런 다음이 데이터 구조를 살펴보고 필요한 것을 해결할 수 있습니다. 추측 하 ...
$number = $comments[0]['data'];
나를위한이 작품 : $ number = $ comments [0] [ 'data']; –
은 단일 피드의 피드입니까? 귀하의 페이지 또는 피드의 댓글입니까? –
댓글은 페이지에 있습니다. 그러나 Feed에는 COUNT slash : comment> 태그가 있습니다. –
현재 SimplePie는 주석 태그를 지원하지 않습니다. 당신은 get_comment() & get_comment_tags()처럼 클래스에 2 개의 더 많은 함수를 추가하여 지원을 추가 할 수있다. –