We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34193
    • 330 Posts
    Quote from: gianfra at Feb 17, 2009, 04:00 PM

    Pete Thank you anymore!

    I think this file is missing: "assets/snippets/facebook/php/facebook.php", but it is invocated into the snippet code.
    (i retrieve a "Parse error: document not found")



    Yes the libary is PHP5 try the one available here http://kev.friendsdensity.com/fb.php this is an unoffical libary but is listed on the facebook site just drop the files after extraction into the facebook/php/ folder and try.  Let me know what happens.
      • 10792
      • 13 Posts
      Uh-uh, it works!

      So, for PHP4 users, the library needed is available here: http://kev.friendsdensity.com/fb.php

      I confirm that, following the steps above, the snippet work. Thank you  grin
        • 34193
        • 330 Posts
        Quote from: gianfra at Feb 17, 2009, 04:52 PM

        Uh-uh, it works!

        So, for PHP4 users, the library needed is available here: http://kev.friendsdensity.com/fb.php

        I confirm that, following the steps above, the snippet work. Thank you grin

        Good on more problem solved now onto the rest of it things like posting to feeds / recomend friends / etc.. not sure when I will get on to that bit got a paid project I need to put some work into so prob won’t be for a few days.
          • 27302
          • 154 Posts
          I can sort of get this to work. When I click on the Facebook Connect button I get the pop up window asking me if I’d like to connect with Facebook, then it loads my website inside the pop-up window.
            • 31111
            • 27 Posts
            I couldn’t even get that far. The facebook connect button loads, then disappears less than a second later. If I’m quick enough to click on it, I get a pop up window that I specified the wrong API key.

            I was careful to copy and paste my key into the provided code, and re-completed this step. This is going to take some thinking...
              • 1024
              • 4 Posts

              First of all Pete: thank you for sharing your work! It is really appreciated.

              Hello Everyone, im a newbie in all things ModX so please be patient with me:

              Now, im really unclear in how would you go about Pete’s step 5. Where should i create this adduser.php file so i am able to set it to a [!facebook!] Content Type? am i missing something here because im only getting the standard text/html in the Content Type combo box.

              Thanks everyone!

              Alejandro

                • 1024
                • 4 Posts
                Ok so it seems i had a severe case of "Tunnel Vision"

                It turns out i misinterpreted the Content Type... when in full context it mean "then in the content section write"

                Can someone please explain a little bit burther on the purpose of the facebook document and user group?

                Thanks!
                  • 1024
                  • 4 Posts

                  Just for the sake of completion:


                  • I managed to get this working, thanks Pete!
                  • xd_receiver won’t work if you use Pete’s plug-in. It seems it does not like the ajax scripts and the FB.init in there. So in order to get it working, disable the plug-in, include the scripts and the facebook namespace in your template
                  • have fun!


                  Also i noticed that the Web user is created with the right name, but the email appears as a long string of characters. I wonder if this was the intended result?

                  I know the template solution is not as elegant as Pete intended with his plugin, but until i find out how to do a "selective" OnWebPagePrender event, it must be done like this.


                  Hope this helps,


                  Alejandro

                    • 20413
                    • 2,877 Posts
                    I had no problem with the plugin when I tested this, are you sure that the xd_receiver is located in root? smiley
                    Yes that is how the username and e-mail gets...

                    Check...
                    -that you don’t use <?php tags with the plugin code
                    -that after you added &account=Account;string; you saved
                    the plugin to come back again and add your api number!
                      @hawproductions | http://mrhaw.com/

                      Infograph: MODX Advanced Install in 7 steps:
                      http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                      Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                      http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                      • 1024
                      • 4 Posts

                      Thanks for the reply mrhaw. I tried that and it still does not work xd_receiver.htm just does not play well with the Jquery/FeatureLoader scripts. I even tried in a simple page without modx getting involved and i got the same results. But if add them in a template it works just fine.

                      Some other stuff:

                      the login($user) function never actually finished loading for me with the original adduser.php snippet posted by Pete, so never got back the span with the facebook avatar and username. For the script to work i had to delete/comment out the following part:

                      //get login home page
                        $ok=false;
                        if(isset($modx->config['login_home']) && $id=$modx->config['login_home']) {
                             if ($modx->getPageInfo($id)) $ok = true;
                         }
                         if (!$ok) {
                              // check if a login home id page was set
                              foreach($liHomeId as $id) {
                                  $id = trim($id);
                                  if ($modx->getPageInfo($id)) {$ok=true; break;}
                              }
                          }
                      
                      


                      Now it works like it should. The user is logged to modx via weblogin, and it goes online with facebook (plus it gets added to modx if user does not exist). However i would like not only the facebook connect div to refresh when logged in, but also the weblogin snippet as well (i dont want the user/password form to be displayed, but the "user has been logged in" dialog... which by the way appears if i do a refresh on the browser on that page, so i know the user IS logged in.) I thought that the invokeEvent "OnWebLogin" would do this but it does not work.


                      Also the alerts when checking if user has been blocked etc, do not work.

                      I will continue to work on this and post my findings along the way,


                      Cheers


                      Alejandro