2012-03-29 80 views

回答

1

這裏是你可以使用該

<?php require_once 'src/facebook.php'; 

    $facebook = new Facebook(array(
     'appId' => 'xxxxxxxxx', 
     'secret' => 'xxxxxxxxxxxx', 
     'cookie' => true, 
    )); 


    $fanpage = $_GET["fanpage_id"]; 
    $width = $_GET["width"]; 
    $height = $_GET["height"]; 
    $fontfamily = $_GET["fontfamily"]; 
    $fontsize = $_GET["fontsize"]; 
    $fontcolor = $_GET["fontcolor"]; 
    $backgroundcolor = $_GET["backgroundcolor"]; 
    $backgroundimage = $_GET["backgroundimage"]; 


    $result = $facebook->api(array(
     'method' => 'fql.query', 
     'query' => 'select fan_count from page where page_id = '.$fanpage.'' 
    )); 

    $fb_fans = $result[0]['fan_count']; 

    echo '<style> 
    #likes{ 
     width:100px; 
     height:100px; 
     font-family:Verdana; 
     font-size:14px; 
     color:#000; 
     } 
    </style> 
    '; 


    echo '<div id="likes">'; 
    echo ''.$fb_fans.''; 
    echo '</div>'; 
+0

哇,非常感謝代碼!但還有一個問題 - 我可以在哪裏閱讀關於使用page_id參數的信息?我找不到在文檔中(我的英文不完美)如何永久設置page_id像按鈕elemnt:

這是否必須在某處或其他地方?它參數直接鏈接「喜歡」與我的網站上的一些頁面,對吧?所以,請幫助我與關於該參數的信息! – 2012-03-29 11:31:22

+0

你好@AndreySamozhenkov你還需要嗎?對於我最近的反應感到遺憾 – 2012-04-13 07:52:08

相關問題