Example #1
0
<?php

include_once 'client/facebook.php';
include_once 'lib.php';
include_once 'config.php';
$fb = FB::get($api_key, $secret);
//$friends = $fb->api_client->friends_get();
$user = $_POST['fb_sig_user'];
$friends = explode(",", $_POST['fb_sig_friends']);
if (isset($_POST['what'])) {
    $who = $user;
    $what = $_POST['what'];
    $description = $_POST['description'];
    $value = $_POST['value'];
    $available = (bool) false;
    if ($_POST['available'] == 1) {
        $available = (bool) true;
    }
    add_shared_item($who, $what, $description, $value, $available);
    $render_msg = (bool) true;
}
echo render_menu("my_listings", $user, $friends);
echo render_tabs(0);
if ($render_msg) {
    ?>
	<fb:success>
		<fb:message>Your shared item has been added.</fb:message>
	</fb:success>
<?php 
}
?>
Example #2
0
function facebook_page_fans($pid)
{
    $qry = FB::get()->api(array('method' => 'fql.query', 'query' => 'SELECT fan_count FROM page WHERE page_id = ' . $pid));
    return (int) $qry[0]["fan_count"];
}