Advertisement
EkoAisyah

php berita

Nov 26th, 2012
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.69 KB | None | 0 0
  1. <?php
  2. //susu
  3. $timezone = "Asia/Jakarta";
  4. if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);
  5.  
  6. $saiki = date("m/d");
  7. $togel = date("m-d-y");
  8. $access_token = "AKSES TOKEN";
  9. $url = "https://graph.facebook.com/me/feed?method=POST";
  10.  
  11. if(!empty($_GET['link']) && !empty($_GET['img'])){
  12. $link = $_GET['link'];
  13. $img = $_GET['img'];
  14. $cek = fopen("berita.txt",'r');
  15. $str = fgets($cek);
  16. fclose($cek);
  17. }
  18. //hijriah
  19. function hijriah(){
  20. $theDate = getdate();
  21. $wday = $theDate[wday];
  22. $hr = $theDate[mday];
  23. $theMonth = $theDate[mon];
  24. $theYear = $theDate[year];
  25.  
  26. if (($theYear > 1582) || (($theYear == 1582) && ($theMonth > 10)) || (($theYear == 1582) && ($theMonth == 10) && ($hr > 14))) {
  27. $zjd = (int)((1461 * ($theYear + 4800 + (int)(($theMonth - 14) / 12))) / 4) + (int)((367 * ($theMonth - 2 - 12 * ((int)(($theMonth - 14) / 12)))) / 12) - (int)((3 * (int)((($theYear + 4900 + (int)(($theMonth - 14) / 12)) / 100))) / 4) + $hr - 32075;
  28. } else {
  29. $zjd = 367 * $theYear - (int)((7 * ($theYear + 5001 + (int)(($theMonth - 9) / 7))) / 4) + (int)((275 * $theMonth) / 9) + $hr + 1729777;
  30. }
  31.  
  32. $zl = $zjd - 1948440 + 10632;
  33. $zn = (int)(($zl-1)/10631);
  34. $zl = $zl - 10631 * $zn + 354;
  35. $zj = ((int)((10985 - $zl)/5316))*((int)((50 * $zl)/17719))+((int)($zl/5670))*((int)((43 * $zl)/15238));
  36. $zl = $zl-((int)((30 - $zj)/15))*((int)((17719 * $zj)/50))-((int)($zj/16))*((int)((15238 * $zj)/43))+29;
  37. $theMonth = (int)((24 * $zl)/709);
  38. $hijriDay = $zl-(int)((709 * $theMonth)/24);
  39. $hijriYear = 30 * $zn + $zj - 30;
  40.  
  41. if ($theMonth==1){ $hijriMonthName = "Muharram";}
  42. if ($theMonth==2){ $hijriMonthName = "Safar";}
  43. if ($theMonth==3){ $hijriMonthName = "Rabiul Awal";}
  44. if ($theMonth==4){ $hijriMonthName = "Rabiul Akhir";}
  45. if ($theMonth==5){ $hijriMonthName = "Jamadil Awal";}
  46. if ($theMonth==6){ $hijriMonthName = "Jamadil Akhir";}
  47. if ($theMonth==7){ $hijriMonthName = "Rejab";}
  48. if ($theMonth==8){ $hijriMonthName = "Syaaban";}
  49. if ($theMonth==9){ $hijriMonthName = "Ramadhan";}
  50. if ($theMonth==10){ $hijriMonthName = "Syawal";}
  51. if ($theMonth==11){ $hijriMonthName = "Zulkaedah";}
  52. if ($theMonth==12){ $hijriMonthName = "Zulhijjah";}
  53.  
  54.  
  55. return $hijriDayString .' ' . $hijriDay . ' ' . $hijriMonthName . ' ' . $hijriYear;
  56. }
  57.  
  58. $hijr = hijriah();
  59.  
  60. //format waktu
  61. function Tampilkan_Hari($waktu)
  62. {
  63. if(!$waktu) $waktu = date("d-m-Y");
  64. $jhari = 0;
  65. $array = explode("-", $waktu);
  66. $tgl = $array[0];
  67. $bln = $array[1];
  68. $thn = $array[2];
  69.  
  70. $bulan = "Januari";
  71. switch($bln)
  72. {
  73. case 2: { $bulan = "Pebruari"; $jhari = 31; break; }
  74. case 3: { $bulan = "Maret"; $jhari = 59; break; }
  75. case 4: { $bulan = "April"; $jhari = 90; break; }
  76. case 5: { $bulan = "Mei"; $jhari = 120; break; }
  77. case 6: { $bulan = "Juni"; $jhari = 151; break; }
  78. case 7: { $bulan = "Juli"; $jhari = 181; break; }
  79. case 8: { $bulan = "Agustus"; $jhari = 212; break; }
  80. case 9: { $bulan = "September"; $jhari = 243; break; }
  81. case 10: { $bulan = "Oktober"; $jhari = 273; break; }
  82. case 11: { $bulan = "Nopember"; $jhari = 304; break; }
  83. case 12: { $bulan = "Desember"; $jhari = 334; }
  84. }
  85.  
  86. $jml_kabisat = 1+floor($thn/4);
  87. if($thn>100) $jml_kabisat -= floor($thn/100);
  88. if($thn>399) $jml_kabisat += floor($thn/400);
  89. if(($thn-(floor($thn/4)*4))<1 && $bln<3) $jml_kabisat;
  90.  
  91. $jmlhari = $thn*365+$jhari+$tgl+$jml_kabisat;
  92.  
  93. $urutan_hari = $jmlhari-(floor($jmlhari/7)*7);
  94.  
  95. switch($urutan_hari)
  96. {
  97. case 0: $hari = "Jemuah"; break;
  98. case 1: $hari = "Setu"; break;
  99. case 2: $hari = "Minggu"; break;
  100. case 3: $hari = "Senen"; break;
  101. case 4: $hari = "Selasa"; break;
  102. case 5: $hari = "Rebu"; break;
  103. case 6: $hari = "Kemis";
  104. }
  105.  
  106. $pasaran_jawa = $jmlhari-(floor($jmlhari/5)*5);
  107. switch($pasaran_jawa)
  108. {
  109. case 0: $hari_jawa = "Kliwon"; break;
  110. case 1: $hari_jawa = "Legi"; break;
  111. case 2: $hari_jawa = "Pahing"; break;
  112. case 3: $hari_jawa = "Pon"; break;
  113. case 4: $hari_jawa = "Wage";
  114. }
  115.  
  116. $hasil = $hari." ".$hari_jawa.", ".$tgl." ".$bulan." ".$thn;
  117.  
  118. if($tgl>28)
  119. {
  120. if((($thn%4)>0 && $bln==2) || $tgl>30)
  121. {
  122. if($bln!=1 && $bln!=3 && $bln!=5 && $bln!=7 && $bln!=8 && $bln!=10 && $bln!=12) $hasil = false;
  123. }
  124. }
  125. return $hasil;
  126. }
  127.  
  128. $waktu = addslashes(strip_tags($_GET['w']));
  129.  
  130. $crut = Tampilkan_Hari($waktu);
  131.  
  132. //selamat
  133.  
  134. function selamat(){
  135.  
  136. if(date("H") < 10){
  137.  
  138. return "Sugeng Enjang..Numpang Update Berita (◡‿◡✿) ";
  139.  
  140. }elseif(date("H") > 10 && date("H") < 14){
  141.  
  142. return "Sugeng Siang...Numpang Update Berita ✖‿✖ ";
  143.  
  144. }elseif(date("H") > 14 && date("H") < 17){
  145.  
  146. return "Sugeng Sonten....Numpang Update Berita (◑‿◐ ";
  147.  
  148. }elseif(date("H") > 17 && date("H") < 20){
  149.  
  150. return "Sugeng Surup....Numpang Update Berita(◕‿◕✿) ";
  151.  
  152. }elseif(date("H") > 20 && date("H") < 24){
  153.  
  154. return "Sugeng Dalu...Numpang Update Berita (⊙▂⊙) ";
  155.  
  156. }
  157. }
  158.  
  159.  
  160. $ucapan = selamat();
  161.  
  162. //Menampilkan
  163.  
  164. $jame = date('H');
  165. $menitane = date('i');
  166. $surim = $ucapan . "\n █│║▌║▌│║▌║ ▌│║▌║ █│║█│║▌║▌║ \n" . $crut . " ||" . $hijr . " H || \n Jam Apdet : jam " . $jame . " Pas \n TUKANG KORAN PEZBUK ";
  167. $ch = curl_init();
  168. $attachment = array( 'access_token' => $access_token,
  169. 'link' => $link,
  170. 'picture' => $img,
  171. 'message' => $surim,
  172. 'name' => '',
  173. 'description' => '',
  174. 'from' => '',
  175. 'created_time' => '',
  176. );
  177.  
  178. curl_setopt($ch, CURLOPT_URL,$url);
  179. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  180. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
  181. curl_setopt($ch, CURLOPT_POST, true);
  182. curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
  183. $result= curl_exec($ch);
  184.  
  185. curl_close ($ch);
  186. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement