Hey,
first I want to thank you for this great piece of work. I really like this module and I am sure a lot of people are thankful to have facebook integrated just like a piece of cake.
Everything works fine for me, except one tiny little feature, I want to modify: Is it possible to change the contents which are posted to facebook through the stream submodule? It would be really important for my concept, that not only a link and some text is posted, but also a picture, which is a field within the node type, that should be posted.
I guess the answer or workaround lies within the fbconnect_stream_publish.module – but I am not sure how and where I can solve this.
It must be something like....
'media' => array(array('type' => 'image', 'src' => $url_img, 'href' => $lnk_img)));
I reckon, but it won't work. Could you help me or at least give me a hint, how this could work?
Thanks in advance and many greetings from Germany,
Maria
Comments
Comment #1
Miquel Carol CreditAttribution: Miquel Carol commentedHi Maria,
I patched the stream module to show node images on streams. Only need to edit fbconnect_stream_publish.module.
For images on create content:
On line 38 change:
To:
For images on comments:
On line 158 change:
To:
Them on attachment array on case 'coment', only need to add 'media' => $feed['media'], on each case, for example on coment i changed:
To
This modification works fine on my sites. (Facebook need to see the image, not work on sites with private images)
Of course u need to define better $url_img and $lnk_img with drupal variables. I used a imagefield and the node id to automatize the streams. ;)
Comment #2
core44 CreditAttribution: core44 commentedHi Miquel, thanks for the code examples. Would you be able to show me the line to add if I wanted to post the body, or perhaps a basic CCK text field? Thanks again.
Comment #3
core44 CreditAttribution: core44 commentedJust to report back to anyone with limited experience like myself. I achieved including the body text by adding in the line for 'body' as below. I was having issues as facebook doesn't allow HTML via the stream, so I needed to include strip_tags().
Hope this helps someone.
Comment #4
Miquel Carol CreditAttribution: Miquel Carol commentedHi filthtpixel,
Usually my node->body are too extensible to looks well on fb_streams. I used on your case:
Surelly looks like better and only need to use the drupal break line to control the description that you stream. ;)
Can see a sample od fb_streams on the fanpage as I use to test the code.
http://www.facebook.com/blog.miquel