showing content in profile box from another file

Posted by fusion on Stack Overflow See other posts from Stack Overflow or by fusion
Published on 2010-04-14T19:01:43Z Indexed on 2010/04/19 20:33 UTC
Read the original article Hit count: 163

i'm stuck at this facebook application, not knowing how do i go ahead.

for the canvas, the app works quite perfectly. i've two pages, quote.html and quote.php. in quote.html, quote.php [which gets the quotes from the database] is called through ajax which displays a quote randomly for 10 secs.

however, for the wall tab/profile box, i can't seem to know where i'm going wrong. i created a page called 'profile_box.php', call quote.php for the quotes, setFBML. while this works on canvas [sans the timing], it doesn't display anything on the wall tab.

<?php

include 'quote.php';


$row = mysql_fetch_array($result, MYSQL_ASSOC);
if ( !$row ) {
  echo "Empty";
}
else{

$fb_box = "<p>" . h($row['cArabic']) . "</p>";
$fb_box .= "<p>" . h($row['cQuotes']) . "</p>";
$fb_box .= "<p>" . h($row['vAuthor']) . "</p>";
$fb_box .= "<p>" . h($row['vReference']) . "</p>";
}

try{

    $url="http://website/name/quote.html";
    $facebook->api_client->fbml_refreshRefUrl($url);

    $fbml = "<fb:ref  url='$url'/>";

    if(isset($_REQUEST['fb_sig_page_id'])){
        $page_id = $_REQUEST['fb_sig_page_id'];
        $profile_type = $_REQUEST['fb_sig_type'];
        $facebook->api_client->profile_setFBML($appapikey, $page_id, "$fbml", NULL, NULL, "$fb_box");
    }
    else {
        $is_tab = isset($_REQUEST['fb_sig_in_profile_tab']);
        if( !$is_tab ) $user_id = $facebook->require_login();
        $result = $facebook->api_client->profile_setFBML($appapikey, $user_id, "$fbml", NULL, NULL, "$fb_box");
    }
}
catch(Exception $ex){
    echo 'Caught exception: ',  $ex->getMessage(), "\n";
}


echo "<fb:add-section-button section=\"profile\" /><br />";

?>

can anyone please give any pointers?

© Stack Overflow or respective owner

Related posts about facebook

Related posts about facebook-application