Hello all..
I wrote a simple custom module that provides an easy way to create facebook events, inside a drupal site. This is a independent module that uses directly the facebook api client. It works fine, but I could only create events owned by the application and not by the facebook user.
I’m sure that if I integrate my app into fb module, would be much easier for me to make the facebook user Integration.
Is there any kind of doc or some basic example that could guide me where to start, hooks to implement, where to insert my custom code after creating the application via fb interface ?
Two month ago I used fb to show a basic canvas page and really works fine, but I have no experience with non-canvas pages features, and I didn’t found so much doc about it.

Thanks for your support,
Pepe

Comments

Dave Cohen’s picture

This sounds really cool. Sure it's possible to use modules/fb/... and make your module just do the event-specific code. It's just not as well documented as it should be.

You'll want to add fb.module as a dependency of your module.

On pages with connect enabled, and also canvas pages, there will be a global variable $_fb which is the Facebook API.

If you need extended permissions to modify user events (I think you do), the fb_permission.module will help. (Although that module may need some work, its not as used/tested as some others).

There is one hook, hook_fb(), which is kind of like the hook_nodeapi of Drupal for Facebook. It gets called a lot, with different ops depending on what needs to be done.

While there is not much doc, the code in modules/fb/... will provide some examples of how the hook is used. Also how hook_form_alter is used to add configuration to each app. Just look around the code, ask questions here. Eventually this will be better documented.

And please share your code if it may apply to others. Maybe even as it's own project here on d.o.

phpepe’s picture

Thanks Dave, I'll go based on your module, looking inside the other modules sources.
..then if it works and after applying drupal standards to my code, i'll share with the community on some way (fb submodule may be).

vhwouter’s picture

Is it already possible to import events to nodes from user who have logged in through facebookconnect?

grtz.

muschpusch’s picture

I know that this is areally old thread but I want to do both: Posting events and getting user events. Any news on this functionality???