This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$folderPath = 'gpuniversity'; // Ganti dengan path folder Anda | |
$zipFileName = 'gpuniversity.zip'; // Nama file ZIP yang akan dibuat | |
$zip = new ZipArchive(); | |
// Membuka arsip ZIP untuk menulis | |
if ($zip->open($zipFileName, ZipArchive::CREATE) === TRUE) { | |
// Mendapatkan panjang string dari path root | |
$rootPathLength = strlen(realpath($folderPath)) + 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Taruh di functions.php paling bawah | |
*/ | |
/** | |
* Mengubah Semua URL image di konten menjadi berCDN | |
*/ | |
function cdn_on_the_fly($content) { | |
$pattern = '#(\-(\d+)x(\d+))?\.((?:jpg|gif|png|webp|jpeg))#'; | |
return preg_replace($pattern, '.$4?format=webp&quality=80&w=$2&h=$3', $content); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
document.addEventListener('DOMContentLoaded', init, false); | |
function init(){ | |
adsBlocked(function(blocked){ | |
if(blocked){ | |
var adblocker = document.getElementById('adblocker-detected'); | |
adblocker.classList.add('show'); | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#.... ubah 4 jadi 04. dan seterusnya selama 1 digit, jika dua digit | |
# seperti 10, tidak akan berubah jadi 010 tapi tetap 10 | |
function two_digit($string) | |
{ | |
return sprintf('%02d', $string); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Sample Countdown Timer JS PHP | |
*/ | |
$date_start = '10-10-2018 20:40:00'; | |
$date_end = '11-10-2018 20:40:00'; | |
$dateStart = new Datetime($date_start); | |
$dateEnd = new Datetime($date_end); | |
$interval = $dateStart->diff($dateEnd); | |
// var_dump( $intervale ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Sample Countdown Timer JS PHP | |
*/ | |
$date_start = '10-10-2018 20:40:00'; | |
$date_end = '11-10-2018 20:40:00'; | |
$dateStart = new Datetime($date_start); | |
$dateEnd = new Datetime($date_end); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
require 'config.php'; | |
if ( | |
isset($_POST['username']) && | |
$_POST['username'] == 'admin' && | |
isset($_POST['password']) && | |
$_POST['password'] == '12345' | |
) { | |
$_SESSION['user_login'] = 'admin'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
*/ | |
require_once get_theme_file_path('class-list-member.php'); | |
function addMenuMembers() | |
{ | |
add_menu_page('Memberss', 'Memberss', 'manage_options', 'customer', 'MembersHtml'); | |
} | |
add_action('admin_menu', 'addMenuMembers', 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! class_exists('WP_List_Table') ) { | |
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); | |
} | |
/** | |
* Class memberLists Handle Table Lists | |
*/ | |
class memberLists extends WP_List_Table | |
{ | |
public function __construct() |
NewerOlder