2 Replies Latest reply on Feb 8, 2012 7:28 AM by chanyan1

    User ID change it to WordPress User list?

    chanyan1 Level 1



      I am using Wordpress, which has PHP and MySql. I want my users to login to my website regularly via a LinkedIn API plugin or Facebook API plugin. (using http://www.oneall.com/)


      Then open VideoPhoneLabs.swf on my webpage.


      * Instead of the User inputting his own username on VideoPhoneLabs, I want to just grab his name as registered on my website to be his/her Username.


      Simple as that. But I have no idea how to do it.



      The alternative I was thinking about was, the user goes to VideoPhoneLabs and then does a LinkedIn API Flash connect (http://www.curiousm.com/labs/2011/03/09/connect-to-linked-in-api-from-as3-and-adobe-air/). This is for AIR.... and this is much a more work for the Users.




      1. When the user is login to my website via WordPress, do anything trigger in MySql? If so, I can find a PHP script with query like GET UserID WHERE .... etc.


      2. Can I update a XML file whenever a User logins to WordPress, and then have PHP script to parse the latest update? But I do know if this would even work.......


      3. How can I simply just get the name??? sigh..




        • 1. Re: User ID change it to WordPress User list?
          dinkdonk3k Level 1

          Hey man,


          I had a similar question the other day and managed to get it sorted, hopefully you are well on the way. What you need to know is just typing the users name in the box and pressing connect calls the web service (the python script provided with the example) and asks if anyone is connected with that username. All I have done to trick this is used Django (python web framework, PHP should work) to provide request.user (or echo the users name from PHP) as a flashvar and then set the flash to autoconnect using that user. Basically it just bypasses the user being able to choose their own username. Whenever the user refreshes the page they are automatically reconnected with their username. It is a very easy change but I can e-mail you once I have open sourced my code. Should be in the next week or so. If you get stuck post some contact details and ill get in touch. This should be all you need. Basically setup wordpress with user accounts or facebook or linkedIn or whatever you want. Then load the page with the flash on with the currently logged in user being passed as a flashvar.


          Sorry to repeat myself I just wanted to be as clear as possible, my memory is not the best. You will have problems with users that aren't online, at the moment if you try and call a user that isnt online the whole lot fails and the application disconnects, you will probably need to change this behaviour. If you can wait about a week or so I have made these changes, added a security code to prevent somebody logging in as somebody else with a modified client and a few more things. It will be up on github as soon as its tidied up.






          • 2. Re: User ID change it to WordPress User list?
            chanyan1 Level 1

            that'll be totally awesome man if you can email that to me when you are ready =)  ; ill love to check it out


            right now i am trying to do this in another way which I posted here on stackoverflow:



            which i found this example online - that connects PHP, JSON, and Flex; then i ran into another trouble which is:


            goto Wordpress php -  do    ...   is_user_login (...   if yes, then $variable = user_name or something;

            then transfer $variable to another PHP file which is Json_encode -ed to get the name onto the Flex app


            it works (see my screenshot) except transfering my variable between 2 PHP files it breaks, where I am stuck at....