Categories
PHP

String Functions in the PHP

Discussion Board: Introduction to the various functions – the basic string functions (which are often used) in PHP and its possible use.
Kebutuhan : Webserver Package, already installed.

Text is one of the sources of unstructured data is greatest, because most of the information stored in the text, whether text in a variety of filetype (doc txt pdf etc) and web-text (html). Today more often performed research involving the text, and computer science that involves the text of which is the Natural Language Processing, Text (Web) Mining, or Information Retrieval.

Here are some of functions of a text (string) in PHP which will often be used if you are struggling with studies involving text processing.

1. Adding a slash (\) in the string -> addslashes.
[sourcecode language=”php”]
<?php
$text = "This is Anne’s book.";
echo addslashes($text);
?>
[/sourcecode]
Output :
This is Anne\’s book.

Why is this important? In text processing, it is often a sign of the quote (‘) will cause an error when done parsing of the text, especially when we use regular expressions.

2. Breaking the string with the string -> explode.
[sourcecode language=”php”]
<?php
$sentence = "My name is June";
$word = explode(" ", $sentence);
print_r($word);
?>
[/sourcecode]
Output :
Array
(
[0] => My
[1] => name
[2] => is
[3] => June
)

Explode will break up the text and divide it into an array, like the example above, $text in-explode with the string “” (space). This is the basis of tokenizing algorithm, namely breaking the sentence in the word – the word constituent. Tokenizing will often be used in text processing.

3. Combining an array of strings in one string -> implode.
[sourcecode language=”php”]
<?php
$arrayWord = array(‘This’, ‘is’, ‘a’, ‘sentence’);
$joinString = implode(" ", $arrayWord);
echo $joinString;
?>
[/sourcecode]
Output :
This is a sentence

Implode, as seen from the example above (example: arrays in the sample-implode / merged by using the string space), is the opposite of the function No. 2 (explode). Implode function has an alias, which is Join.

4. Provides MD5 value from string -> md5.
[sourcecode language=”php”]
<?php
$string = ‘password’;
$stringMd5 = md5($string);
echo $stringMd5;
?>
[/sourcecode]
Output :
5f4dcc3b5aa765d61d8327deb882cf99

MD5 is a hash function (cryptographic one-way) is quite well known and often used for security (although it’s a lot md5 decryptor). Md5 function like this will often be used when we build an application that requires authentication (eg to log into the system).

5. Removes HTML tags in the string -> strip_tags
[sourcecode language=”php”]
<?php
$text = ‘<b>June Susan</b> <i> June June</i>’;
echo strip_tags($text); echo ‘<br>’;
echo strip_tags($text, ‘<i>’); // Allow tag <i>
?>
[/sourcecode]
Output :
June Susan June June

Before we can process the text from the web (which is usually in the form of hypertext / html), then we must be “clean” tag – html tags that exist in the text. This is where the strip_tags function is useful. We can remove all tags, or allow certain tags to remain in the text (see examples).

6. Calculating the length of string -> strlen.
[sourcecode language=”php”]
<?php
$string = ‘I am a superman’;
echo strlen($string);
?>
[/sourcecode]
Output :
15

Strlen count the number of characters (length) of the string, spaces, and symbols – symbols that exist in the string will also be calculated in function strlen.

Happy coding, then! πŸ˜€

Categories
PHP

Fungsi – Fungsi String dalam PHP

Discussion Board : Pengenalan berbagai fungsi – fungsi String dasar (yang sering digunakan) dalam PHP beserta contoh penggunaannya.
Kebutuhan : Webserver Package, already installed.

Text adalah salah satu sumber unstructured data yang paling besar, karena sebagian besar informasi tersimpan dalam text, baik text dalam berbagai filetype (doc txt pdf dll) maupun web text (html). Dewasa ini semakin sering dilakukan riset yang melibatkan text, dan bidang ilmu komputer yang melibatkan text diantaranya adalah Natural Language Processing, Text (Web) Mining, ataupun Information Retrieval.

Berikut adalah beberapa fungsi text (string) dalam PHP yang akan sering digunakan apabila anda berkutat dengan penelitian yang melibatkan text processing.

1. Menambahkan slash (\) dalam string –> addslashes.
[sourcecode language=”php”]
<?php
$text = "This is Anne’s book.";
echo addslashes($text);
?>
[/sourcecode]
Output :
This is Anne\’s book.

Kenapa hal ini penting? Dalam pemrosesan teks, seringkali tanda quote (‘) akan menimbulkan eror ketika dilakukan parsing terhadap text tersebut, terutama ketika kita menggunakan regular expression.

2. Memecah string dengan string –> explode.
[sourcecode language=”php”]
<?php
$sentence = "My name is June";
$word = explode(" ", $sentence);
print_r($word);
?>
[/sourcecode]
Output :
Array
(
[0] => My
[1] => name
[2] => is
[3] => June
)

Explode akan memecah text dan membaginya ke dalam array, seperti contoh diatas, $text di-explode dengan string ” ” (spasi). Hal ini merupakan dasar dari algoritma tokenizing, yaitu memecah kalimat dalam kata – kata penyusunnya. Tokenizing akan sering sekali digunakan dalam text processing.

3. Menggabungkan array string dalam satu string –> implode.
[sourcecode language=”php”]
<?php
$arrayWord = array(‘This’, ‘is’, ‘a’, ‘sentence’);
$joinString = implode(" ", $arrayWord);
echo $joinString;
?>
[/sourcecode]
Output :
This is a sentence

Implode, seperti terlihat dari contoh diatas (contoh : array dalam contoh di-implode / digabung dengan menggunakan string spasi), merupakan kebalikan dari fungsi no 2 (explode). Fungsi implode memiliki alias, yaitu Join.

4. Memberikan nilai MD5 dari string –> md5.
[sourcecode language=”php”]
<?php
$string = ‘password’;
$stringMd5 = md5($string);
echo $stringMd5;
?>
[/sourcecode]
Output :
5f4dcc3b5aa765d61d8327deb882cf99

MD5 merupakan salah satu fungsi hash (kriptografi satu arah) yang cukup terkenal dan sering digunakan untuk security (meskipun sekarang sudah banyak md5 decryptor). Fungsi md5 seperti ini akan sering digunakan apabila kita membangun sebuah aplikasi yang memerlukan autentikasi (misal untuk login ke dalam sistem).

5. Menghilangkan HTML Tag dalam string –> strip_tags
[sourcecode language=”php”]
<?php
$text = ‘<b>June Susan</b> <i> June June</i>’;
echo strip_tags($text); echo ‘<br>’;
echo strip_tags($text, ‘<i>’); // Allow tag <i>
?>
[/sourcecode]
Output :
June Susan June June

Sebelum kita bisa memproses text dari web (yang biasanya berbentuk hypertext / html), maka kita harus “membersihkan” tag – tag html yang ada dalam text tersebut. Disinilah fungsi strip_tags berguna. Kita bisa menghilangkan seluruh tag, ataupun mengijinkan tag tertentu untuk tetap berada dalam text (lihat contoh).

6. Menghitung panjang string –> strlen.
[sourcecode language=”php”]
<?php
$string = ‘I am a superman’;
echo strlen($string);
?>
[/sourcecode]
Output :
15

Strlen menghitung jumlah karakter (panjang) dari string, spasi, dan simbol – simbol yang ada dalam string juga akan dihitung dalam fungsi strlen.

Happy coding, then! πŸ˜€

Categories
PHP

Get the Data from Database with Codeigniter and Show it with JQuery UI Tab

Studi Kasus : Read data from the database, show it in the JQuery UI Tab with AJAX.
Kebutuhan : Webserver package already installed.
File Download: 1. CodeIgniter. 2. JQuery. 3. JQuery UI If you’ve never used this UI, just download a theme that already exist without the customized first. 4. Mic JQuery Template Plugin.
Special Skill : PHP. Codeigniter.

A. Prepare the Database
1. Create a database with the name db_tutorial.
2. Create a table named tb_book, with the structure of the table below,

3. Insert some sample data into tb_book.
4. Again create a table named tb_member, with the structure of the table below,…

5. Insert some sample dta into tb_member.
6. Okay, done with database.

B. Prepare job folders and files – the files needed.
1. Prepare a folder with the name ci_tutor in your document root.
2. CodeIgniter extract in the folder you just created (here user_guide file in my CI delete), and set its cover base_url config, as well as the configuration database in system-config-application-database.php
3. Create a table named cssjs, then put your jQuery file (download file 2) jQuery UI (the downloaded file 3: I choose the template flickr), and files Mic jQuery Plugin Template (file 4) into the folder cssjs.
4. Ci_tutor folder structure is like this,

5. The cssjs folder’s structure is like picture below,

C. Model
1. We will create a model that will take all the data available in tb_book and tb_member. Type the following script,

[sourcecode language=”php”]
<?php
class Book_model extends Model {

public function getBook() {
$query = $this->db->get( ‘tb_book’ );
if( $query->num_rows() > 0 ) {
return $query->result();
} else {
return array();
}
}

public function getMember() {
$query = $this->db->get( ‘tb_member’ );
if( $query->num_rows() > 0 ) {
return $query->result();
} else {
return array();
}
}
}
?>
[/sourcecode]

2. Save with the name book_model.php save into system-application-models.

D. Controller
1. Type the following script,

[sourcecode language=”php”]
<?php
class Book_con extends Controller {
public function __construct() {
parent::__construct();
$this->load->model(‘book_model’);
}
public function index() {
$this->load->view(‘book_view’);
}
public function readBook() {
echo json_encode( $this->book_model->getBook() );
}
public function readMember() {
echo json_encode( $this->book_model->getMember() );
}
}
?>
[/sourcecode]

2. Save with the name book_con.php save into system-application-controllers.

E. View
1. Type the following script,

[sourcecode language=”php”]
<html>
<head>
<title>ITX.WEB.ID</title>
<base href="<?php echo base_url(); ?>" />
<link type="text/css" rel="stylesheet" href="cssjs/flick/jquery-ui-1.8.2.custom.css" />
<link type="text/css" rel="stylesheet" href="cssjs/styles.css" />
</head>
<body>
<center><h2> Book & Member List</h2></center>
<div id="tabs">

<ul>
<li><a href="#read">Book List</a></li>
<li><a href="#read2">Member List</a></li>
</ul>

<div id="read">
<table id="tabel"></table>
</div>

<div id="read2">
<table id="tabel2"></table>
</div>

</div>

<script type="text/javascript" src="cssjs/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="cssjs/jquery-ui-1.8.2.min.js"></script>
<script type="text/javascript" src="cssjs/jquery-templ.js"></script>

<script type="text/template" id="readTemp">
<tr>
<td>${id}</td>
<td>${title}</td>
<td>${author}</td>
</tr>

</script>

<script type="text/template" id="readTemp2">
<tr>
<td>${no}</td>
<td>${name}</td>
<td>${address}</td>
</tr>

</script>

<script type="text/javascript" src="cssjs/all.js"></script>
</body>
</html>
[/sourcecode]

2. Save with the name book_view.php save into system-application-views.

F. Create Javascript file that will read table records from sever with Ajax.
1. Type the following script,

[sourcecode language=”javascript”]
$( function() {
$( ‘#tabs’ ).tabs({
fx: { height: ‘toggle’, opacity: ‘toggle’ }
});

$.ajax({
url: ‘index.php/book_con/readBook’,
dataType: ‘json’,
success: function( response ) {
$( ‘#readTemp’ ).render( response ).appendTo( "#tabel" );
}
});

$.ajax({
url: ‘index.php/book_con/readMember’,
dataType: ‘json’,
success: function( response ) {
$( ‘#readTemp2’ ).render( response ).appendTo( "#tabel2" );
}
});

});
[/sourcecode]

2. Save with the name all.js and save into cssjs folder.

G. Arrange the view
1. Type the following script and save with the name style.css

[sourcecode language=”css”]
body {
font-family: Arial, Helvetica, sans-serif;
}

#tabs {
font-size: .9em;
margin: 0 auto;
width: 800px;
}

.ui-widget-content {
font-size: .8em;
}

#tabel, #tabel2 {
font-size: 1.3em;
width: 100%;
}

#tabel tr:nth-child(2n) {
background: #EAEAEA;
}

#tabel tr:hover {
background: #CCCCCC;
}

#tabel td {
padding: 6px;
margin: 8px;
}
[/sourcecode]

H. Testing code
1. Go to the browser, and run http://localhost/ci_tutor/index.php/book_con/
2. If successful, you will see picture below.

3. Click on the Member List tab, so it will display member data from tb_member.

4. Be creative with another Jquery UI πŸ˜€

Happy coding πŸ˜€

Categories
PHP

Menampilkan Data dari Database dengan CodeIgniter + AJAX dalam Template JQuery UI

Studi Kasus : Membaca data dari database, menampilkan dalam JQuery UI Tab dengan AJAX.
Kebutuhan : Webserver package already installed.
File Download: 1. CodeIgniter. 2. JQuery. 3. JQuery UI Kalau belum pernah menggunakan UI ini, download saja tema yang sudah ada tanpa customize dulu. 4. Mic JQuery Template Plugin.
Skill khusus : PHP. Codeigniter.

A. Mempersiapkan Database
1. Buat database dengan nama db_tutorial.
2. Buat tabel dengan nama tb_book, dengan struktur tabel dibawah ini,

3. Insert-kan beberapa sample data dalam tb_book.
4. Buat tabel lagi dengan nama tb_member, dengan struktur tabel dibawah ini,

5. Insert-kan beberapa sample data dalam tb_member.
6. Okay, done with database.

B. Mempersiapkan folder kerja dan file – file yang dibutuhkan.
1. Persiapkan folder dengan nama ci_tutor dalam document root anda.
2. Ekstrak codeigniter dalam folder yang baru saja dibuat (disini file user_guide dalam CI saya hapus), dan atur config nya meliputi base_url, serta konfigurasi database dalam system-application-config-database.php
3. Buat tabel dengan nama cssjs, kemudian taruh file JQuery (file download 2) JQuery UI (hasil download file 3 : saya memilih template flickr), dan file Mic JQuery Template Plugin (file 4) ke dalam folder cssjs.
4. Struktur folder ci_tutor adalah seperti ini,

5. Struktur folder cssjs adalah seperti ini,

C. Model
1. Kita akan membuat model yang akan mengambil seluruh data yang ada dalam tb_book dan tb_member. Ketikkan script dibawah ini,

[sourcecode language=”php”]
<?php
class Book_model extends Model {

public function getBook() {
$query = $this->db->get( ‘tb_book’ );
if( $query->num_rows() > 0 ) {
return $query->result();
} else {
return array();
}
}

public function getMember() {
$query = $this->db->get( ‘tb_member’ );
if( $query->num_rows() > 0 ) {
return $query->result();
} else {
return array();
}
}
}
?>
[/sourcecode]

2. Simpan dengan nama book_model.php dan simpan dalam system-application-models.

D. Controller
1. Ketikkan script dibawah ini,

[sourcecode language=”php”]
<?php
class Book_con extends Controller {
public function __construct() {
parent::__construct();
$this->load->model(‘book_model’);
}
public function index() {
$this->load->view(‘book_view’);
}
public function readBook() {
echo json_encode( $this->book_model->getBook() );
}
public function readMember() {
echo json_encode( $this->book_model->getMember() );
}
}
?>
[/sourcecode]

2. Simpan dengan nama book_con.php dan simpan dalam system-application-controllers.

E. View
1. Ketikkan script dibawah ini,

[sourcecode language=”php”]
<html>
<head>
<title>ITX.WEB.ID</title>
<base href="<?php echo base_url(); ?>" />
<link type="text/css" rel="stylesheet" href="cssjs/flick/jquery-ui-1.8.2.custom.css" />
<link type="text/css" rel="stylesheet" href="cssjs/styles.css" />
</head>
<body>
<center><h2> Book & Member List</h2></center>
<div id="tabs">

<ul>
<li><a href="#read">Book List</a></li>
<li><a href="#read2">Member List</a></li>
</ul>

<div id="read">
<table id="tabel"></table>
</div>

<div id="read2">
<table id="tabel2"></table>
</div>

</div>

<script type="text/javascript" src="cssjs/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="cssjs/jquery-ui-1.8.2.min.js"></script>
<script type="text/javascript" src="cssjs/jquery-templ.js"></script>

<script type="text/template" id="readTemp">
<tr>
<td>${id}</td>
<td>${title}</td>
<td>${author}</td>
</tr>

</script>

<script type="text/template" id="readTemp2">
<tr>
<td>${no}</td>
<td>${name}</td>
<td>${address}</td>
</tr>

</script>

<script type="text/javascript" src="cssjs/all.js"></script>
</body>
</html>
[/sourcecode]

2. Simpan dengan nama book_view.php dan simpan dalam system-application-views.

F. Membuat file Javascript yang akan membaca record tabel dari server dengan AJAX.
1. Ketikkan script dibawah ini,

[sourcecode language=”javascript”]
$( function() {
$( ‘#tabs’ ).tabs({
fx: { height: ‘toggle’, opacity: ‘toggle’ }
});

$.ajax({
url: ‘index.php/book_con/readBook’,
dataType: ‘json’,
success: function( response ) {
$( ‘#readTemp’ ).render( response ).appendTo( "#tabel" );
}
});

$.ajax({
url: ‘index.php/book_con/readMember’,
dataType: ‘json’,
success: function( response ) {
$( ‘#readTemp2’ ).render( response ).appendTo( "#tabel2" );
}
});

});
[/sourcecode]

2. Simpan dengan nama all.js dan simpan dalam folder cssjs.

G. Mengatur tampilan
1. Ketik script berikut ini dan simpan dengan nama style.css

[sourcecode language=”css”]
body {
font-family: Arial, Helvetica, sans-serif;
}

#tabs {
font-size: .9em;
margin: 0 auto;
width: 800px;
}

.ui-widget-content {
font-size: .8em;
}

#tabel, #tabel2 {
font-size: 1.3em;
width: 100%;
}

#tabel tr:nth-child(2n) {
background: #EAEAEA;
}

#tabel tr:hover {
background: #CCCCCC;
}

#tabel td {
padding: 6px;
margin: 8px;
}
[/sourcecode]

H. Testing code
1. Pergi ke browser, dan jalankan http://localhost/ci_tutor/index.php/book_con/
2. Jika sukses, anda akan melihat tampilan di bawah ini.

3. Klik pada tab Member List, maka akan ditampilkan data member dari dalam tb_member

4. Silahkan berkreasi dengan JQuery UI yang lain πŸ˜€

Happy coding πŸ˜€

Categories
PHP

Round Number in PHP

Discussion Board : One of the important functions in the mathematical calculations, that do rounding numbers with PHP
Requirements : Webserver package, already installed.

One friend who is building an ecommerce never ask something like this: “How can I create a program that, items weighing less than 1 kg to 1 kg is considered 1 kg, then more than 1 kg to 2 kg is considered 2 kg, and so on? “
The problem above can be written as follows:
1> = weight> 0 —> considered to be 1 kg
2> weight => 1 —> 2 kg is considered
etc. ..

Actually, this problem is not a complex problem. Absolutely not complicated in fact. Examples of the above case is just one example of cases that can be resolved easily by Rounding. In PHP, the known three mathematical functions that can be used for rounding, namely ceil, Floor, and Round.

1. Rounding upwards (ceil).
For example for the above case

[sourcecode language=”php”]
<?php
$berat1 = 0.5;
$berat2 = 1.5;
$berat3 = 2;
echo ‘berat 1 =’.ceil($berat1); echo ‘<br />’;
echo ‘berat 2 =’.ceil($berat2); echo ‘<br />’;
echo ‘berat 3 =’.ceil($berat3);
?>
[/sourcecode]

If the script above is executed, then the output is as follows,
berat 1 = 1
berat 2 = 2
berat 3 = 2
So the conclusion is that the PHP function ceil will perform rounding upwards on the given number. This function will produce the nearest integer value of upwards of a number.

2. Rounding down (floor).
Floor used for rounding down. See the example below,

[sourcecode language=”php”]
<?php
$berat1 = 0.5;
$berat2 = 1.5;
$berat3 = 2;
echo ‘berat 1 =’.floor($berat1); echo ‘<br />’;
echo ‘berat 2 =’.floor($berat2); echo ‘<br />’;
echo ‘berat 3 =’.floor($berat3);
?>
[/sourcecode]

If the script above is executed, then the output is as follows,
berat 1 = 0
berat 2 = 1
berat 3 = 2
Contrary to ceil, the floor will do the rounding to the nearest integer value down of a number.

3. Rounding to the nearest
ROUND round a number to the nearest value in accordance with the number behind the comma deciman desired. For example,

[sourcecode language=”php”]
<?php
$berat1 = 0.58989;
$berat2 = 1.6;
$berat3 = 2.4;
echo ‘berat 1 =’.round($berat1, 2); echo ‘<br />’; // with 2 decimal
echo ‘berat 2 =’.round($berat2, 0); echo ‘<br />’; // 0 decimal
echo ‘berat 3 =’.round($berat3); // without parameter, so it will rounded in to the nearest integer
?>
[/sourcecode]

If the script above is executed, then the output is as follows,
berat 1 = 0.59
berat 2 = 2
berat 3 = 2

Hope it hels! πŸ˜€ Happy coding πŸ˜€

Categories
PHP

Pembulatan Bilangan dalam PHP

Discussion Board : Salah satu fungsi penting dalam perhitungan matematika, yaitu melakukan pembulatan angka dengan PHP
Requirements : Webserver package, already installed.

Salah seorang teman yang sedang membangun sebuah ecommerce pernah bertanya seperti ini : “Bagaimana saya bisa membuat program bahwa, barang yang beratnya kurang dari 1 kg sampai 1 kg dianggap 1 kg, kemudian lebih dari 1 kg sampai 2 kg dianggap 2 kg, dan seterusnya?”
Masalah diatas dapat dituliskan seperti berikut :
1 >= berat > 0 —> dianggap 1 kg
2 >= berat > 1 —> dianggap 2 kg
dst..

Sebenarnya, masalah diatas bukanlah masalah yang rumit. Sama sekali tidak rumit malah. Contoh kasus diatas hanyalah salah satu contoh kasus yang bisa diselesaikan dengan mudah dengan Pembulatan. Dalam PHP, dikenal 3 fungsi matematika yang dapat digunakan untuk pembulatan, yaitu Ceil, Floor, dan Round.

1. Pembulatan keatas (Ceil).
Misalnya untuk kasus diatas

[sourcecode language=”php”]
<?php
$berat1 = 0.5;
$berat2 = 1.5;
$berat3 = 2;
echo ‘berat 1 =’.ceil($berat1); echo ‘<br />’;
echo ‘berat 2 =’.ceil($berat2); echo ‘<br />’;
echo ‘berat 3 =’.ceil($berat3);
?>
[/sourcecode]

Kalau script diatas dijalankan, maka outputnya adalah sebagai berikut,
berat 1 = 1
berat 2 = 2
berat 3 = 2
Jadi kesimpulannya adalah, fungsi PHP ceil akan melakukan pembulatan keatas pada angka yang diberikan. Fungsi ini akan menghasilkan nilai integer terdekat keatas dari angka.

2. Pembulatan kebawah (floor).
Floor digunakan untuk melakukan pembulatan ke bawah. Lihat contoh dibawah ini,

[sourcecode language=”php”]
<?php
$berat1 = 0.5;
$berat2 = 1.5;
$berat3 = 2;
echo ‘berat 1 =’.floor($berat1); echo ‘<br />’;
echo ‘berat 2 =’.floor($berat2); echo ‘<br />’;
echo ‘berat 3 =’.floor($berat3);
?>
[/sourcecode]

Script diatas akan menghasilkan output,
berat 1 = 0
berat 2 = 1
berat 3 = 2
Berkebalikan dengan ceil, floor akan melakukan pembulatan ke nilai integer terdekat kebawah dari suatu bilangan.

3. Pembulatan ke terdekat
ROUND membulatkan suatu bilangan ke nilai terdekatnya sesuai dengan jumlah deciman dibelakang koma yang diinginkan. Sebagai contoh,

[sourcecode language=”php”]
<?php
$berat1 = 0.58989;
$berat2 = 1.6;
$berat3 = 2.4;
echo ‘berat 1 =’.round($berat1, 2); echo ‘<br />’; // with 2 decimal
echo ‘berat 2 =’.round($berat2, 0); echo ‘<br />’; // 0 decimal
echo ‘berat 3 =’.round($berat3); // without parameter, so it will rounded in to the nearest integer
?>
[/sourcecode]

Jika dijalankan, maka script akan memberi output :
berat 1 = 0.59
berat 2 = 2
berat 3 = 2

Semoga membantu πŸ˜€ Happy coding πŸ˜€

Categories
WordPress

Put Flickr Album Photos in to WordPress

Discussion Board : Put Ur Flickr Photo Album in to wordpress widget.
Kebutuhan : WordPress.com Account, or CMS WordPress that have been installed in the server.

If U are such a fan of photography, U must be knew of FLICKR. Yeah, Flickr is one of the photo sharing services that quite popular from Yahoo!
U can access flickr through the site www.flickr.com, and if U already have a yahoo account, U can use it for login in to Flickr with that yahoo account. Except Flickr, there are another photo sharing services such as photobucket.

On WordPress, we can put our photo album on the wordpress page using widget. Widgets, in the wordpress, is located on the sidebar of Ur wordpress page, usually in the right or left side, sometimes on the behind above the footer wordpress page. For this case study, we will try to put the flickr photo album in the wordpress page.

Case study : Put Flickr Photo Album in the WordPress widgets.
Assumptions : U already have Flickr account, and there is some photos there in Ur flickr (You have to upload the photo in the flickr for the sample).

The steps :
1. Login in to Ur wordpress account.
2. From the dashboard, go to the Appearance – Widgets menu.
3. You will find list of available widget. Drag flickr widget Flickr in to thesidebar (right side of the widget page), so the setting for flickr is opened like the picture below.

Fill the detail of the flickr feed that u want to showed (like the picture above). For the flickr address (Flickr RSS URL), U can get it from the flickr page, the corner-left-under with the RSS symbol.
4. Save setting for flickr.
5. Go to your wordpress site. Your Flickr album photo is already showed according to your setting (you can customize the number of the photo thumbnailed) πŸ˜€ The picture below is a sample of the Flickr album photo in the wordpress page sidebar.

Beautiful, right? πŸ˜€ Okay, happy WordPress-ing πŸ˜€
And Take a lot on your camera !

Categories
WordPress

Memasang Album Foto Flickr dalam WordPress

Discussion Board : Memasang album foto dalam wordpress widget.
Kebutuhan : WordPress.com Account, atau CMS WordPress yang terlah terinstal dalam server.

Apabila anda penggemar fotografi, anda pasti mengenal FLICKR. Ya, Flickr adalah salah satu layanan photo sharing yang cukup terkenal dari Yahoo!
Anda bisa mengakses Flickr melalui alamat www.flickr.com, dan apabila anda telah memiliki account yahoo, anda bisa langsung login dengan account yahoo tersebut. Selain flickr, ada banyak layanan photo sharing yang lain seperti photobucket.

Dalam WordPress, kita bisa memasang untuk menampilkan album foto kita dalam halaman wordpress dengan menggunakan Widgets. Widgets, dalam WordPress, adalah tampilan untuk sidebar, pada umumnya terletak disamping kanan atau kiri, dan terkadang terletak dibagian bawah diatas footer halaman wordpress. Untuk studi kasus kali ini, kita akan mencoba untuk menampilkan album foto flickr dalam halaman wordpress.

Studi Kasus : Memasang album foto dari Flickr dalam WordPress widgets.
Asumsi : Anda sudah memiliki account Flickr, dan sudah terdapat beberapa foto dalam flickr anda.

Langkah – langkah :
1. Login ke dalam account WordPress anda.
2. Dari halaman dashboard, masuk ke menu Appearance – Widgets.
3. Anda akan menemukan daftar berbagai widgets yang available. Drag widget Flickr ke arah sidebar (sisi kanan dari halaman widget), maka tampilan setting flickr akan terbuka seperti pada gambar dibawah ini.

Isikan detail dari feed flickr yang ingin anda tampilkan (seperti gambar diatas). Untuk alamat flickr (Flickr RSS URL), bisa anda dapatkan dari halaman flickr bagian pojok kiri bawah dengan simbol RSS.
4. Save setting untuk flickr.
5. Kunjungi situs wordpress anda. Album foto flickr anda telah tertampil, dengan jumlah foto yang ditampilkan sesuai dengan setting anda di langkah 3. Dibawah ini adalah contoh tampilan album foto flickr dalam halaman sidebar WordPress.

Cantik bukan? πŸ˜€ Okay, happy WordPress-ing πŸ˜€
And Take a lot on your camera !

Categories
WordPress

Upload Image in to WordPress Post (for Beginner)

Discussion Board : Tutorial to upload images in WordPress posts.
Needs : WordPress.com account, and an Image as a sample (can be in different filetype).

When posting articles, essays, or tutorial, of course we will often want to include some images in our posts, because with the pictures, your post will look more attractive. This tutorial is intended for beginners wordpress users who do not know how to upload images into a wordpress post.

Follow this Steps :
1. Log in to WordPress.com by entering a username and password (your wordpress account).
2. You will be redirected to a dashboard page of wordpress.
3. Select the Post – Add New.
4. You will find page WordPress posts. Enter a title, as well as other text you want in the box width to write the text.
5. To insert an image, click the “Add an Image”, as shown in the following figure (part circled in red).

6. Wait until loading is complete. After loading is complete, it will show the Add an Image dialog box (see picture below). Choose Select Fields (circled in red), then locate the location of the image you want to enter into a wordpress post. Click on the picture and select Ok.

7. Images will begin to be uploaded into your wordpress server. Wait until the image loading is finished.
8. After loading the image is complete, it will display the details of your uploaded images, shown as picture below. Fill in the title, caption, description, alignment (layout) and the size you want, or let it default. When finished, click the “Insert into Post” (the part circled in red).

9. Perform steps 5-8 again if you want to insert another picture in your post. If done, click Publish to publish your post.
10. Check Ur post, make sure that the image is successfully upload like below πŸ˜€

Okay, hope it will help. Happy WordPress-ing.

Categories
WordPress

Memasukkan Gambar dalam Postingan WordPress (untuk Pemula)

Discussion Board : Tutorial untuk memasukkan (upload) gambar dalam postingan WordPress.
Kebutuhan : WordPress.com account, Gambar sebagai sample (bisa berbagai filetype).

Ketika melakukan posting artikel, essay, ataupun tutorial, kita tentu akan sering ingin memasukkan gambar dalam postingan kita tersebut, karena dengan adanya gambar, postingan kita akan terlihat lebih menarik. Tutorial ini ditujukan untuk pengguna wordpress pemula yang belum mengetahui bagaimana untuk melakukan upload gambar ke dalam posting wordpress.

Langkah – langkah :
1. Login ke WordPress.com dengan memasukkan username dan password account wordpress anda.
2. Anda akan diarahkan ke halaman dashboard wordpress.
3. Pilih menu Post – Add New.
4. Anda akan mendapati halaman posting WordPress. Masukkan judul, serta teks lain yang anda inginkan dalam bagian kotak lebar untuk menulis teks.
5. Untuk memasukkan gambar, klik tombol “Add an Image”, seperti yang ditunjukkan dalam gambar berikut (bagian yang dilingkari merah).

6. Tunggu hingga loading selesai. Setelah loading selesai, akan muncul kotak dialog Add an Image (lihat gambar dibawah). Pilih Select Fields (dilingkari merah), kemudian cari lokasi gambar yang ingin anda masukkan ke dalam postingan wordpress. Klik pada gambar dan pilih Ok.

7. Gambar akan mulai di-upload ke dalam server wordpress anda. Tunggu hingga loading gambar selesai.
8. Setelah loading gambar selesai, maka akan muncul tampilan detail dari gambar yang diupload, ditunjukkan seperti gambar dibawah ini. Isikan title, caption, description, aligment (tata letak) dan ukuran yang anda inginkan, atau biarkan saja default. Setelah selesai, klik tombol “Insert into Post” (bagian yang dilingkari merah).

9. Lakukan langkah 5-8 lagi apabila ingin memasukkan gambar lain dalam postingan anda. Jika sudah, klik Publish untuk mempublish postingan anda.
10. Cek postingan tampilan anda, pastikan bahwa gambar telah tertampil seperti dibawah ini πŸ˜€

Okay, semoga membantu. Happy WordPress-ing.