Hi,

Ok it is interesting one! What I am trying to do is:

- I am adding a FBSS status using PHP (no trick just adding records using MYSQL in database) actually this code runs on a share button at different elements of the website which than gets posted at FBSS like it happens in Facebook.
- Now I have PHOTO ALBUMS and PHOTOS in them and When someone click on share of a PHOTO it creates an FBSS STATUS for that image using image TITLE but I am not able to attach that image with that STATUS using FBSMP, image has a record in "files" table and I have FID available and I also created record in 'fbsmp" table against the ID of the above STATUS but
- That status is displaying on the WALL but it is not picking attached image with it from "fbsmp" and "files" tables.

All i need to know, is there any API function which can do it?
OR
Is there any special format "data" field in "fbsmp" table that I need to follow to achieve this?

A quick reply is appreciated as I didn't had time to dig in FBSMP module to find something useful.

Regards

Comments

mudassarijaz’s picture

Assigned: Unassigned » mudassarijaz
publicmind’s picture

Status: Active » Fixed

The following code should save an photo attachment with the status:

/**
 * $recipient: The object representing the recipient of the status (can be a user object 
 *   or other recipients supported by FBSS such as nodes, etc).
 * $type: The stream context e.g. 'user' or context supported by FBSS. 
 * $fid: The file id of image which should be present in the files table.
 * $status_text: The text of the status.
 * $sender: The user object of the sender (can be obtained through user_load()) 
 */

fbsmp_save_status($recipient, $type, $status_text, 'photo', array('fid' => $fid), $sender);

Just tested this and it works fine. It will also fire all the integrations such as trigger, rules, activity, etc.

publicmind’s picture

You can look into the API section of the file: fbsmp.module to see other relevant APIs.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Marko B’s picture

Closing this, opened it without good reason.

Marko B’s picture

closing.