3
我正在使用FB PHP SDK將消息發佈到用戶的牆上。 一旦用戶通過驗證FB我允許他們使用這個輔助函數Codeigniter和Facebook PHP SDK - 發佈到用戶牆上的錯誤
function post_facebook($fb) {
$CI =& get_instance();
$CI->load->library('facebook');
$config = array(
'appId' => '123123123123',
'secret' => '567567567567'
);
$facebook = new Facebook($config);
$user_id = $facebook->getUser();
if ($user_id) {
$facebook->api('/me/feed', 'POST', array(
'message' => $fb['post_text'],
)
);
}
}
這實際上發出的帖子FB和它顯示在牆壁上張貼的消息。
但在Firebug我可以看到這個錯誤
<h4>A PHP Error was encountered</h4>
<p>Severity: Warning</p>
<p>Message: Missing argument 1 for Facebook::__construct(), called in /var/www/vhosts/example.com/httpdocs/system/core/Loader.php on line 1099 and defined</p>
<p>Filename: libraries/Facebook.php</p>
<p>Line Number: 36</p>
</div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Notice</p>
<p>Message: Undefined variable: config</p>
<p>Filename: libraries/Facebook.php</p>
<p>Line Number: 40</p>
</div>
任何想法,我做錯了嗎?
完美,感謝了一堆 – pepe
歡迎您! :) – elias