We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34193
    • 330 Posts
    OK have now edited the plugin so there is no need to add the xmlns:fb="http://www.facebook.com/2008/fbml into your template code the plugin does it for you.

    $e = $modx->Event; 
    
    $startscript = '<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script> ';
    $endscript = '<script type="text/javascript"> FB.init("'.$account.'","xd_receiver.htm"); </script> ';
    $htmlcode = ' xmlns:fb="http://www.facebook.com/2008/fbml "';
    
    switch ($e->name) {
               case "OnWebPagePrerender":
                    $o = &$modx->documentOutput; // get a reference of the output
                    $o = str_replace("<body>","<body>".$startscript,$o);
                    $o = str_replace("</body>",$endscript."</body>",$o);
                    $o = str_replace("<html","<html".$htmlcode,$o);
                     break;
               default :
                    return; // stop here - this is very important.
                    break;
    }
    
    • Peter, I just saw your comment on the MODx Fan Page on Facebook and replied, then found this thread here!

      What you’ve done so far looks really great, I have also been asked by a client to integrate Facebook as a login option alongside their current member system -unfortunately I’m not an expert programmer and I’ve ran into some problems...

      You can see where I’m currently at here, but most of it isn’t fully working - if you could shed any light on what I’ve done it would be great...

      I’m going to follow this thread closely and try out your plugin...

      Have you checked out some of the official video tutorials the Facebook engineers have done? - This one is especially good, I’ve followed it word for word but could still only get half of it working - I’ve also installed and dug around in their demo app, which I seemed to have installed correctly.
        MODX Ambassador for Thailand. Managing Director at Monogon, a web design and development studio based in Bangkok, Thailand. - Follow me on Twitter.
        • 34193
        • 330 Posts
        Mallmus thanks for the links have had a look at your site and looked at the code. Looks like in someways you are further ahead than I am. Looks like you are doing most of the work using java script, I am hoping to use the PHP client Libary in order to help integrate into MODx better via snippets. But I think I pick up a lot of usefull information from the work you have done so far. Keep an eye on this thread and feel free to either post or PM me with any qureys or suggestions.
          • 34017
          • 898 Posts
          pete,

          I think in the end it would be more customizable to have the script part be in a chunk. and use a plugin parameter to define it. That’s down the road of course - i know you’re testing it now.
            Chuck the Trukk
            ProWebscape.com :: Nashville-WebDesign.com
            - - - - - - - -
            What are TV's? Here's some info below.
            http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
            http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
            • 10792
            • 13 Posts
            Something like this

            No panic, it is only a "hack"! I’m a "designer" not a programmer. No snippet or plugin for this >:(

            I will go online next days, so i will work with PHx for the permission to publish (facebook logged in user -> display chunk)

            But, apparently, it works wink

            ciao! Gianfra

            • Looks like in someways you are further ahead than I am. Looks like you are doing most of the work using java script, I am hoping to use the PHP client Libary in order to help integrate into MODx better via snippets. But I think I pick up a lot of usefull information from the work you have done so far.

              Thanks man smiley yeah, like you said yourself, Im more of a designer than a programmer, I have more of a grasp on JavaScript than PHP so I tried to follow all their JS tutorials - but if its cool with you, please share your developments and I will try them out as well...

              Would you be able to test this one out for me - I don’t want to show it to my client yet until its half decent - just post a screenshot here or email it to the address in my profile...

              I think in the end it would be more customizable to have the script part be in a chunk. and use a plugin parameter to define it. That’s down the road of course - i know you’re testing it now.

              Are there any programmers here who’d like to see this made? - To be honest it would be much better (and more robust) if it were made in PHP, and also a proper plugin would be awesome...

              I will go online next days, so i will work with PHx for the permission to publish (facebook logged in user -> display chunk)

              This sounds brilliant, I think PHx is great - having something like this as a proper plugin along side Jot would take MODx to the next level for me (and my clients) absolutely everybody in their target audience uses Facebook - the possibilities are really something smiley
                MODX Ambassador for Thailand. Managing Director at Monogon, a web design and development studio based in Bangkok, Thailand. - Follow me on Twitter.
                • 10792
                • 13 Posts
                Quote from: gianfra at Jan 30, 2009, 02:24 AM

                Something like this

                But, apparently, it works wink


                Ehm, the xd_receiver.htm was unpublished wink so now it works for all the users. Comments?
                  • 34193
                  • 330 Posts
                  Looking good have managed to get some where similar just haven’t had time to post details yet. Will spend some time over the weekend looking at it. Have got to update my tax accounts Sat morning, so watch for details appearing Sat pm and Sunday.

                  Have also got it displaying a list of friends as well.

                  And created snippets to do it.
                  • Just to mention this, Brett from The Man Can!, has given me the heads up that he and his team are developing a neat MODx plugin for RPX which looks totally awesome.

                    Not sure when it will be ready to test or anything, but I’ll point him in the direction of this thread and maybe he can let us know...
                      MODX Ambassador for Thailand. Managing Director at Monogon, a web design and development studio based in Bangkok, Thailand. - Follow me on Twitter.
                      • 10792
                      • 13 Posts
                      10x Mallmus!

                      I already have a update, about the famous screencast "The things i say: showing how to implement FB Connect in 8 minutes".

                      This video show a form like this:
                      <form>
                      <input .. name="authot">
                      <input.. name="content"> <- (or a textarea, is the same)
                      <input type="submit">
                      </form>

                      The screencast show a <input name="author"> which is replaced via javascript with a <span><fb:name uid=loggedinuser useyou=false></fb:name></span>.
                      Obiousvly don’t work.

                      The second problem is: if i set <input name="author" value="<fb:name uid=loggedinuser useyou=false></fb:name>"> , when i click on "submit", the output for author is: <fb:name uid=loggedinuser useyou=false></fb:name>  (the code xfbml; not the real name of the author!)

                      I have read the entire documentation on Facebook connect, but it is too difficult for me.
                      So i have found (and apply with success) the solution described here: http://dentedreality.com.au/2008/12/implementing-facebook-connect-on-wordpress-in-reality/
                      The code is for Wordpress, but with a *simple* customization it works with every site (and with Jot).

                      Now, you have a way to decide on your site: if a user is logged in facebook, then show a specific chunk.

                      I hope interesting!
                      Thanks, Gianfra