views:

516

answers:

1

I'm developing an Facebook Application in PHP. It's loaded as an iframe and not as FBML. The normal interaction with Facebook works. For example the following code gives the username:

$facebook = new Facebook($config->appapikey, $config->appsecret);
$user_id = $facebook->require_login($required_permissions = 'email');
echo $user->name;

Where $user is my class in which the user-details are loaded from facebook. My document begins the following way:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"&gt;
<head><title>Appname</title>
</head>
<body>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/de_DE" type="text/javascript"></script>

And ends likes this:

<script type="text/javascript">  
FB_RequireFeatures(['XFBML','CanvasUtil'], function(){ 
FB.init("<?php echo $config->appapikey; ?>", "/app/xd_receiver.htm");
FB.CanvasClient.startTimerToSizeToContent(); 
 });
  </script>
</body>
</html>

Also the file xd_receiver.htm is loaded as I can see in Firebug.

But my problem is that for example the request-form is not loaded. My code:

<fb:serverFbml>
    <script type="text/fbml"> 
        <fb:fbml>
            <fb:request-form method="post" action="<?php echo $config->site; ?>index.php" type="appname" invite="true" target="_top" content="content">
                <fb:multi-friend-selector actiontext="text" rows="3" showborder="true" target="_top"/>
            </fb:request-form>
        </fb:fbml>
    </script>
</fb:serverFbml>

I can see the code with Firebug but the form ist not displayed by Facebook.

2 or 3 weeks ago it was displayed but in this time I had the tags

    </fb:fbml>
</script>
</fb:serverFbml>

arround my complete text in the body. 2 weeks ago I had the the problem that nothing any more was displayed. After I removed the tags my app is displayed but not the form.

I am searchign the web vor 1 week now and read many Threads about FBML and XFBML in Facebook but nothing worked for me.

So thank you in advance for help.

A: 

Wow, I'm not sure what to say. I just looked over all your code and everything looks to be in place. Maybe try adding this

FB.XFBML.Host.autoParseDomTree = true;

Right after the call to FB.init()

Peter Bailey
Thank your for your answer but also with your code nothing changed.At another point in my app I am trying to show a form to the user for posting on it's wall. This also functioned in the past but is not any more.my code: function publish() { var action_links = [{'text':'appame','href':'link'}]; var message='message'; FB_RequireFeatures(["Connect"], function() { FB.init('appid', 'xd_receiver.htm'); FB.ensureInit(function() { FB.Connect.streamPublish(message, null, action_links, null); }); }); } window.onload = publish;
Jakob