25 August, 2011

Ganti Background dipostingan pake javascript

· 7 komentar

Pengen dong tiap kali lo posting, suasana blog termasuk Gambar Background sesuai sama isi postingan lo? ya se'enggak-nya sesuai sama gaya lo deh :D

Normalnya JavaScript buat ngeganti Gambar Background itu kaya gini kira-kira..

<script>

document.body.style.backgroundImage='url(http://blogdowallpaper.files.wordpress.com/2009/04/skate_boy_1024_blogdowallpaper.jpg)';

</script>


Kalo mau pake Timer/Pewaktu

biar nunggu dulu beberapa saat (misal 20 detik) baru Gambar Backgroundnya berubah..
<script>

setTimeout("document.body.style.backgroundImage='url(http://blogdowallpaper.files.wordpress.com/2009/04/skate_boy_1024_blogdowallpaper.jpg)'",20000);

</script>


Kalo pengen Gambar Backgroundnya FullScreen

biarpun gambar yang lo punya ukurannya kecil sekalipun tetep aja bakalan di tampilin selayar penuh..
<style type="text/css">

body {
 width: 100%;
-moz-background-size:100%;
     background-size:100%;
-moz-background-origin:content;
     background-origin:content;
 background-position:top center;
 background-attachment:fixed;
}

</style>


<script>

setTimeout("document.body.style.backgroundImage='url(http://blogdowallpaper.files.wordpress.com/2009/04/skate_boy_1024_blogdowallpaper.jpg)'",20000);


</script>


Warning

Kalo diBlog elo ada Script Random Background Imagenya kemungkinan besar CSS buat nge-bikin FullScreen diatas bakalan ketiban (gak jalan)


Tapi elo gak usah nangis

Ganti aja Script Random Background Imagenya jadi kaya gini..
<script type='text/javascript'>
var bg = [
"http://ALAMAT-GAMBAR.jpg",
"http://ALAMAT-GAMBAR.jpg",
"http://ALAMAT-GAMBAR.jpg"
];

function gantiBg(){
  var bgLeng = bg.length-1;
  var i = Math.floor(Math.random()*bgLeng);
  document.body.style.backgroundImage='url('+bg[i]+')';
}

gantiBg();
</script>
NB: script ini juga bisa ko dipasang di postingan, coba aja..

Kalo mau Gambar Backgroundnya Gonta-ganti sendiri

(misal Gonta-ganti sendiri tiap 20 detik), tinggal nambahin aja Timer
<script type='text/javascript'>
var bg = [
"http://ALAMAT-GAMBAR.jpg",
"http://ALAMAT-GAMBAR.jpg",
"http://ALAMAT-GAMBAR.jpg"
];

function gantiBg(){
  var bgLeng = bg.length-1;
  var i = Math.floor(Math.random()*bgLeng);
  document.body.style.backgroundImage='url('+bg[i]+')';

  setTimeout("gantiBg()",20000);
}

gantiBg();

</script>


10 August, 2011

Web Hosting Gratis

· 0 komentar

Salah satu tempat hosting gratis


Masuk ke www.freewebhostingarea.com buat nge-daftar hosting gratis. Sampe di sana ntar elo di suguhin gorengan form isian yang mirip tampilannya kaya di bawah..

Kalo ngikutin conto di atas, berarti entarnya alamat web lo jadi  http://songgolangit.xp3.biz. Sedikit catetan buat hosting gratis, ada beberapa domain yang gak dibolehin sama pesbuk, diantaranya yang pernah gw coba 0fees.net sama noads.biz, gak tau juga kalo yang lainnya.., elo coba² aja dah sendiri.. ya gak :P
Habis nekan tombol PROCEED elo di ajak ke halaman berikutnya. Kalo di situ ada tulisan misal songgolangit.xp3.biz is available on Noads.biz server. Tapi kalo already created berarti elo mesti ganti pake nama subdomain laen.
Oke anggap lo sukses terus isi apa yang suruh di isi di situ jangan lupa check I have read the Service Agreement and agree to its terms.
Di halaman berikutnya yang perlu di catet:

Kalo enggak, elo save aja satu halaman mendingan haha..

Kick Some Ass for free


Sekarang kita coba bikin halaman perdana di hostingan lo.
- Masuk ke Web based FTP client: misal http://noadsbiz.freewebhostingarea.com/ftp/
- Login pake data yang udah lo catet tadi di atas
- Click buat nge-bikin File baru kasih nama index.php
- Isi suka² elo atau lo bisa pake code di bawah sebagai acuan..
<style type="text/css">
<!--
a#judul-lagu{
  color:#3B5999; 
  text-decoration:none;
}
a#judul-lagu:hover{
  color:#993B59; 
  text-decoration:underline;
}
.pencetan-lagu{
  font-family:"lucida grande",tahoma,verdana,arial,sans-serif; 
  color:#000033;
  text-decoration:none;
  cursor:pointer;
  background-color:#FFFFEE;
  background-image:url(http://www.deltechcorp.com/deltech02/brazil10/picts/menu.gif);
  padding:3px 5px;
  display:inline-block;
  border:1px solid #3B5999;
 -moz-border-radius:3px; border-radius:3px; 
  margin:1px;
  font-size:11px; 
}
.pencetan-lagu:hover, .pencetan-lagu:focus, .pencetan-lagu:active{
  color:darkred;
  text-decoration:none;
  border:1px solid darkred;
}
.pencetan-lagu:focus, .pencetan-lagu:active{
  background-image:none;
}

-->
</style>


<center id="tudey-misik">load</center>

<script type="text/javascript">
<!--
function tulisJudulLagu(txt){
  var tulis  = '<div style="background:transparent url(http://static.ak.fbcdn.net/rsrc.php/v1/yV/r/IJYgcESal33.png) no-repeat scroll 0px -127px; width:230px; height:5px;">

</div>
';
      tulis += '<div style="background-color:#E1E6EE; border-left:1px solid #99A8C7; border-right:1px solid #99A8C7; padding:0 4px; width:220px; text-align:center;">

';
      tulis += '&lgt;b style="font-family:lucida grande,tahoma,verdana,arial,sans-serif; color:#3B5999; font-size:12px; vertical-align:middle;">'+txt+'</b>';
      tulis += '<div style="clear:both;">

</div>
';
      tulis += '</div>
';
      tulis += '<div style="background:transparent url(http://static.ak.fbcdn.net/rsrc.php/v1/yV/r/IJYgcESal33.png) no-repeat scroll 0px -112px; width:230px; height:10px;">

</div>
';
  return tulis;
}
function tulisPlayerLagu(mp3,start,loop,elem){
  var tulis  = '<embed id="'+elem+'" wmode="transparent" ';
      tulis += 'src="http://beemp3.com/player/player.swf?soundFile='+mp3;
      tulis += '&autostart='+start;
      tulis += '&loop='+loop;
      tulis += '&bg=0x000000';
      tulis += '&leftbg=0xAF2910';
      tulis += '&lefticon=0xF2F2F2';
      tulis += '&rightbg=0xD67919';
      tulis += '&rightbghover=0x1BAD07';
      tulis += '&righticon=0xF2F2F2';
      tulis += '&righticonhover=0xFFFFFF';
      tulis += '&text=0xE0E3F4';
      tulis += '&slider=0x357DCE';
      tulis += '&track=0xFFFFFF';
      tulis += '&border=0xFFFFFF';
      tulis += '&loader=0xAF2910" ';
      tulis += 'quality="high" ';
      tulis += 'type="application/x-shockwave-flash" ';
      tulis += 'pluginspage="http://www.macromedia.com/go/getflashplayer" ';
      tulis += 'align="top" height="20">≷/embed>';
  return tulis;
}
var punkMusic = [
{"uri":"http://keekles.org/~bryan/dcc/Blink-182_-_Blink-182_-_08_-_Go.mp3", "judul":"Blink 182 - Go"},
  {"uri":"http://keekles.org/~bryan/dcc/Blink-182_-_Blink-182_-_11_-_Easy_Target.mp3", "judul":"Blink 182 - Easy_Target"},
  {"uri":"http://keekles.org/~bryan/dcc/Blink-182_-_Cheshire_Cat_-_03_-_Fentoozler.mp3", "judul":"Blink 182 - Cheshire Cat Fentoozler"},
  {"uri":"http://keekles.org/~bryan/dcc/Blink-182_-_Cheshire_Cat_-_05_-_Strings.mp3", "judul":"Blink 182 - Cheshire Cat Strings"},
  {"uri":"http://irland.heck.in/files/superman-is-dead-kings.mp3", "judul":"Superman is Dead - kings, queen & poison"},
  {"uri":"http://irland.heck.in/files/superman-is-dead-this-i.mp3", "judul":"Superman is Dead - this is run lone"},
  {"uri":"http://irland.heck.in/files/superman-is-dead-kuta-r.mp3", "judul":"Superman is Dead - kuta rock city"},
  {"uri":"http://bgmustudents.narod.ru/Music/Sum41.mp3","judul":"Sum41 - Still Waiting"},
  {"uri":"http://m0.li.ru/c/0/mp3/0/29582/2958240_SUM41__Over_My_Head.mp3","judul":"SUM41 - Over My Head"},
  {"uri":"http://i3.beon.ru/76/4/220476/0/8390500/SUM41_Fatlip.mp3","judul":"SUM41 - Fatlip"},
    {"uri":"http://irland.heck.in/files/nicky-astria-samar-baya.mp3","judul":"Teh Nicky - Samar Bayang"},
    {"uri":"http://irland.heck.in/files/korn-twist.mp3","judul":"Korn - Twist"},
    {"uri":"http://irland.heck.in/files/nicky-astria-misteri-ci.mp3","judul":"Teh Nicky - Misteri Cinta"},
    {"uri":"http://irland.heck.in/files/doel-sumbang-sla-gila.mp3","judul":"Doel Sumbang - Sila Gila"},
    {"uri":"http://irland.heck.in/files/mulan-jamidong-mahluktu.mp3","judul":"Mulan Jamidong - Mahluk Halus Paling Sexy"},
  {"uri":"http://irland.heck.in/files/netral-dunia-koma.mp3","judul":"Netral - Dunia Koma"},
  {"uri":"http://irland.heck.in/files/netral-hujan.mp3","judul":"Netral - Hujan"},
  {"uri":"http://irland.heck.in/files/netral-indah.mp3","judul":"Netral - Indah"},
  {"uri":"http://irland.heck.in/files/netral-nurani.mp3","judul":"Netral - Nuraeni"},
  {"uri":"http://irland.heck.in/files/netral-desa-ku.mp3","judul":"Netral - Desaku"},
  {"uri":"http://irland.heck.in/files/cokelat-dilema.mp3","judul":"Coklat - Dilema"},
  {"uri":"http://irland.heck.in/files/drdre-eminem-guilty-con.mp3","judul":"Dr. Dree ft. Eminem - Guilty Conscience"},
  {"uri":"http://irland.heck.in/files/steve-vai-for-the-love.mp3","judul":"Steve Vai - For the Love of God"},
  {"uri":"http://irland.heck.in/files/padi-tempat-terakhir.mp3","judul":"Padi Tempat Terakhir"},
  {"uri":"http://irland.heck.in/files/death-cab-for-cutie-gra.mp3","judul":"Death Cab for Cutie - Grapevine Fires"},
  {"uri":"http://irland.heck.in/files/warteg-boys-ok-lah-kalo.mp3","judul":"Warteg Boys - Okelah kalo Begitu"},
  {"uri":"http://irland.heck.in/files/megan-mccauley-wonder.mp3","judul":"MEGAN MCCAULEY - WONDER"},
  {"uri":"http://irland.heck.in/files/jamrud-putri.mp3","judul":"Jamrud - Putri"},
  {"uri":"http://irland.heck.in/files/garasi-awakening.mp3","judul":"Garasi - Awakening"},
  {"uri":"http://irland.heck.in/files/jamrud-surti-tejo.mp3","judul":"Jamrud - Surti Tejo"},
  {"uri":"http://irland.heck.in/files/redcore-mario-bros-the.mp3","judul":"Redcore - Mario Bros Theme"},
  {"uri":"http://www.visionsnet.com/downloads/nicktoon/JimmyNeutronMovie.mp3","judul":"Bowling for Soup - Jimmy Neutron"},
  {"uri":"http://apa-loe.webs.com/Guns N Roses - Sweet Child Of Mine.mp3","judul":"Guns N Roses - Sweet Child Of Mine"},
  {"uri":"http://apa-loe.webs.com/Guns N Roses - Yesterdays.mp3","judul":"Guns N Roses - Yesterdays.mp3"},
  {"uri":"http://apa-loe.webs.com/Where is the Love.mp3","judul":"siapa ya - Where is the Love"},
  {"uri":"http://apa-loe.webs.com/Anggun C.S - Tua-tua Keladi.mp3","judul":"Anggun C.S - Tua-tua Keladi"},
  {"uri":"http://bengkoyok.mywapblog.com/files/scorpion-when-the-smoke-i.mp3","judul":"scorpion - when the smoke"},
  {"uri":"http://bengkoyok.mywapblog.com/files/jogja-hip-hop-foundation.mp3","judul":"jogja hip hop foundation - gugur kenangan"},
  {"uri":"http://mp3.hhe.cc/Eminem%20-%20Love%20the%20way%20you%20lie%20(ft.%20Rhianna).mp3","judul":"eminem feta rihanna - love the way you lie"},
  {"uri":"http://kebo-giro.webs.com/Hotel California - Eagles (classic).MP3","judul":"hotel california - eagles"},
  {"uri":"http://irland.heck.in/files/jason-mraz-im-yours.mp3","judul":"Jason Mraz - I\'m Yours"},
  {"uri":"http://irland.heck.in/files/garasi-awakening.mp3","judul":"Garasi - Awakening"},
  {"uri":"http://irland.heck.in/files/cokelat-dilema.mp3","judul":"Coklat - Dilema"},
  {"uri":"http://irland.heck.in/files/drdre-eminem-guilty-con.mp3","judul":"Dr. Dree ft. Eminem - Guilty Conscience"},
  {"uri":"http://istana-langit.webs.com/starza1.com eminem - im sorry mama.mp3","judul":"eminem - im sorry mama"},
  {"uri":"http://istana-langit.webs.com/Guns And Roses - Knocking On Heavens Door.mp3","judul":"Guns And Roses - Knocking On Heavens Door"},
  {"uri":"http://istana-langit.webs.com/Iwan FAls - Surat Buat Wakil Rakyat.mp3","judul":"Iwan FAls - Surat Buat Wakil Rakyat"},
  {"uri":"http://gue-keren.webs.com/jogja_istimewa.mp3","judul":"jogja hip hop foundation - jogja istimewa"},
  {"uri":"http://gue-keren.webs.com/Power Metal - Timur Tragedi.mp3","judul":"power metal - timur tragedi"},
  {"uri":"http://gue-keren.webs.com/Power Metal - Duniaku.mp3","judul":"power metal - duniaku"},
  {"uri":"http://gue-keren.webs.com/Power Metal - Satu Jiwa.mp3","judul":"Power Metal - Satu Jiwa"},
  {"uri":"http://gue-keren.webs.com/Power Metal - Topeng Topeng Murka.mp3","judul":"Power Metal - Topeng Topeng Murka"},
  {"uri":"http://gue-keren.webs.com/4 Non Blondies - What's up.mp3","judul":"4 Non Blondies - What's up"},
  {"uri":"http://gue-keren.webs.com/Avenged Sevenfold - Dear God.mp3","judul":"Avenged Sevenfold - Dear God"},
  {"uri":"http://gue-keren.webs.com/Maroon5 - This Love.mp3","judul":"Maroon5 - This Love"},
  {"uri":"http://east-java.webs.com/Agnes Monica - Paralyzed.mp3","judul":"Agnes Monica - Paralyzed"},
  {"uri":"http://east-java.webs.com/21 Sublime - Santeria.mp3","judul":"Sublime - Santeria"},
  {"uri":"http://east-java.webs.com/02 Don't Stay.mp3","judul":"linkin park - Don't Stay"},
  {"uri":"http://east-java.webs.com/03 Somewhere I Belong.mp3","judul":"linkin park - Somewhere I Belong"}
];
function stelMusik(mp3){
  var eureyLagu = punkMusic;
  var eureyLaguText = 'punkMusic';

  if(document.getElementById('lagu-next')){
    document.getElementById('embed-lagu-luar').innerHTML = tulisPlayerLagu(mp3.uri,'yes','yes','embed-lagu');
    document.getElementById('judul-lagu').href = mp3.uri;
    document.getElementById('judul-lagu').innerHTML = mp3.judul;
  }else{
  if(document.getElementById('tudey-misik')){
    if(mp3==null || mp3==''){mp3 = eureyLagu;}
    if(mp3.uri && mp3.judul){var pley = mp3}else if(mp3[0].uri && mp3[0].judul){mp3 = mp3.sort(function() {return 0.5 - Math.random()}); var pley = mp3[0]}else{var pley = 'dodol'}
    if(pley=='dodol'){
      document.getElementById('tudey-misik').innerHTML = '';
    }else{
      var tulis  = '<div style="display:inline-block;">

';
          tulis += tulisJudulLagu('<i style="display:inline-block; height:16px; width:16px; background:transparent url(http://static.ak.fbcdn.net/rsrc.php/v1/yI/r/3HHq435uvHq.png) no-repeat scroll -172px -134px; vertical-align:middle;"></i> <a id="judul-lagu" href="'+pley.uri+'" target="_blank">'+pley.judul+'</a>');
          tulis += '<div id="embed-lagu-luar" style="min-height:20px; margin-bottom:5px;">

';
          tulis += tulisPlayerLagu(pley.uri,'yes','yes','embed-lagu');
          tulis += '</div>
';
          tulis += '<span class="pencetan-lagu" onClick="if(document.getElementById(\'embed-lagu\').style.display==\'none\'){document.getElementById(\'embed-lagu\').style.display=\'inline-block\';this.innerHTML=\'Stop\'}else{document.getElementById(\'embed-lagu\').style.display=\'none\';this.innerHTML=\'Play\'}">Stop</span>';
          tulis += '<span class="pencetan-lagu" onClick="shareLagu()">Share</span>';
          tulis += '<span class="pencetan-lagu" onClick="nextLagu(this,'+eureyLaguText+')">Next</span>';
          tulis += '<div id="lagu-next" style="margin-top:5px;">

</div>
';
          tulis += '</div>
';
      document.getElementById('tudey-misik').innerHTML = tulis;
    }
  }else{
    alert('Elo mesti bikin element pake id="tudey-misik"');
  }
  }
}
function nextLagu(elem,mp3){
  elem.style.display = 'none';
  if(mp3.uri && mp3.judul){
    stelMusik(mp3);
  }else{
    var tulis  = '';
    for(x in mp3){
        tulis += ''+mp3[x].judul+'</span>';
    }
    document.getElementById('lagu-next').innerHTML = tulis;
  }
}
function shareLagu(){
  var idAplikasiLagu = '309298289112940';
  var judul = document.getElementById('judul-lagu').innerHTML;
  var uri = document.getElementById('judul-lagu').href;
  var tgtid = prompt("Share to Facebook Id or leave it blank","");
  var ling = window.location.href.split('?')[0];

  if(tgtid==null || tgtid==""){
    var kepada = '';
  }else{
    var kepada = tgtid;
  }

  var atName = '"name":"'+judul+'"';
  var atHref = '"href":"'+uri+'"';
  var atCap = '"caption":"'+window.location.hostname+'"';
  var atDes = '"description":"'+document.title+'"';

  var atMed1Typ = '"type": "mp3"';
  var atMed1Src = '"src": "'+uri+'"';
  var atMed1Art = '"artist": "'+window.location.hostname.split('.')[0]+'"';
  var atMed1Tit = '"title": "'+judul+'"';
  var atMed1Alb = '"album": "'+document.title+'"';
  var atMed1 = '{'+atMed1Typ+', '+atMed1Src+', '+atMed1Art+', '+atMed1Tit+', '+atMed1Alb+'}';
  var atMed = '"media":['+atMed1+']';

  var lampiran = '&attachment={'+atName+', '+atHref+', '+atCap+', '+atDes+', '+atMed+'}';

  var actLnk1Txt = '"text":"'+window.location.hostname.split('.')[0]+'"';
  var actLnk1Hrf = '"href":"'+ling+'"';
  var actLnk1 = '{'+actLnk1Txt+', '+actLnk1Hrf+'}';
  var actLnk = '&action_links=['+actLnk1+']';

  var kirimKe = '&target_id='+kepada;

  var shareUrl = 'http://www.facebook.com/connect/prompt_feed.php?api_key='+idAplikasiLagu;
      shareUrl += lampiran;
      shareUrl += actLnk;
      shareUrl += kirimKe;

  var atas = screen.availHeight/2-300/2;
  var kiri = screen.availWidth/2-600/2;
  var properties = 'width=600,height=300,top='+atas+',left='+kiri;

  window.open(shareUrl,'popup',properties);
}

stelMusik();
//-->
</script>


Setelah selesai save terus coba buka masuk ke link Your address misal http://songgolangit.xp3.biz yang udah lo catet di atas tadi.

07 August, 2011

bikin aplikasi pesbuk sendiri [aing-creations.blogspot.com]

· 1 komentar

Bahan-bahan yang di perlukan:

- 10kg Web Hosting
- Satu sendok makan kemauan
- dan Kopi secukupnya (dilarang ngeroko buat yang belum cukup umur)

Cara Memasak

Pertama kita buat dulu adonan Web Hosting dengan cara.. untuk sementara bisa di baca dulu di Forum Diskusi Group tempat anak² NamaPanjang di Facebook, tar kalo ada waktu insya Allah gw apdet lagi dah disini :P




Langkah yang kesembilan yaitu ikut pendaftaran aplikasi di pesbuk. Caranya masuk ke www.facebook.com/developers/createapp.php. Tar di sono elo paling di kasih formulir isian yang kira-kira tampilannya kaya dibawah noh..


Essential Information
Application Name Cannot contain Facebook trademarks or have a name that can be confused with an application built by Facebook.
Terms Do you agree to the Facebook Terms?



Isi dah tuh suka-suka. Terus masuk ke halaman berikutnya..


Hehe, tempat.hosting.nih itu maksud gw bukan hoting,, salah ketik sorry..
Udah, jadi dah tuh kan adonan applikasi lo.., yang penting buat di catet..

- Application ID
- API Key
- Application Secret
- Canvas Page http://apps.facebook.com/aplikasi-elo/
- Canvas URL http://tempat.hosting.elo/folder-aplikasi-elo/
- Canvas FBML/iframe pake FBML

Ada yang Salah Paham soal Canvas URL

kalo misalkan di contoin kaya gini..
[misal alamat hostingan gw, http://aingcreations.xp3.biz]
[terus gw bikin Folder buat Application gw di situ namanya, aplikasi-pesbuk-gw]

jadi yang gw isiin di Canvas URL adalah..
http://aingcreations.xp3.biz/aplikasi-pesbuk-gw/

okay..?

Saatnya kita mulai beraksi..


- Login ke FTP server tempat Hostingan elo
- Upload file Facebook Platform yang ini nih http://pearhub.org/get/facebook-0.1.0.tgz
Uploadnya ke Root Directory aja, terus pake mode Upload Archives (zip, tar, tgz, gz) bukan mode Upload file biasa OK?!
- Bikin Folder baru namanya sama seperti yang tadi lo isi di Canvas URL ../folder-aplikasi-elo/

- Bikin File baru di dalem Folder tadi namanya appdata.php
- Edit File appdata.php tadi isiin data-data aplikasi elo di situ..

<?php
//File name appdata.php

require_once '../facebook-0.1.0/facebook.php';

$appapikey = 'isi pake API Key aplikasi elo';
$appsecret = 'isi pake Application Secret aplikasi elo';
$facebook = new Facebook($appapikey, $appsecret);

$uid = $facebook->require_login('read_stream,publish_stream,user_groups');

$grpid = '180749582873'; //Group NamaPanjang
$appid = 'isi pake Application ID aplikasi elo';
$href = 'isi pake Canvas Page aplikasi elo';

$app_admin = $facebook->api_client->pages_isAdmin($appid);
$app_page = $facebook->api_client->pages_isFan($appid);
?>
- Bikin lagi File baru namanya index.php
- Edit File index.php tadi isiin kode-kode aplikasi elo di situ dah..

<?php
//File name index.php

require_once 'appdata.php';
?>


<!--// nah, disini tempat lo ngisiin scrip², code² ajaib lo.. //-->

<!--// misal nih.. //-->
<div style="float:left; margin-right:8px;">
<fb:profile-pic uid="loggedinuser" size="normal"/>
</div>

<b style="font-size:16px;">
<fb:application-name/> <br/>
<fb:name uid="loggedinuser" useyou="false"/>
</b> <br/> <br/>

ID elo = <?php echo $uid; ?> <br/>
ID Group NamaPanjang = <?php echo $grpid; ?> <br/>
ID Application ini = <?php echo $appid; ?> <br/>
Canvas Page Application ini = <?php echo $href; ?> <br/>

<?php
if($app_admin==true){
echo "Hay Admin.. ";
}else{
echo "Tidak Hay karna elo bukan Admin.. haha.. ";
}

if($app_page==true){
echo "Tengkiw udah nge-Like Application ini..";
}else{
echo "Like Application Profile Page ini dong cuy..";
}
?>
Orange = PHP Code
Biru = FBML Code
Hijau = Comment

- Tinggal di cicipi deh Applikasinya.. go to http://apps.facebook.com/aingcreations/test.php

Referensi


Facebook Old REST API Data Retrieval Methods
Group NamaPanjang Disscussion Topic -> Application Developers (not Only :P)
[̲̅̅N̲̲̅̅̅a̲̅m̲̅̅a̲̅] [̲̅̅Panj̲̅̅a̲̲̅̅̅n̲̲̅̅̅g̲̅] Disscussion Topic -> boleh minta souce code
Situs resmi PHP -> www.php.net/
Blog Grup Pengguna PHP Indonesia -> http://phpug.or.id/category/tutorial/
Tutorial PHP Dasar -> http://prothelon.com/mambo/tutorial-45.html
Kumpulan Contoh Program PHP -> http://contohprogram.info/category/php
My PHP Tutorials -> www.myphptutorials.com/

03 August, 2011

Add Facebook Connect to Your Blog [Aing-creations.blogspot.com] wkwkwk XD

· 0 komentar
Berdasarkan Breaking Change: JavaScript SDK to oauth:true on December 13th,
FB.init({appId:YOUR_APP_ID, status:true, cookie:true, xfbml:true, oauth:true});

Perubahan berpengaruh ke CALLBACK dari API:
session.uid menjadi authResponse.userID
session.access_token menjadi authResponse.accessToken
session menjadi authResponse

FB.login(tulisDitelLoginAing,{perms: ...
menjadi..
FB.login(tulisDitelLoginAing,{scope: ...

Ini script standard yang biasa gw pake diBlog.

Yang paling penting dari Connect Facebook ke blog yaitu
Setting Site Domain Applikasi facebook ke blogspot.com

Yang perlu lo rubah dari Script dibawah, cuman..
var idAplikasi = '131581493563698';
Sisanya terserah ..

CSS

<style type="text/css"><!--
.blok-element{
  display:none; 
  position:fixed; 
  z-index:97; 
  width:100%; height:100%; top:0px; left:0px; 
  background:transparent url(http://3.bp.blogspot.com/_bBL9ze_JZsw/TULZLR21ZxI/AAAAAAAAANM/AR5zmvKZrPc/s1600/white25.png) repeat scroll top left; 
  cursor:pointer;
}
.blok-element-dalem{
  background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg50grF-A3ujCK_j1_ZqmdSUM6NxZqs34uTXLsow3i5JAvaRhhqTF6vnr7sVv9pDOm_EpYdxgC9UfbO-oLb-AJ78hACgMeVAgG27aqJvjGQOgtOad3nBwQLIh8V-iqhIXyr-GH5gC95i2Y/s1600/punk-boy.png) no-repeat scroll bottom right; 
  position:relative; 
  z-index:99; 
  width:100%; height:100%; 
}
--></style>

Block Element

<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg50grF-A3ujCK_j1_ZqmdSUM6NxZqs34uTXLsow3i5JAvaRhhqTF6vnr7sVv9pDOm_EpYdxgC9UfbO-oLb-AJ78hACgMeVAgG27aqJvjGQOgtOad3nBwQLIh8V-iqhIXyr-GH5gC95i2Y/s1600/punk-boy.png" style="display:none;"/>

<script type="text/javascript">
<!--
//jaga-jaga kalo elements gak ada..
  if(!document.getElementById('facebook-propic')){
    document.write('<img id="facebook-propic" src="" style="display:none;"/>');
  }
  if(!document.getElementById('block-login-aing')){
    document.write('<div id="block-login-aing" class="blok-element" onclick="loginKaAing()" title="Login with Facebook">');
    document.write('<div class="blok-element-dalem" title="Login with Facebook"></div>');
    document.write('</div>');
  }

//Global Variable..
  var idAplikasi = '131581493563698';
  var idUserYgLogin = '';

  var blokLoginElment = document.getElementById('block-login-aing');
  var tempatGambarPropil = document.getElementById('facebook-propic');
//-->

</script>

Functions

<script type="text/javascript">
<!--
function loadAplikasiAing(appid){
  window.fbAsyncInit = function() {
    FB.init({appId: appid, status: true, cookie: true, xfbml: true, oauth: true});
    var getLoginGagal = setTimeout("titahLoginHeula()",30000);

    FB.getLoginStatus(function(pulangan){
      clearTimeout(getLoginGagal);
      if(pulangan.authResponse && pulangan.authResponse.userID){
        idUserYgLogin = pulangan.authResponse.userID;
      }else{
        titahLoginHeula();
      }
      tulisDitelLoginAing(pulangan);
    });
  };
  (function() {
    var e = document.createElement('script'); e.async = 'true';
        e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
}

function titahLoginHeula(){
  blokLoginElment.style.display='block';
}

function loginKaAing(){
  FB.login(tulisDitelLoginAing,{scope:'status_update,user_status,friends_status,read_stream,publish_stream,share_item,publish_actions'});
}

function tulisDitelLoginAing(tahMere){
  if(tahMere.authResponse){
    if(tahMere.authResponse.userID){
      idUserYgLogin = tahMere.authResponse.userID;
      tempatGambarPropil.src='http://graph.facebook.com/'+tahMere.authResponse.userID+'/picture?type=large';
    }
  }
  if(tahMere.status){
    if(tahMere.status=='connected'){
      blokLoginElment.style.display='none';

//execute scripts setelah sesi connect facebook selesai..
      nextSript();
    }
  }
}

function nextSript(){
//execute scripts setelah sesi connect facebook selesai..
  if(typeof postScript != 'undefined'){postScript()}
}

loadAplikasiAing(idAplikasi);
//-->
</script>

Wanna Cry?!,, eh,, Wanna Try?!

Insert your application ID:
loadAplikasiAing('270416582055')



Soal //execute scripts setelah sesi connect facebook selesai..

Semua script yang ada di blog ini yang berhubungan sama Facebook, semuanya cuman bisa jalan kalo Connect facebook udah selesai diLoad.

jadi seperti yang bisa lo liat diatas, ada function nextSript() yang didalemnya nge-trigg (istilah gw, jangan diikutin :P) atau manggil function postScript() Kalo emang ada function postScript-nya

misal gw punya script kaya gini..

<center>
<embed id="peuler" wmode="transparent" src="" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" height="20"></embed>
</center>


<script type="text/javascript">
<!--
function postScript(){
  document.getElementById('peuler').src = 'http://beemp3.com/player/player.swf?soundFile=http://irland.heck.in/files/cokelat-dilema.mp3&autostart=yes&loop=yes';
}
//-->

</script>

Maka setelah Script connect facebook selesai nge-Load,, baru music bakalan diPlay (function postScript() diPanggil).

01 August, 2011

masang script dipostingan blog

· 0 komentar

Cuman sedikit saran, mungkin akan lebih baik kalo kita login ke draft.blogger.com daripada ke www.blogger.com, kenapa? (karena pengalaman gw yg berantakan),, gw juga gak tau XD wkwkwkkk... xP

Settingan default blogger untuk Postingan emang untuk text format, bukan untuk script/HTML tag, jadi kita mesti ngerubah settingan ini biar bisa pasang script/widget di postingan.

handapeunpost