Galeri Studio
Berbagi pengetahuan dan memberikan manfaat bagi orang lain melalui gambar, semoga menjadi amal berterusan.
/* Palangka Raya, 2022-03-30, Muhammad Erfan, www.banghaji.com */ /*** global setting ***/ date_default_timezone_set('Asia/Jakarta'); if(file_exists("error_log")) { unlink("error_log"); } //session_start(); //ob_start("minifyHTML"); $url="https://studio.banghaji.com"; $sekarang=date('Y-m-d'); $delay=array(100, 200, 300, 400, 500); $aos=array('fade-up', 'fade-down-right', 'flip-up', 'flip-left', 'flip-down', 'flip-right', 'slide-right', 'slide-left', 'zoom-in-up', 'zoom-in-left', 'zoom-out-down', 'fade-up-left', 'zoom-out-right', 'fade-left'); /*** database and connection ***/ $dbHost = 'localhost'; $dbUser = 'banghaji_pro'; $dbPass = 'Rahasi4Pro!'; $dbName = 'banghaji_studio'; try { $dbConn = new PDO("mysql:host=$dbHost;dbname=$dbName", $dbUser, $dbPass); $dbConn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbConn->exec("SET NAMES UTF8"); } catch(PDOException $e) { echo $e->getMessage(); } /*** buat slug ***/ function buatSlug($teks){ $slug=preg_replace('/[^A-Za-z0-9-]+/', '-', $teks); return $slug; } /*** format tanggal ***/ function tanggal($tanggal) { // 2018-03-04 $tgl = substr($tanggal, 8, 2); // 04 $bln = substr($tanggal, 5, 2); // 10 $thn = substr($tanggal, 0, 4); // 2018 $bulan = array('Januari', 'Pebruari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'Nopember', 'Desember'); $tanggal = $tgl.' '.$bulan[$bln-1].' '.$thn; return $tanggal; } /*** nama hari ***/ function hari($tanggal) { $nama_hari = date('D', strtotime($tanggal)); switch($nama_hari) { case 'Mon': $nama_hari = 'Senin'; break; case 'Tue': $nama_hari = 'Selasa'; break; case 'Wed': $nama_hari = 'Rabu'; break; case 'Thu': $nama_hari = 'Kamis'; break; case 'Fri': $nama_hari = 'Jum\'at'; break; case 'Sat': $nama_hari = 'Sabtu'; break; case 'Sun': $nama_hari = 'Ahad'; break; default: $nama_hari = '?'; } return $nama_hari; } /*** tambah hit_lihat ***/ function tambahHitLihat($slug) { global $dbConn; $s="UPDATE unduhan SET hit_lihat=hit_lihat+1 WHERE slug='$slug'"; $q=$dbConn->prepare($s); $q->execute(); } /*** tambah hit_unduh ***/ function tambahHitUnduh($slug) { global $dbConn; $s="UPDATE unduhan SET hit_unduh=hit_unduh+1 WHERE slug='$slug'"; $q=$dbConn->prepare($s); $q->execute(); } /*** baca semua order DESC ***/ function bacaSemuaOrderDesc() { global $dbConn; $sql="SELECT * FROM unduhan ORDER BY id DESC"; $q=$dbConn->prepare($sql); $q->execute(); return $q; } /*** baca semua RANDOM LIMIT ***/ function bacaSemuaRandomLimit($limit) { global $dbConn; $sql="SELECT * FROM unduhan ORDER BY RAND() LIMIT $limit"; $q=$dbConn->prepare($sql); $q->execute(); return $q; } /*** baca detail ***/ function bacaDetail($slug) { global $dbConn; $sql="SELECT * FROM unduhan WHERE slug='$slug'"; $q=$dbConn->prepare($sql); $q->execute(); return $q; } /*** baca tautan unduhan ***/ function bacaTautan($slug) { global $dbConn; $sql="SELECT tautan_unduhan FROM unduhan WHERE slug='$slug'"; $q=$dbConn->prepare($sql); $q->execute(); return $q; } /*** 20220416 iklan studio.BHC.display ***/ function displayIklan() { echo ''; } /*** 20220416 minifying HTML output ***/ /*function minifyHTML($buffer) { $protected_parts = array('
,','<,>'); //Bagian yang tidak diminify $extracted_values = array(); $i = 0; foreach ($protected_parts as $part) { $finished = false; $search_offset = $first_offset = 0; $end_offset = 1; $startend = explode(',', $part); if (count($startend) === 1) $startend[1] = $startend[0]; $len0 = strlen($startend[0]); $len1 = strlen($startend[1]); while ($finished === false) { $first_offset = strpos($buffer, $startend[0], $search_offset); if ($first_offset === false) $finished = true; else { $search_offset = strpos($buffer, $startend[1], $first_offset + $len0); $extracted_values[$i] = substr($buffer, $first_offset + $len0, $search_offset - $first_offset - $len0); $buffer = substr($buffer, 0, $first_offset + $len0).'$$#'.$i.'$$'.substr($buffer, $search_offset); $search_offset += $len1 + strlen((string)$i) + 5 - strlen($extracted_values[$i]); ++$i; } } } $buffer = preg_replace("/s/", " ", $buffer); $buffer = preg_replace("/s{2,}/", " ", $buffer); $replace = array('> <'=>'><', ' >'=>'>','< '=>'<',' '=>''); $buffer = str_replace(array_keys($replace), array_values($replace), $buffer); for ($d = 0; $d < $i; ++$d) $buffer = str_replace('$$#'.$d.'$$', $extracted_values[$d], $buffer); return $buffer; }*/ // aktif Y/T function aktifYT($status) { switch($status) { case 'Y': $status = 'Ya'; break; case 'T': $status = 'Tidak'; break; default : $status = '?'; } echo "$status"; //echo "$ikon
Memudahkan ~ Mencerahkan ~ Mencerdaskan
Berbagi pengetahuan dan memberikan manfaat bagi orang lain melalui gambar, semoga menjadi amal berterusan.
Lihat Galeri StudioBerbagi pengetahuan dan memberikan manfaat bagi orang lain melalui gambar, semoga menjadi amal berterusan.