2011-09-28 3 views
2

내 웹 사이트에 Facebook 초대장을 통합하려고합니다. 나는 PHP를 사용하고 있습니다.치명적인 오류 : 정의되지 않은 메서드를 호출합니다. :: line 15 /home/wubb/public_html/facebook/fbml.php의 Facebook :: require_frame()


<?PHP 
// Get these from http://developers.facebook.com 
$api_key = 'xxx'; 
$secret = 'xxx'; 
// Names and links 
$app_name = "Application name"; 
$app_url = "app-url"; // Assumes application is at http://apps.facebook.com/app-url/ 
$invite_href = "invite.php"; // Rename this as needed 
require_once 'facebook.php'; 
$facebook = new Facebook($api_key, $secret); 
$facebook->require_frame(); 
$user = $facebook->require_login(); 
if(isset($_POST["ids"])) { 
    echo "<center>Thank you for inviting ".sizeof($_POST["ids"])." of your friends on <b><a href=\"http://apps.facebook.com/".$app_url."/\">".$app_name."</a></b>.<br><br>\n"; 
    echo "<h2><a href=\"http://apps.facebook.com/".$app_url."/\">Click here to return to ".$app_name."</a>.</h2></center>"; 
} else { 
    // Retrieve array of friends who've already authorized the app. 
    $fql = 'SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1='.$user.') AND is_app_user = 1'; 
    $_friends = $facebook->api_client->fql_query($fql); 
    // Extract the user ID's returned in the FQL request into a new array. 
    $friends = array(); 
    if (is_array($_friends) && count($_friends)) { 
     foreach ($_friends as $friend) { 
      $friends[] = $friend['uid']; 
     } 
    } 
    // Convert the array of friends into a comma-delimeted string. 
    $friends = implode(',', $friends); 
    // Prepare the invitation text that all invited users will receive. 
    $content = 
     "<fb:name uid=\"".$user."\" firstnameonly=\"true\" shownetwork=\"false\"/> has started using <a href=\"http://apps.facebook.com/".$app_url."/\">".$app_name."</a> and thought it's so cool even you should try it out!\n". 
     "<fb:req-choice url=\"".$facebook->get_add_url()."\" label=\"Put ".$app_name." on your profile\"/>"; 
?> 
<fb:request-form 
    action="<? echo $invite_href; ?>" 
    method="post" 
    type="<? echo $app_name; ?>" 
    content="<? echo htmlentities($content,ENT_COMPAT,'UTF-8'); ?>"> 
    <fb:multi-friend-selector 
     actiontext="Here are your friends who don't have <? echo $app_name; ?> yet. Invite whoever you want -it's free!" 
     exclude_ids="<? echo $friends; ?>" /> 
</fb:request-form> 
<?PHP 
} 
?> 
[[Image:multi-friend-selector.png]] 

여기

나는 많은 phpSDK 버전 만을 시도 github에 .I에서 다운로드 facebook.php 파일을 포함 여전히 다음과 같은 오류가

치명적인 오류오고있다 : 나는 코드를 포함 : 정의되지 않은 메서드를 호출하십시오. Facebook :: require_frame()

누구든지이 기능을 어떻게 conatain 또는이 문제를 해결할 수 있는지 제안 할 수 있습니다. 이 문제를 해결하기 위해 많은 시간을 낭비했습니다. 가능한 빨리 응답하십시오. https://github.com/facebook/facebook-php-sdk :

답변