Hey,
firstly here is my code:
$template_bundle_id = 53334391407;
$tokens = array( 'cal'=>'<a href="http://www.facebook.com/profile.php?id=533443800">Cal Smith</a>' );
$target_ids = array();
$body_general = '';
$facebook->api_client->feed_publishUserAction( $template_bundle_id, json_encode($tokens), implode(',', $target_ids), $body_general);That works fine and publishes a single line story to the users profile
BUT, i want to publish the full story version of it! At the moment the user would have to go to their profile, find the post, go to options, click 'Full Post', wait for it to load, re-read the post
Does anyone know how i can just post the full story right away!?!!?!?
any help would be sooooooooooooo helpful! thanks!
PS. im just posting on the user's wall who is running the app profile, not their friends or anything.
Last edited by Captainhamsbe (2009-02-12 23:42:37)
Offline
problem solved.
if your interested, just add this js to the page
<script type="text/javascript">
var template_bundle_id = 53334391407;
var template_data = {
"cal":"Cal Smith"
};
var body_general = 'body test';
Facebook.showFeedDialog(template_bundle_id,template_data,body_general);
</script>
Offline
Hello Captain
I have tried to work out the js you have given but it is throwing up the js error "Facebook is not defined". I have also tried with api but it was in ASP.NET. I was also able to get single line stories published to friend's profile. But I too need short/full size stories. Glad to know that you got it done.
Kindly help.
Offline
here's the my pages code:
<?php
//connect to fb
require_once("header.php");
?>
<a href="<?=$profileurl?>"><b><font size="5"><br><br>Now click here and checkout your wall.</font></b></a>
<script type="text/javascript">
var template_bundle_id = 53334391407;
var template_data = {
"cal":"Cal Smith"
};
var body_general = 'body test';
Facebook.showFeedDialog(template_bundle_id,template_data,body_general);
</script>After copy+pasting that and it still doesn't work, all I can think of is that your not filling in the info about your "templatised-action" thing correctly - double check that (did you make it in the create templatised action tool? Thats what I used)
Offline
Hello Captain
Seems the problem I am doing here is with connection part that is in your PHP
Offline
header.php is as follows:
<?php
//This file should be in a require_once() on every page
// <This stuff here is the only thing required, I don't know what the equivelant is in .Net or ASP or whatever your using, sorry.>
//connect to Facebook API
include_once 'facebook_api/facebook.php';
$api_key = 'ac47dcbfc12f08ef2a5d1c6d5674344a';
$secret = '42d67ad424771d415c23c28fa623dcf8';
$facebook = new Facebook($api_key, $secret);
$facebook->require_frame();
$user = $facebook->require_login();
// </important stuff>
//some handy stuff
$user_details=$facebook->api_client->users_getInfo($user, array('last_name','first_name','profile_url','proxied_email','pic','pic_big','status'));
$firstname=$user_details[0]['first_name'];
$lastname=$user_details[0]['last_name'];
$profileurl=$user_details[0]['profile_url'];
$proxyemail=$user_details[0]['proxied_email'];
$pic=$user_details[0]['pic'];
$picbig=$user_details[0]['pic_big'];
$status=$user_details[0]['status'];
$status=$status["message"];
?>I still don't understand your problem,
Your not using PHP right? -well then I can't help you, I only know php.
Your having a problem connecting to the API? -perhaps you should (re)read the documentation from Facebook for the language your using, and test out some basic api calls before going into depth with stuff like this
Hope that helps ![]()
Offline
When publishing from the server side, like you are, you only get one-line stories unless the user specifically changes their settings to allow larger stories for the application. Since most users don't know you can change those settings, and you can't tell what the setting are to prompt them, this is unlikely.
You can use feedForms, which will prompt the user to publish. The user can then switch it to a short or full story through the dialog, even choose to "keep" the setting. Note you cannot publish a full story to any user but the current user.
As for the javascript implementation, you are getting the "Facebook is not defined" error because you never included the Facebook javascript library to initialize the Facebook object. I'm not even sure Facebook javascript library will work under Facebook, unless in an iframe. It's really designed for use outside the platform.
Offline
Thanks for the help Captain
I have been able to create one-line feeds as told by Bar_Code through the Facebook API for .NET. But I need short sized stories that's the reason why I am going for Feed forms. Here I am trying for a solution that does work only with js (no PHP involved). Was the PHP code you just required for the js you finally found working?
Thankyou Bar_Code for your reply. The problem you mentioned in the first para is exactly the situation right now I am in.
These are the two links I tried and failed:
http://wiki.developers.facebook.com/ind … Feed_Forms
http://wiki.developers.facebook.com/ind … _an_IFrame
When I try as said in the first link it gives me a XML Parsing error from the server side while i click submit inside the form tag with fbtype attribute
When I try the second it gives a client side error saying "FB.Facebook.showFeedDialog" is not a function. If i try the way Captainhamsbe has said then the error will be "Facebook is not defined".
Well I have tried my application is an iframe application I ve tried both these from inside as well as outside the iframe while it was FB authenticated.
Here's how my code looks:
<script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<script type="text/javascript">
FB_RequireFeatures(["XFBML"], function(){
FB.Facebook.init("173f2f52ba9ab9f3fb21d158a4490524", "xd_receiver.htm");
FB.ensureInit(function() {
//FB.Facebook.showFeedDialog(58238377190);
});
});
</script>
I have tried it both with/without ensureInit.
Last edited by tonymathewt (2009-03-03 22:06:35)
Offline