1. Halo Guest, pastikan Anda selalu menaati peraturan forum sebelum mengirimkan post atau thread baru.

Simple Facebook Application - Update Status

Discussion in 'Pemrograman Web' started by ghprodho, Mar 22, 2010.

  1. ghprodho

    ghprodho Ads.id Pro

    Joined:
    Jan 27, 2010
    Messages:
    309
    Likes Received:
    216
    Location:
    http://buzzknow.com
    Halo Bro,

    bbrp waktu yang lalu aku pernah buat thread ini

    http://www.adsense-id.com/forums/showthread.php/35080-%5BHOT%5B-Yang-ikutan-online-earning-dari-Facebook-masuk-sini!

    nah , skrg aku share aplikasi sederhana buat langkah pertama bro yang pgn cobain cari duit lwt Facebook+CPM ads.

    Skrg kodenya

    PHP:
    <?php

    require_once ../../'facebook.php';

    $appapikey 'xxxxx';
    $appsecret 'xxxxx';

    define('APP_NAME''Blackberry Onyx');
    define('APP_URL''http://domain.com/_app/nama-aplikasi/');
    define('CANVAS_URL''http://apps.facebook.com/nama-aplikasi/');

    $facebook         = new Facebook($appapikey$appsecret);

    $user_id         $facebook->require_login($required_permissions 'status_update');
    $has_permission $facebook->api_client->users_hasAppPermission("status_update");

    if(!
    $has_permission){
        echo 
    "
        <div class=\"fbinfobox\" style=\"width: 500px;\">
        Please choose '<u>Allow Publishing</u>' for '<u>Request for Special Permissions</u>'
        <br />
        Or manually click here <fb:prompt-permission perms=\"status_update\">Allow Publishing</fb:prompt-permission>.
        </div>"
    ;
        echo 
    "
        <script> 
        Facebook.showPermissionDialog('status_update, read_stream', function(result)
            {
                result == '' ? false : (document.setLocation('"
    .CANVAS_URL."?var=1'));
            }
        );
        </script>
        <br /><br />
         "
    ;
    }

    <!--
    STYLE-->
    <
    style type="text/css">
    /* Default Facebook CSS */
    .fbbody
    {
        
    font-family"lucida grande" ,tahoma,verdana,arial,sans-serif;
        
    font-size11px;
        
    color#333333;
    }
    /* Default Anchor Style */
    .fbbody a
    {
        
    color#3b5998;
        
    outline-stylenone;
        
    text-decorationnone;
        
    font-size11px;
        
    font-weightbold;
    }
    .
    fbbody a:hover
    {
        
    text-decorationunderline;
    }
    /* Facebook Box Styles */
    .fbgreybox
    {
        
    background-color#f7f7f7;
        
    border1px solid #cccccc;
        
    color#333333;
        
    padding10px;
        
    font-size13px;
        
    font-weightbold;
    }
    .
    fbbluebox
    {
        
    background-color#eceff6;
        
    border1px solid #d4dae8;
        
    color#333333;
        
    padding10px;
        
    font-size13px;
        
    font-weightbold;
    }
    .
    fbinfobox
    {
        
    background-color#fff9d7;
        
    border1px solid #e2c822;
        
    color#333333;
        
    padding10px;
        
    font-size13px;
        
    font-weightbold;
    }
    .
    fberrorbox
    {
        
    background-color#ffebe8;
        
    border1px solid #dd3c10;
        
    color#333333;
        
    padding10px;
        
    font-size13px;
        
    font-weightbold;
    }
    /* Content Divider on White Background */
    .fbcontentdivider
    {
        
    margin-top15px;
        
    margin-bottom15px;
        
    width520px;
        
    height1px;
        
    background-color#d8dfea;
    }
    /* Facebook Tab Style */
    .fbtab
    {
        
    padding8px;
        
    background-color#d8dfea;
        
    color#3b5998;
        
    font-weightbold;
        
    floatleft;
        
    margin-right4px;
        
    text-decorationnone;
    }
    .
    fbtab:hover
    {
        
    background-color#3b5998;
        
    color#ffffff;
        
    cursorhand;
    }
    blockquote background:transparent url(http://www.facebook.com/images/start_quote_small.gif) no-repeat scroll -1px 0; line-height:14px;margin-left: 0; padding:0 0 0 16px; } 
    blockquote span background:transparent url(http://www.facebook.com/images/end_quote_small.gif) no-repeat scroll right bottom; padding:0 15px 0 0; }
    td.list img{
        
    border1px solid #ccc;
        
    padding4px;
    }
    </
    style>
    <!--/
    STYLE-->

    <?
    php

    /* check process */
        
    if( !empty($_REQUEST["action"]) ) {    
        
            
    $message    strip_tags($_REQUEST['status']);
            if(
    get_magic_quotes_gpc()){$message stripslashes($message);}
            
            
    $facebook->api_client->users_setStatus($message);
            
            echo 
    '
            <div class="fbinfobox" style="width: 720px;" id="box_notice">
            Your status updated! Thanks
            </div>
            <br />
            '
    ;
            
            echo 
    "
            <script type=\"text/javascript\">
            function hide_box()
            {
                var elm = document.getElementById('box_notice');
                Animation(elm).to('height', '0px').to('opacity', 0).hide().ease(Animation.ease.end).go(); 
            }
            
            setTimeout(function() {hide_box()}, 5000);
            </script>
            "
    ;
        }
        
    ?>

    <h2>Hello <fb:name uid="<?php echo $user_id?>" useyou="false" /> , this is your current status : </h2>
    <br />
    <div class="fbbluebox" style="width: 720px;">
    <blockquote><span> <fb:user-status uid="<?php echo $user_id?>" linked="true"/></span></blockquote>
    </div>

    <br />

    <fb:iframe src='http://rya.rockyou.com/ams/ad.php?placeguid=C9BF841713&type=Leaderboard' style='border:0px;' width='728' height='90' scrolling='no' frameborder='0'/>

    <table class="lists" cellspacing="0" border="0"> 
    <tr>

        <td class="list"> </td>
        <td class="spacer"></td>
        <td class="list"><b style="margin-left: 12px;">Write your status here!</b></td>
        <td class="spacer"></td>
        <td class="list"></td>
        
    </tr>

    <tr>
        <td class="list"><br />
        <fb:profile-pic uid="<?php echo $user_id?>" size="small" linked="true" width="75" height="75" />
        </td>

        <td class="spacer"></td> 
        
        <td class="list"> 
        <fb:editor action="?action=do" labelwidth="1" width="468"> 

        <fb:editor-textarea label="" name="status"/> 

        <fb:editor-buttonset> 
        <fb:editor-button value="Update status"/> 
        </fb:editor-buttonset> 

        </fb:editor>
        </div>
        </td>
        
        <td class="spacer"></td>
        <td class="list"> <fb:bookmark /> </td>
    </tr>
    </table>

    <br clear="both" />

    <br />
    <fb:iframe src='http://rya.rockyou.com/ams/ad.php?placeguid=BAFDE40998&type=Leaderboard' style='border:0px;' width='728' height='90' scrolling='no' frameborder='0'/>
    <br />

    <center>
    <fb:iframe src='http://rya.rockyou.com/ams/ad.php?placeguid=1C90741108&type=MediumRectangle' style='border:0px;' width='300' height='250' scrolling='no' frameborder='0'/>
    <fb:iframe src='http://rya.rockyou.com/ams/ad.php?placeguid=DD3FB41109&type=MediumRectangle' style='border:0px;' width='300' height='250' scrolling='no' frameborder='0'/>
    </center>
    Aplikasi tersebut udah aku pasang RockYouAds, tgl dganti dgn punya bro, atau tetep mau pake punya ku juga gpp :p

    Untuk setup new application bisa baca ini sbg referensi

    Smg berguna bro :)
    Yang pengen konsultasi lebih lanjut bisa add YM ku : greenhouseprod

    Smg sukses dan bnyak rejeki bro.
    Jgn lupa kasih REP++ klo bguna y ... :D

    Aplikasiku yang lain

     
    diemaz, masmberit, onnie and 7 others like this.
  2. zizot05

    zizot05 Super Hero

    Joined:
    Nov 1, 2009
    Messages:
    1,478
    Likes Received:
    61
    Location:
    Plat F
    boz itu cuma 1 doang file php'y??

    gak ada file untuk pemanggilan kode atau apa gitu?? :hmm:
     
  3. ghprodho

    ghprodho Ads.id Pro

    Joined:
    Jan 27, 2010
    Messages:
    309
    Likes Received:
    216
    Location:
    http://buzzknow.com
    Iyah bro cukup 1 file aja :)

    kita tgl include dari facebook class yang udah d sediain dr sana :)

    coba bro baca http://buzzknow.com/2010/03/04/creating-a-simple-facebook-application-tutorial-with-php/ utk awalan ..
     
  4. hadie87

    hadie87 Densus 99

    Joined:
    Sep 10, 2009
    Messages:
    5,920
    Likes Received:
    3,046
    Location:
    Baturaja, Indonesia
    Maaf gw ga ngerti .... :hmm:
     
  5. ghprodho

    ghprodho Ads.id Pro

    Joined:
    Jan 27, 2010
    Messages:
    309
    Likes Received:
    216
    Location:
    http://buzzknow.com
    Hehheheh, yukz blajar brg .... :gembira:
     
  6. gogobilo

    gogobilo Super Hero

    Joined:
    Dec 1, 2009
    Messages:
    765
    Likes Received:
    33
    wah, otak belum konek nih.. mesti monitor dulu :senyum:
     
  7. ghprodho

    ghprodho Ads.id Pro

    Joined:
    Jan 27, 2010
    Messages:
    309
    Likes Received:
    216
    Location:
    http://buzzknow.com
    heheeheh, monitor LCD?

    hiiiiihiiiihihi :p

    :senyum:
     
  8. heridanu

    heridanu Ads.id Pro

    Joined:
    Apr 22, 2009
    Messages:
    445
    Likes Received:
    30
    Wah, gak mudeng aku :nangis:

    Usul bro, gimana kalo dibuatin tutorial yang detil,

    biar kita-kita bisa ngerti gitu :silau:
     
  9. gogobilo

    gogobilo Super Hero

    Joined:
    Dec 1, 2009
    Messages:
    765
    Likes Received:
    33
    setuju banget !! 2 request menantimu sob.. :senyum:
     
  10. ghprodho

    ghprodho Ads.id Pro

    Joined:
    Jan 27, 2010
    Messages:
    309
    Likes Received:
    216
    Location:
    http://buzzknow.com
    wah maaf klo krg detail bro ...

    Ok, smg bsk bisa aku buatin yang versi detailnya :)
     
  11. h1g4m

    h1g4m Super Hero

    Joined:
    Mar 18, 2009
    Messages:
    1,429
    Likes Received:
    78
    Location:
    Serang - banten
    ane coba kok error ya gan :hmm:
     
  12. AnggaRifandi

    AnggaRifandi Hero

    Joined:
    Jan 24, 2010
    Messages:
    720
    Likes Received:
    28
    Location:
    Bekasi Timur
    Terima kasih atas tutorial bikin Facebook Applicationnya. Sedang mencoba menelaah lagi sembari bereksperimen :)
     
  13. ghprodho

    ghprodho Ads.id Pro

    Joined:
    Jan 27, 2010
    Messages:
    309
    Likes Received:
    216
    Location:
    http://buzzknow.com
    Bsa paste code error nay k sini bro?

    thanks
     
  14. h1g4m

    h1g4m Super Hero

    Joined:
    Mar 18, 2009
    Messages:
    1,429
    Likes Received:
    78
    Location:
    Serang - banten
    Received HTTP error code 404 while loading hxxp://blablabla.com/folder/

    --- Update ---

    itu codenya di save jadi file apa gan.. misal : facebook.php
    trus setting canvasnya sama connect yg belum mudeng :hmm:
     
  15. ghprodho

    ghprodho Ads.id Pro

    Joined:
    Jan 27, 2010
    Messages:
    309
    Likes Received:
    216
    Location:
    http://buzzknow.com
    untuk canvas ama connect d set k domain bro, pathnya sesuai lokasi index.php

    trus opsi canvas, pilih sbg FBML :)
     
  16. zizot05

    zizot05 Super Hero

    Joined:
    Nov 1, 2009
    Messages:
    1,478
    Likes Received:
    61
    Location:
    Plat F
    nih aplikasi guna'y buat update status doang yah?? :hmm:

    kira2 banyak yang pake gak?? klo aplikasi bikin Quiz atau Trivia punya gak om kode'y??
     
  17. ghprodho

    ghprodho Ads.id Pro

    Joined:
    Jan 27, 2010
    Messages:
    309
    Likes Received:
    216
    Location:
    http://buzzknow.com
    Iyah om cm buat update status :)

    hmmmm, klo bnyak yang pake ato ga, itu tgantung promosi juga d kayanya bro ...

    quiz ama trivia g ada .... hehehheh ...

     
  18. h1g4m

    h1g4m Super Hero

    Joined:
    Mar 18, 2009
    Messages:
    1,429
    Likes Received:
    78
    Location:
    Serang - banten
    :gembira: berhasil berhasil hore :gembira:

    --- Update ---

    kalo ada yg mau mampir :senyum:

     
  19. ghprodho

    ghprodho Ads.id Pro

    Joined:
    Jan 27, 2010
    Messages:
    309
    Likes Received:
    216
    Location:
    http://buzzknow.com
    selaaaammmmaattt gan ... :gembira:
     
  20. sigsig

    sigsig Super Hero

    Joined:
    Jan 27, 2009
    Messages:
    3,454
    Likes Received:
    116
    Location:
    JOGJA
    bro yang rockyouads gmn tuh? gede ngga dapetnya? bisa di pasang Ads yang laen ngga?? secara FB banyak temen yang Lokal (indonesia). thx u..:silau:
     

Share This Page