Closed (fixed)
Project:
Facebook Connect
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Jan 2010 at 18:06 UTC
Updated:
1 Apr 2010 at 15:27 UTC
Jump to comment: Most recent file
Comments
Comment #1
bryanb229 commentedAlso trying to do this any help would be great.
Comment #2
thaddeusmt commentedSo, here are my code hacks to get this working (sorry for not providing a nice .patch file).
In fbconnect_form_alter, at the end, add a case for 'node edit' form like so:
Implement the nodeapi hook:
And in fbconnect_render_js, after the
case 'comment' :case, add a case for 'node' like so:This will need to be tweaked, but now if I'm logged in to Facebook I get the option to Publish to Facebook when creating a new node of any content type. This code does not show the Publish option when editing a node, only when creating a new one.
Comment #3
thaddeusmt commentedCorrection to above: the nodeapi function needs to be this for the checkbox to work:
Comment #4
tassoman commentedWould be possible to hook into login also?
Would be wonderful extend it by custom module to hook into wanted events. Or implement some integration with Rules module
Comment #5
harmonyhalo commentedHi thaddeusmt, thanks for the additional info - i'm trying to get this to work but having no luck with the function fbconnect_form_alter
i'm wondering what i should use to wrap your hacks. i've tried
"function fbconnect_form_alter(&$form, $form_state, $form_id) {"
but that gives me a fatal error.
Any help would be much appreciated!
Thanks
/// edit ///
I found where to put this if anyone else is as clueless as me, the form_alter function is on or around line 162 of the fbconnect module
/// edit ///
finding where to put the code has helped the checkbox appear on nodes to allow publishing to facebook, though unfortunately it doesn't seem to be appearing in the feed.
the only error i can find in the logs that seems related to this snippet seems to be
"Undefined index: #node"
any ideas?
Comment #6
bryanb229 commentedThanks thaddeusmt!
You the man.
Comment #7
arcane commentedsubscribing
Comment #8
harmonyhalo commentedOk, upgrading to the latest stable Drupal 6.15 removes my above error message, so mad props to thaddeusmt for sorting this out!!
just one little question though, on the user's facebook wall it links to "www.sitename.com/node/" rather than "www.sitename.com/nodetitle/"
What do i need to change in the above to fix this?
Thanks for the major help!
Comment #9
deng17 commentedSorry for being a noob...but where can I find those files to edit? I'm not knowledgeable in PHP
Comment #10
harmonyhalo commented* deng17 edit the .module file and follow thaddeusmt's instructions as to where to put each snippet...\
I'm finding this only works intermittently. strangely, it works all the time when submitting a comment, but when i upload a new node it's only sometimes that i get the dialogue to publish it on my wall.
I'd still love to hear if anyone has any ideas about how to link the facebook wall post back to my node which uses a url alias becaue now all i can do is link people back to my homepage rather than the posted content...
Thanks!
Comment #11
nicholas.alipaz commentedI will rework this as a patch a bit later, but I found the issue with the url not working properly:
Short answer, replace hook_nodeapi function with this
Long, the $node->nid is not available from within validate since the $node is not in the db yet. So we have to set our $_SESSION variable from within the 'insert'. I did a workaround that checks the checkbox value during validate and then sets the session inside of insert.
I will reuse most of what code is here and add some administration options to content types for allowing facebook posting to walls and etc.
Comment #12
nicholas.alipaz commentedHere is a reworked patch that should setup node/add/[content_type] to allow publishing content to facebook. It also adds an additional setting to each admin/content/node-type/[content_type] settings where one can enable/disable a particular content type as capable of publishing to facebook. Lastly, I changed hook_form_alter to be a switch since that is the more correct way to do it.
Comment #13
nicholas.alipaz commentedforgot the patch. Here it is. It is patched against todays cvs HEAD 6.x-1.x-dev
Comment #14
nicholas.alipaz commentedalmost forgot... needs review
Comment #15
harmonyhalo commentedWow that's great!
haven't applied the patch yet but i did input the modified code and it works great for linking directly to the node!
Thanks so much!
It still doesn't always bring up the publish to facebook window, but i'm guessing that's another issue :)
Comment #16
nicholas.alipaz commentedchanging this back to "needs review" since my patch "needs review"
Comment #17
deng17 commentedWill this be added for the next version?
Comment #18
nicholas.alipaz commentedI am not the developer so I have no idea. If you would like it added in the next version then testing the patch is a great way to help.
changing the version to match the version of the module this was patched against.
Comment #19
nicholas.alipaz commentedMarking as fixed since vectoroc seems to have committed the patch to the cvs #334574.
Comment #20
BenK commentedJust need to keep track of this thread... looking forward to testing.
Comment #21
nicholas.alipaz commentedBenK, it is actually in dev version of the module now. Just letting you know if you missed that part.
Comment #23
henno.gous commentedNicholas, I've installed the latest dev version, and I'm seeing the "publish to facebook" checkbox in my node creation form, but I'm not seeing my posts showing up on Facebook? Rechecked all my settings and I'm quite sure that my setup is configured correctly. Is this functionality confirmed as working in the dev version?
Comment #24
marcus178 commentedI'm looking for something similar but rather than posting to the users wall I would like to post it on our Facebook Fan Page.
Is there a way to define where it posts too?
Comment #25
marcus178 commentedOk I've managed to add a page id field like
But not sure how I can use the value entered to post to the page rather than users wall.
Comment #26
nicholas.alipaz commentedhenno.gous, if I recall there may be something wrong with the dev version. I know it is working if one simply applied the patch, but there seems to be something conflicting in the latest dev from what I can remember. I don't have time to look into it now.
marcus178, please open your own issue since what you are discussing is not really related. You want some new features.