h1k3's Forum Posts

  • It does echo back the email as well. I figured it out. Had something to do with the text box layout. It's showing up fine now. Setting the email up was a pain though, had to ask for an extra permission in order to receive it. You were able to see my php file? Any obvious errors? It seems to work fine. Heres a copy of it, I'm new to php so I'll take any help I can get. :)

    <?

    // Remember to copy files from the SDK's src/ directory to a

    // directory in your application on the server, such as php-sdk/

    require_once('facebook.php');

    $config = array(

        'appId' => 'xxxxxx',

        'secret' => 'xxxxxxx',

    );

    $facebook = new Facebook($config);

    $user_id = $facebook->getUser();

    ?>

    <?

        if($user_id) {

          // We have a user ID, so probably a logged in user.

          // If not, we'll get an exception, which we handle below.

          try {

            //$info = $facebook->api( '/me/groups', 'GET');

            //$ct = count( $info['data'] );

            //$user_groups = $facebook->api('/me/groups','GET');

            $user_profile = $facebook->api('/me','GET');

            echo $user_profile['name'] . "," . $user_profile['link'] . "," . $user_profile['id'] . "," . $user_profile['first_name'] . "," . $user_profile['last_name'] . "," . $user_profile['username'] . "," . $user_profile['email'] . "," . $user_profile['gender'] . "," . $user_profile['timezone'] . "," . $user_profile['locale'] . "," . $user_profile['verified'] . "," . $user_profile['updated_time'];

           

          } catch(FacebookApiException $e) {

            // If the user is logged out, you can have a

            // user ID even though the access token is invalid.

            // In this case, we'll get an exception, so we'll

            // just ask the user to login again here.

            $login_url = $facebook->getLoginUrl();

            echo 'Please <a href="' . $login_url . '">login.</a>';

            error_log($e->getType());

            error_log($e->getMessage());

          }   

        } else {

          // No user, print a link for the user to login

          $login_url = $facebook->getLoginUrl();

          echo 'Please <a href="' . $login_url . '">login.</a>';

        }

    ?>

  • Update: haven't checked but I think I found the problem. Safari shows it fine. Not in front of the pc but I'm thinking the size of the text box and how different browsers display the fonts might be to blame and I just need to resize the text box? Is there a way to resize it dynamically at runtime based on length of the string?

  • Hi everyone. I need some assistance if possible with a facebook app I'm creating.

    facebooklogin.php

    I can pull up all the variables as you can see, but when I assign it to a variable or array instance as a text and then assign the variable to a textbox it doesn't show up. If you go to

    My game site

    and click on create it brings you to the page that shows other info. But the email text box is not showing up. I know I'm using tokenat properly as the other items are showing up. Is there a different type of variable to use when storing an email address?

  • You would need to handle that outside of construct2 I believe. I've personally started using php to interact with Facebook. You can access all the features including Facebook credits. Here's a link to help you get started if you want to branch out to php.

    developers.facebook.com/docs/reference/php

  • I had this concern at first with the game I'm working on

    apps.facebook.com/relicsofyore

    In the title create a character screen the text input box was jumping around depending on the browser I was toying with. A little while later I realized the browser zoom levels were all different. Once I set the zoom to 100% for each browser the text box stopped jumping around. Is there anyway to set the zoom level inside of construct2 to avoid this little glitch in resizing?

  • No not yet, I want to include the gamepad which only works in beta chrome and beta firefox right?

  • Note I also checked IE. IE loads everything as well but the Facebook picture is a little teaky in that it shakes. The text names display fine so it appears to just be a Nightly issue?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi guys,

    I'm not sure what is happening but I'm having a slight issue with the Facebook plugin.

    I have a little text box for the user first and last name and a picture box for the facebook picture. Using Chrome and Firefox Nightly I can log in and the profile picture loads fine. In Nightly however the player name text boxes never appear. In Chrome they do. It seems like the code must be working for Chrome to function properly. Any idea why Nightly might not be displaying?

    Here is my game

    <img src="http://dl.dropbox.com/u/77974757/sampleevents.PNG" border="0">

    <img src="http://dl.dropbox.com/u/77974757/sampletextbox.PNG" border="0">

  • Ty twdead. :) php is brand new to me so the correction is greatly appreciated. :)

  • After going crosseyed looking for info for newbies I decided to do the ole trial and error to link up to a mysql database. So far what I can do is send info to the database. This tutorial assumes you can create the mysql database already.

    1: Populate the mysql database with the following fields

    -playerid(varchar(30)

    -timestamp(timesent) set this to autoincrement

    -text(varchar(255)

    2: Here is the PHP file

    <?php

    $username = $_GET['fname'];

    $score = $_GET['testy'];

    $con = mysql_connect("localhost","userid","password");

    if (!$con)

    {

    die('Could not connect: ' . mysql_error());

    }

    mysql_select_db("name of database", $con);

    mysql_query("INSERT INTO chat (playerid, text) VALUES ($username, $score)");

    mysql_close($con);

    ?>

    3: Now in your layout create a text box called "chatinput" as well as a button called "chatinputsend"

    4: In the event sheet create an event

    chatinputsend - onclick - AJAX - Request - "phpfiledirectorylisting?fname='lance'&testy='" & chatinput.Text & "'"

    The above code sends the text box information into the appropriate fields within the mysql database. Hope that helps. Now to just figure out how to pull the information down from the database to populate a text window. Any ideas?