Y T Nuke  
Results 1 to 18 of 18
ok i need somebody who is good with facebook apps for some advice. i have ...
  1. #1
    choother is offline Junior Member
    Join Date
    Nov 2011
    Posts
    142
    Reputation
    11
    Thanks
    15
    Thanked 18 Times in 10 Posts

    Default Facebook app help

    ok i need somebody who is good with facebook apps for some advice.

    i have made a app using the firstorm 2 guide, the app works fine, the allow permision pop-up works, but here is the problem...

    the app dose not post on the users wall. (it should leave a post advertising the app to friends on a users wall")

    also when i check the database in phpmyadmin it dose not seem to be capturing the email adress and detaisl of the user. so i think the error maybe related to the database?

    im not too sure what could have gone wrong? but when i use the debug tool in facebook tools section the only problem that comes up is this...

    Open Graph Warnings That Should Be Fixed


    Extraneous Property:Objects of this type do not allow properties named og:site_url


    i would be very grateful if somebody could point me in the right direction

  2. #2
    choother is offline Junior Member
    Join Date
    Nov 2011
    Posts
    142
    Reputation
    11
    Thanks
    15
    Thanked 18 Times in 10 Posts

    Default Re: Facebook app help

    did facebook change somthing, since the firestorm course was made? cos i gone through all the steps like a million times and done everything like for like

  3. #3
    CoolAdvisor's Avatar
    CoolAdvisor is offline Jr. VIP
    Join Date
    Mar 2008
    Posts
    487
    Reputation
    66
    Thanks
    698
    Thanked 138 Times in 82 Posts

    Default Re: Facebook app help

    Do you request special permissions?
    Also, the user also maybe blocked posting by others on his wall.
    You also need to store special code, unique to the user id and your app.

  4. #4
    CoolAdvisor's Avatar
    CoolAdvisor is offline Jr. VIP
    Join Date
    Mar 2008
    Posts
    487
    Reputation
    66
    Thanks
    698
    Thanked 138 Times in 82 Posts

    Default Re: Facebook app help

    it's hard to tell without the code

  5. #5
    choother is offline Junior Member
    Join Date
    Nov 2011
    Posts
    142
    Reputation
    11
    Thanks
    15
    Thanked 18 Times in 10 Posts

    Default Re: Facebook app help

    Quote Originally Posted by CoolAdvisor View Post
    Do you request special permissions?
    Also, the user also maybe blocked posting by others on his wall.
    You also need to store special code, unique to the user id and your app.
    thanks for your reply.

    I request the special permissions i need.

    The wall posts arn't blocked because i tested this with a couple of my own accounts.

    im not sure how what this means about storing the permissions unique to the user, im pretty sure this is handled by the script i uploaded

  6. #6
    choother is offline Junior Member
    Join Date
    Nov 2011
    Posts
    142
    Reputation
    11
    Thanks
    15
    Thanked 18 Times in 10 Posts

    Default Re: Facebook app help

    Code:
    // FB App System, version 2.0
    //copyright 2010-2011, FBappSystem.com
    //For Personal Use Only:
    //You may install it on your domain only.
    //You MAY NOT install it on pages and domains not owned by you, or pass it to others for their use.
    //Unauthorized duplication, distribution or use are STRICTLY FORBIDDEN and are punishable by U.S. and international law.
    window.fbAsyncInit = function() {
        FB.init({ appId: appid, status: true, cookie: true, xfbml: true });
        FB.getLoginStatus(function(response) {
            if (response.session) {
              var access_token = response.session.access_token;
                FB.api(
                                                {
                                                    method: 'fql.query',
                                                    query: 'SELECT uid,pic_big,name,email,birthday_date,sex,first_name,last_name,current_location FROM user WHERE uid=' + FB.getSession().uid
                                                },
                                 function(response) {
                                    var user = response[0];
                                        var city = "";
                                        var state = "";
                                        var country = "";
                                     if (user.current_location != null) {
                                          city = user.current_location['city'];
                                          state = user.current_location['state'];
                                          country = user.current_location['country'];
                                     }
                                     //setTimeout("alert('hello')",1250);
                                       CheckUser(user.uid, user.name, user.email, user.sex,  user.birthday_date, city, state, country,access_token);
                                     // postwallmessage() ;
                                 });     // A user has logged in, and a new cookie has been saved
            }
        });
    
    };
    (function() {
        var e = document.createElement('script');
        e.type = 'text/javascript';
        e.src = document.location.protocol +
                        '//connect.facebook.net/en_US/all.js';
        e.async = true;
        document.getElementById('fb-root').appendChild(e);
    } ());
     
    function CheckUser(facebookid,name,email,sex,bdate,city,state,country,access_token)
       {
                         // alert(name); alert(name);
           $.ajax({
               type: "POST",
               url: websiteurl+"ajax.php",
                         async:false,
               data: "fid=" + facebookid + "&name=" + name + "&email=" + email + "&sex=" + sex  + "&bdate=" + bdate + "&city=" + city + "&state=" + state + "&country=" + country+"&accesstoken="+access_token,
               success: function(msg) {
                             //   alert(msg);
     
    
               }
                        ,
               error: function(xmlHttpRequest, textStatus, errorThrown) {
     
               }
           });
       }
    
    ///This function post the axiom to user wall
    ////This function is  used to post to the user wall
                function PostFeeds() {
             var params = {};
             params['message'] = '';
             params['name'] = "Social Profit Formula Bonus!";
             params['description'] = "Purchase Social Profit Formula through my link and receive my never before released software 'The FB App System' an iPad2 http://FBappSystem.com/sfp";
             params['link'] = "http://apps.facebook.com/spfbonus/default.php";
             params['picture'] = "http://apps.facebook.com/spfbonus/logo.jpg";
             params['caption'] = "FBappSystem.com/sfp";
             FB.api('/me/feed', 'post', params, function(response) {
                 if (!response || response.error) {
                  //alert(dump(response));
                 } else {
                       // alert(dump(response));
                 }
             });
         }
    
         function dump(arr, level) {
        var dumped_text = "";
        if (!level) level = 0;
        //The padding given at the beginning of the line.
        var level_padding = "";
        for (var j = 0; j < level + 1; j++) level_padding += "    ";
        if (typeof (arr) == 'object') { //Array/Hashes/Objects
            for (var item in arr) {
                var value = arr[item];
                if (typeof (value) == 'object') { //If it is an array,
                    dumped_text += level_padding + "'" + item + "' ...\n";
                    dumped_text += dump(value, level + 1);
                } else {
                    dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
                }
            }
        } else { //Stings/Chars/Numbers etc.
            dumped_text = "===>" + arr + "<===(" + typeof (arr) + ")";
        }
        return dumped_text;
    }
    i assume this is the code you need to see?

  7. #7
    choother is offline Junior Member
    Join Date
    Nov 2011
    Posts
    142
    Reputation
    11
    Thanks
    15
    Thanked 18 Times in 10 Posts

    Default Re: Facebook app help

    i guess the problem has to be somthing to do with my database not interacting with facebook because the only 2 features that dont work is wall posting and collecting the users e-mail.

    and they are the two things handled by my php database.

    but they also require permissions. but when i test the app the permissions request box comes up and requests the permission i need then redirects me to app so i looks as though it works.

    anybody else followed the facebook firestorm guide, and experienced anything similar?

  8. #8
    CoolAdvisor's Avatar
    CoolAdvisor is offline Jr. VIP
    Join Date
    Mar 2008
    Posts
    487
    Reputation
    66
    Thanks
    698
    Thanked 138 Times in 82 Posts

    Default Re: Facebook app help

    I meant this: "access_token", when I mentioned "special code"

  9. #9
    CoolAdvisor's Avatar
    CoolAdvisor is offline Jr. VIP
    Join Date
    Mar 2008
    Posts
    487
    Reputation
    66
    Thanks
    698
    Thanked 138 Times in 82 Posts

    Default Re: Facebook app help

    Code:
     //alert(dump(response));
                 } else {
                       // alert(dump(response));
    Uncomment these alerts to look on the responses

  10. The Following User Says Thank You to CoolAdvisor For This Useful Post:

    choother (01-14-2012)

  11. #10
    choother is offline Junior Member
    Join Date
    Nov 2011
    Posts
    142
    Reputation
    11
    Thanks
    15
    Thanked 18 Times in 10 Posts

    Default Re: Facebook app help

    Quote Originally Posted by CoolAdvisor View Post
    Code:
     //alert(dump(response));
                 } else {
                       // alert(dump(response));
    Uncomment these alerts to look on the responses

    sorry to be such a noob but i know nothing about coding...

    when you say uncomment, dose that mean i remove //?

  12. #11
    CoolAdvisor's Avatar
    CoolAdvisor is offline Jr. VIP
    Join Date
    Mar 2008
    Posts
    487
    Reputation
    66
    Thanks
    698
    Thanked 138 Times in 82 Posts

    Default Re: Facebook app help

    when you say uncomment, dose that mean i remove //?
    Yes, exactly

  13. #12
    choother is offline Junior Member
    Join Date
    Nov 2011
    Posts
    142
    Reputation
    11
    Thanks
    15
    Thanked 18 Times in 10 Posts

    Default Re: Facebook app help

    ok i did this, where will i find error logs? will it create a error file it the directory or somthing?
    Last edited by choother; 01-15-2012 at 07:28 AM.

  14. #13
    CoolAdvisor's Avatar
    CoolAdvisor is offline Jr. VIP
    Join Date
    Mar 2008
    Posts
    487
    Reputation
    66
    Thanks
    698
    Thanked 138 Times in 82 Posts

    Default Re: Facebook app help

    it will popup an alert window in your browser

  15. The Following User Says Thank You to CoolAdvisor For This Useful Post:

    choother (01-15-2012)

  16. #14
    choother is offline Junior Member
    Join Date
    Nov 2011
    Posts
    142
    Reputation
    11
    Thanks
    15
    Thanked 18 Times in 10 Posts

    Default Re: Facebook app help

    Quote Originally Posted by CoolAdvisor View Post
    it will popup an alert window in your browser
    ok i tryed this, then logged into my app with a couple of different account and theres no error's.

    i cant understand why the emails are not being stored in my database?

    any more suggestions?

  17. #15
    CoolAdvisor's Avatar
    CoolAdvisor is offline Jr. VIP
    Join Date
    Mar 2008
    Posts
    487
    Reputation
    66
    Thanks
    698
    Thanked 138 Times in 82 Posts

    Default Re: Facebook app help

    Code:
    FB.init({ appId: appid, status: true, cookie: true, xfbml: true });
    you should insert here your app's id
    "appId: 2396729270" (just a random example)

  18. #16
    choother is offline Junior Member
    Join Date
    Nov 2011
    Posts
    142
    Reputation
    11
    Thanks
    15
    Thanked 18 Times in 10 Posts

    Default Re: Facebook app help

    ok now the script looks like this
    Code:
    // FB App System, version 2.0
    //copyright 2010-2011, FBappSystem.com
    //For Personal Use Only:
    //You may install it on your domain only.
    //You MAY NOT install it on pages and domains not owned by you, or pass it to others for their use.
    //Unauthorized duplication, distribution or use are STRICTLY FORBIDDEN and are punishable by U.S. and international law.
    window.fbAsyncInit = function() {
    FB.init({ appId: 252745XXXX94879, status: true, cookie: true, xfbml: true });
    FB.getLoginStatus(function(response) {
    if (response.session) {
    var access_token = response.session.access_token;
    FB.api(
    {
    method: 'fql.query',
    query: 'SELECT uid,pic_big,name,email,birthday_date,sex,first_name,last_name,current_location FROM user WHERE uid=' + FB.getSession().uid
    },
    function(response) {
    var user = response[0];
    var city = "";
    var state = "";
    var country = "";
    if (user.current_location != null) {
    city = user.current_location['city'];
    state = user.current_location['state'];
    country = user.current_location['country'];
    }
    //setTimeout("alert('hello')",1250);
    CheckUser(user.uid, user.name, user.email, user.sex, user.birthday_date, city, state, country,access_token);
    // postwallmessage() ;
    }); // A user has logged in, and a new cookie has been saved
    }
    });
     
    };
    (function() {
    var e = document.createElement('script');
    e.type = 'text/javascript';
    e.src = document.location.protocol +
    '//connect.facebook.net/en_US/all.js';
    e.async = true;
    document.getElementById('fb-root').appendChild(e);
    } ());
     
    function CheckUser(facebookid,name,email,sex,bdate,city,state,country,access_token)
    {
    alert(name); alert(name);
    $.ajax({
    type: "POST",
    url: websiteurl+"ajax.php",
    async:false,
    data: "fid=" + facebookid + "&name=" + name + "&email=" + email + "&sex=" + sex + "&bdate=" + bdate + "&city=" + city + "&state=" + state + "&country=" + country+"&accesstoken="+access_token,
    success: function(msg) {
    alert(msg);
     
     
    }
    ,
    error: function(xmlHttpRequest, textStatus, errorThrown) {
     
    }
    });
    }
     
    ///This function post the axiom to user wall
    ////This function is used to post to the user wall
    function PostFeeds() {
    var params = {};
    params['message'] = '';
    params['name'] = "Social Profit Formula Bonus!";
    params['description'] = "Purchase Social Profit Formula through my link and receive my never before released software 'The FB App System' an iPad2 http://FBappSystem.com/sfp";
    params['link'] = "http://apps.facebook.com/spfbonus/default.php";
    params['picture'] = "http://apps.facebook.com/spfbonus/logo.jpg";
    params['caption'] = "FBappSystem.com/sfp";
    FB.api('/me/feed', 'post', params, function(response) {
    if (!response || response.error) {
    alert(dump(response));
    } else {
    alert(dump(response));
    }
    });
    }
     
    function dump(arr, level) {
    var dumped_text = "";
    if (!level) level = 0;
    //The padding given at the beginning of the line.
    var level_padding = "";
    for (var j = 0; j < level + 1; j++) level_padding += " ";
    if (typeof (arr) == 'object') { //Array/Hashes/Objects
    for (var item in arr) {
    var value = arr[item];
    if (typeof (value) == 'object') { //If it is an array,
    dumped_text += level_padding + "'" + item + "' ...\n";
    dumped_text += dump(value, level + 1);
    } else {
    dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
    }
    }
    } else { //Stings/Chars/Numbers etc.
    dumped_text = "===>" + arr + "<===(" + typeof (arr) + ")";
    }
    return dumped_text;
    }
    i uncommented the message part and replace the appid with the actual id (i think the config file was taking care of this bit anyways though)

    but still not storing the data

    i really appreciate your responses.
    Last edited by choother; 01-15-2012 at 09:21 PM.

  19. #17
    choother is offline Junior Member
    Join Date
    Nov 2011
    Posts
    142
    Reputation
    11
    Thanks
    15
    Thanked 18 Times in 10 Posts

    Default Re: Facebook app help

    here is a copy of ajax.php for database calls

    Code:
    <?php
     /*  FB App System, version 2.0
     copyright 2010-2011, FBappSystem.com
     For Personal Use Only:
     You may install it on your domain only.
     You MAY NOT install it on pages and domains not owned by you, or pass it to others for their use.
     Unauthorized duplication, distribution or use are STRICTLY FORBIDDEN and are punishable by U.S. and international law. */
     //This section of code manage the database calls
     include ("config.php");
     mysql_connect($db_host, $db_user, $db_pwd) or die("cannot connect");
     mysql_select_db($db_name) or die("cannot select DB");
     ///This section insert the userinfo
     if (isset ($_REQUEST['email'])) {
       $Email = $_REQUEST['email'];
       $facebookid = $_REQUEST['fid'];
       $name = $_REQUEST['name'];
       $gender = $_REQUEST['sex'];
       $bdate = $_REQUEST['bdate'];
       $city = $_REQUEST['city'];
       $state = $_REQUEST['state'];
       $country = $_REQUEST['country'];
       $sql = "select facebookid from facebookdata where facebookid =" . $facebookid . " and appid='" . $appid . "'";
       $result = mysql_query($sql);
       if (mysql_num_rows($result) > 0) {
         echo '1';
       }
       else {
         $sql = "INSERT INTO `facebookdata` (`facebookid`,  `email`, `name`, `gender`,`birthday`,  `state`, `city`, `country`, `appid`) VALUES
                ('$facebookid',  '$Email', '$name', '$gender','$bdate', '$city', '$state','$country','$appid')";
         $result = mysql_query($sql);
         echo 'new';
         $sql = "select * from wallsettings where appid='" . $appid . "'";
         $result = mysql_query($sql);
         if (mysql_num_rows($result) > 0) {
           while ($row = mysql_fetch_array($result)) {
             echo $row['description'];
             echo $returnurl;
             PostToAweber($_REQUEST['name'], $_REQUEST['email'], $aweberlistid);
             posttowall($_REQUEST['accesstoken'], $row['description'], $facebookid, $returnurl,$row['name'], $row['caption'], $row['picture']);
           }
         }
       }
     }
     //This function is used to post to wall of the user
     function posttowall($token, $desc, $uid, $linkurl,$linkname, $message, $imgurl) {
       $attachment = array('access_token' => $token, 'name' => $linkname, 'link' => $linkurl, 'description' => $desc, 'caption' => $message, 'picture' => $imgurl);
       $ch = curl_init();
       curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/' . $uid . '/feed');
       curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
       curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
       curl_setopt($ch, CURLOPT_POST, true);
       curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
       curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     //to suppress the curl output
       $result = curl_exec($ch);
       curl_close($ch);
       echo $result;
     }
     /////This function is used to put the user email in the aweber
     function PostToAweber($name, $email, $aweberlistid) {
       $post_data['listname'] = $aweberlistid;
       $post_data['redirect'] = 'http://' . $_SERVER['HTTP_HOST'];
       $post_data['name'] = $name;
       $post_data['email'] = $email;
       $post_data['meta_adtracking'] = 'custom form';
       $post_data['meta_message'] = '1';
       $post_data['meta_required'] = 'name,email';
       $post_data['meta_forward_vars'] = '1';
       foreach ($post_data as $key => $value) {
         $post_items[] = $key . '=' . $value;
       }
       $post_string = implode('&', $post_items);
       $curl_connection = curl_init('www.aweber.com/scripts/addlead.pl');
       curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
       curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
       curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
       curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
       curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
       curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
       $result = curl_exec($curl_connection);
       print_r($result);
       curl_close($curl_connection);
     }
     ?>
    $db_host, $db_user, $db_pwd is all managed by config

  20. #18
    CoolAdvisor's Avatar
    CoolAdvisor is offline Jr. VIP
    Join Date
    Mar 2008
    Posts
    487
    Reputation
    66
    Thanks
    698
    Thanked 138 Times in 82 Posts

    Default Re: Facebook app help

    for security purposes (anti mysql injections) change this:
    Code:
    $sql = "select facebookid from facebookdata where facebookid =" . $facebookid . " and appid='" . $appid . "'";
    to this:
    Code:
    $sql = "select facebookid from facebookdata where facebookid =" .mysql_real_escape_string($facebookid). " and appid='" .mysql_real_escape_string($appid). "'";
    and this:
    Code:
    $sql = "INSERT INTO `facebookdata` (`facebookid`,  `email`, `name`, `gender`,`birthday`,  `state`, `city`, `country`, `appid`) VALUES
                ('$facebookid',  '$Email', '$name', '$gender','$bdate', '$city', '$state','$country','$appid')";
    to this:
    Code:
    $sql = "INSERT INTO `facebookdata` (`facebookid`,  `email`, `name`, `gender`,`birthday`,  `state`, `city`, `country`, `appid`) VALUES
                ('".mysql_real_escape_string($facebookid)."',  '".mysql_real_escape_string($Email)."', '".mysql_real_escape_string($name)."', '".mysql_real_escape_string($gender)."','".mysql_real_escape_string($bdate)."', '".mysql_real_escape_string($city)."', '".mysql_real_escape_string($state)."','".mysql_real_escape_string($country)."','".mysql_real_escape_string($appid)."')";
    and this:
    Code:
    $sql = "select * from wallsettings where appid='" . $appid . "'";
    to this:
    Code:
    $sql = "select * from wallsettings where appid='".mysql_real_escape_string($appid)."'";

  21. The Following User Says Thank You to CoolAdvisor For This Useful Post:

    choother (01-16-2012)

Dot Gov Backlinks Sale


Smarter Submit

Similar Threads

  1. Facebook CPA APP Offers
    By manmusic in forum Black Hat SEO
    Replies: 0
    Last Post: 11-15-2011, 12:02 AM
  2. Facebook APP ID
    By Tytus in forum Social Networking Sites
    Replies: 2
    Last Post: 11-08-2011, 09:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
  SEnukeX SEO Software
Proudly Powered by Hostwinds.com Web Hosting Click Here For Exclusive BHW Discounts!

Cheap Web Hosting


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76