Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Facebook Connect - Plugin Assistance Needed

edited January 2010 in Vanilla 2.0 - 2.8
I'm working on a Facebook Connect plugin, and am trying to wrap my head around how the Garden works exactly. I have some basic plugin functionality setup already for this and working, however need to refine things a bit further. Any help regarding the following is greatly appreciated! Simple examples please.

1) I'm attempting to display additional html on the entry login page (where user's enter their username and password). I understand I could simply add another view file in, however this seems a bit clumsy. Can I append additional html to the login view file via plugin, and if so what would the example code look like? If not, I have the view override file working already.

2) I want to fire-off another javascript function when a user clicks the sign-out link (doesn't matter if its directly before or after the normal sign-out functionality is run). How would I accomplish this within the same plugin?

3) How can I inject code in the to the portion of the page - without modifying the view directly (ie: via the same plugin)? I want to load some additional javascript here.

Thanks in advance - and great work on the Garden! I'll post some code once I make further progress for everyone else to use.


  • Regarding 1) I've been able to inject additional display onto the entry page, but only ever before or after the main content is loaded via:

    class FacebookConnectPlugin implements Gdn_IPlugin {
    public function EntryController_Render_Before(&$Sender) {
    echo 'This would output some html from an html file eventually.';

    Do I simply need to put all my display in a new .php file, and tell the plugin to override the view here to accomplish what I'm looking to do (add the Facebook Connect button on this page), like:

    class FacebookConnectPlugin implements Gdn_IPlugin {
    public function EntryController_Render_Before(&$Sender) {
    $this->View = PATH_PLUGINS.DS.'FacebookConnect'.DS.'entry.php';

    Downside to this approach that I see, is that if the base entry.php file is ever edited, then the plugin will always have an out-of-date version - unless updated.

    Or is there a better way to do this? Thanks guys!
  • Seems like no one else knows how to use the garden either, sweet!
  • oliverraduneroliverraduner Contributing to Vanilla since 2010 Switzerland ✭✭
    @MBZ No, you are not alone... :-)
  • Have you thought about creating a module that gets added to the view, rather than completely overriding the view? Just a thought.
  • Facebook connect should be even easier with the oAuth implementation they have now. Simple as redirecting a user to a link and getting a token.
  • TimTim Operations Vanilla Staff
    We're planning to add a generic OpenID authenticator as well as specific API connectors for Facebook and Twitter. Your choice if you want to hold off for it ;)

    We don't have a concrete timeline on this, but as @garymardell said, we've finished coding an OAuth implementation that works pretty well and we're testing that now, so it shouldn't be *too* long...

    Vanilla Forums COO [GitHub, Twitter,]

  • @Tim, will the OAuth support Google? anytime frame for this or is the source even available? I wan to avoid a duplicated effort because I am planning to lunch my site with good OAuth support.
  • tenachtenach Earth
    @Tim, sounds grand! I want to power my site by using OAuth/openID as the primary login types.
Sign In or Register to comment.