Facebook API - Directly write message to Profile Box

Discussion in 'Buy / Sell / Trade' started by Tony0930, Sep 27, 2008.

  1. Tony0930 New Member

    Buyer: chen8090 Contact Buyer Time of Post: Sep 22, 2008 22:03 (U.S. Eastern Time) Job Budget: $50 Bids/ Views: 0 / 253

    Time Remaining: 11d 0h 13m (ends Oct 07, 2008 22:03 U.S. Eastern Time)
    Job Description
    This is from facebook example, mysmiley
    http://apps.new.facebook.com/mysmiley/

    The current example displays "Add to Profile" button. Once user clicks the button,
    it pops up a window to ask "Add" to Wall or Box tab.

    My application is in iFrame, I have worked out to not use FBML and use the
    JavaScript here.

    Could you make it totally automatic in iFrame (NO FBML)?
    No "Add to Profile" button, just directly put the message into the Profile Box tab.

    If so, work on your environment and write a PPT step-by-step detailed description with
    screen shots.

    The following codes are combination of smiley/index.php and smiley/iframe/index.php

    <?php
    $message = "Updated News Here Soon";
    $fb->api_client->profile_setFBML(null, $user, $message, null, null, $message);
    ?>

    Click the button to add news box in your profile.

    window.onload = function() {
    FB_RequireFeatures([&quot;Integration&quot;], function() {
    FB.Facebook.init('<?php echo API_KEY;?>', 'receiver.html', null);
    FB.Integration.showAddSectionButton(&quot;profile&quot;, document.getElementById("addSection"));})};

    $fb = get_fb();
    $user = $fb->require_login();

    $profile = "my message here";
    $profile_wall = $profile;
    $profile_box = $profile;
    $fb->api_client->profile_setFBML(null, $user, $profile_wall, null, null, $profile_box);
    ?>

    <html>
    <head>
    <!-- Put these in the head of your document to use these features-->
    <link rel="stylesheet" href="http://static.ak.new.facebook.com/css/fb_connect.css" type="text/css" />
    <script src="http://static.ak.new.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
    </head>

    <br>
    Click the button to add news box in your profile.
    <P>
    <div id="addSection"></div>
    <br>

    <script type="text/javascript">

    window.onload = function() {
    FB_RequireFeatures(["Integration"], function() {

    FB.Facebook.init('<?php echo API_KEY;?>','receiver.html', null);

    // These two lines add a "add to profile" button under the given id.
    FB.Integration.showAddSectionButton("profile", document.getElementById("addSection"));
    })};
    </script>


    more infor go to Job:Facebook API - Directly write message to Profile Box | myTino - The World's Leading Online Outsourcing Network

Share This Page