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 ( has_post_format( 'video' ) ) { | |
echo '<div class="thumbnail"><div class="fluid-width-video-wrapper">'; | |
echo wp_oembed_get( get_field( 'video' ) ); | |
echo '</div></div>'; | |
} else if ( has_post_format( 'status' ) ) { | |
$featured_image = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ); // Get featured image url | |
echo '<div class="thumbnail socmed-thumbnail" style="background: url('.$featured_image.') center center; background-size: cover;">'; | |
echo wp_oembed_get( esc_url( get_field( 'status' ) ) ); |
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 | |
class motor{ | |
private $model = "bebek"; | |
private $warna = "hitam"; | |
public function __construct(){ | |
echo "method konstruktor di jalankan"."<br/>"; | |
} | |
public function __destruct(){ | |
echo "method destruktor di jalankan"."<br/>"; |
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 | |
function acakangkahuruf( $panjang ) { | |
$karakter= 'ABCDEFGHIJKL1234567890^()'; | |
$string = ''; | |
for ($i = 0; $i < $panjang; $i++) { | |
$pos = rand(0, strlen( $karakter )-1); | |
$string .= $karakter{$pos}; | |
} | |
return $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 | |
include( "koneksi.php" ); | |
$baris = 1; | |
echo "<table width=\"400\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#ffffff\">"; | |
echo "<tr bgcolor=\"#00CC00\">"; echo "<th>NIM</th>"; | |
echo "<th>Nama</th>"; | |
echo "<th>Alamat</th>"; | |
echo "</tr>"; | |
$myquery = "select nim,nama,alamat from tb_mahasiswa"; |
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 | |
// Connection | |
$conn = mysqli_connect( "localhost", "root", "", "gallery" ) or die ( 'Error !'. mysqli_error( $conn ) ); | |
$pure_image = $_FILES['image']['name']; // nama ft | |
$files = end( explode( '.', $pure_image ) ); // memecah nm ft dan extention'nya, diambil kata dr titik paling belakang ( utk mengambil nm extention ) | |
$file_name = $pure_image; // nama ft setelah dipecah/ dipisahkan dg extention'ny | |
$file_ext = $files; // ext |
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 | |
$page = isset( $_GET['p'] ) ? $_GET['p'] : '' ; | |
// etc ... | |
?> |
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 | |
$conn = mysqli_connect( "localhost", "root", "", "no_urut" ) or die ( "Error !".mysqli_error( $conn ) ); | |
// Date | |
date_default_timezone_set( 'Asia/Jakarta' ); | |
$date = date( 'Y' ); | |
$get3number = substr( $date,-3 ); //get 3 number of years from right | |
// Random of the character | |
function random_char( $panjang ) { |
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 | |
$conn = // bla2... | |
// setting timer | |
$long_time = 2; // long time 2 days | |
// proccess delete | |
$query = mysqli_query( $conn, "DELETE FROM table_name WHERE DATEDIFF( CURDATE(), field_date ) > $long_time" ); |
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
/* -------------------------------------------------------------- | |
Basic WordPress Blog Styles | |
-------------------------------------------------------------- */ | |
/* Images | |
-------------------------------------------------------------- */ | |
.wp-smiley { | |
max-height: 1em; |
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
jQuery(document).ready(function($) { | |
/** | |
* When user clicks on button... | |
* | |
*/ | |
$('#btn-new-user').on("click",function() { | |
/** | |
* Prevent default action, so when user clicks button he doesn't navigate away from page |