热门专栏: WordPress 专栏

来自45n5的哥们儿给我们介绍了一种用文本显示Feedburner订阅数的方法,其介绍这个方法的主要目的是,用文本显示就意味着你可以完自定义订阅数的样式风格,而不是局限于Feedburner官方提供的订阅数统计图标.而对于国人来说,能不能美化都是其次了,能显示就是好事儿,让我们看一下是如何操作的:

1. 复制粘贴下面的代码到你的模板里面.这段代码是利用Feedburner的API来获取你的Feedburner订阅数.

<?php
//get cool feedburner count
$whaturl=”http://api.feedburner.com/awareness/1.0/GetFeedData?uri=rss4real”;

//Initialize the Curl session
$ch = curl_init();

//Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Set the URL
curl_setopt($ch, CURLOPT_URL, $whaturl);
//Execute the fetch
$data = curl_exec($ch);
//Close the connection
curl_close($ch);

$xml = new SimpleXMLElement($data);
$fb = $xml->feed->entry['circulation'];

//end get cool feedburner count
?>

2. 再复制粘贴下面的代码到你想显示Feedburner订阅数的地方.

<?php echo $fb;?>

3. 没有了.

留言列表

Comments List
  1. 2008年07月11日 Flyx 说:

    这个,还是不用了,看了伤心…

添加回复

Respond This Post

看过这篇文章的读者,还看过:

Also Read
  • N/A

Entries (RSS) and Comments (RSS)
Powered by Wordpress Designed by 5android Vaild W3C CSS & XHTML