views:

129

answers:

2

I have an application that allows martial arts trickers to 'battle' each other by initiating challenges and submitting videos and whatnot. When user A challenges user B, the application posts to the user's wall (the one who initiated the challenge).

My question is how do I tag user B in the wall post? It essentially says "challenged John Do to a battle". I'd like "John Do" to link to his profile just like when you manually post something on your wall and use the @ symbol.

I hope this makes sense. I've tried standard html for a link, and I've tried FBML. Neither are parsed and only render as plain text on the wall post.

Thanks for any help!

A: 

You can use facebook api call or <fb:name> tag to get B user's name, here is an example of api call:

$facebook = new facebook('API', 'SECRET');
$facebook->get_loggedin_user();

$data = $facebook->api_client->getUser(b-user-id-here, 'name');
$name = $data[0]['name'];

Now you can use the $name variable in the link but of course you will be putting that link in the stream dialog code.

Sarfraz
I have the users name. I am trying to convert the plain text name into a link to that users profile.
Sean Cannon
`<a href="user-prfile-url-here">name here</a>`
Sarfraz
That will display as plain text (literally "<a href="user-prfile-url-here">name here</a>") and will not be parsed as a link, as I mentioned in my initial post.
Sean Cannon
i have used it working eg: `var template_data = {'txt':'<a href="<?php echo $appurl; ?>">' + document.getElementById("hdes").getValue() + '</a>', "images":[{'src':document.getElementById("img").getValue(), 'href':'http://apps.facebook.com/mymoodtoday/'}]};`
Sarfraz
A: 

Any solution for this problem??

goodsanket
It appears in the facebook docs that they only accept plain text for the post message.
Sean Cannon