Reset WP Password

Simple way to reset your WordPress password through phpMyAdmin.

Step 1:
Create PHP file on your WordPress root and rename to password.php and put this code:

<?php
require('./wp-blog-header.php');
echo wp_hash_password('yourpasswordhere'); //
?>

Execute and copy the text appear.

Step 2:
Open IE or Firefox browser, go to your phpMyAdmin (Note: use phpMyAdmin at your own risk.)

  • Click your WordPress database
  • All the tables in your database will appear. If not, click Structure.
  • Look for wp_users.
  • Click on the icon for browse or structure.
  • Choose user and click edit
  • Find user_pass and paste the text from password.php
  • Click Go

Go to your WordPress Login page (something like http://yoursite.com/wordpress/wp-login.php) and type yourpasswordhere

Javascript framework API for Dreamweaver MX-CS3

Dreamweaver Xtnd.us offers extensions and reviews for web designers and developers that enhance the workflow of anyone from beginners to professional, anyway who uses Adobe products like, Flash, Dreamweaver, Fireworks, Flex, Apple’s iLife and iWork, and even software like Eclipse.

List of Dreamweaver extension:

DOWNLOAD

If you’re interested in Mochikit, MooTools and YUI API for Dreamweaver, he’s taking requests.

Return most recent post by date range

UPDATED: This trick not work with paging. Go to another trick

Want to limit the number of posts on your front page by a date range? For example, display most recent posts for the last 30 days? This works perfectly..

Open index.php template file. Changed this code from:

<?php while (have_posts()) : the_post(); ?>

to:

<?php while (have_posts()) : the_post(); ?>
<?php
$mylimit=30*(60*60*24);
if ( (current_time(timestamp) - get_the_time('U') - (get_settings('gmt_offset') * 3600) ) < $mylimit)
{
?>

and this code from:

 <?php endwhile; ?> 

to:

 <?php } ?>
<?php endwhile; ?>

Kisah gua dengan makwe gua

Gua dulu ada seorang makwe. 3 tahun kami kapel.

Pada satu hari gua fikir elok juga gua amik makwe gua dari sekolah. Boleh deting lama lama memandangkan dulu tiada henpon. Gua pun pergi amik makwe gua dekat sekolah dia.

Sampai sekolah, makwe gua terus masuk kereta duduk depan. Gua jeling makwe gua tak berkelip.

“Lu apahal duduk depan? lu turun balik lu duduk belakang sekarang! Gua lempang juga kang!”

Makwe gua terus keluar dan tak datang datang. Selepas pada itu kami berpisah cara baik dan beradat.

PHP Tips [Part 1]

Guna PHP? Disini saya cuba berkongsi beberapa tips PHP walaupun dah agak ketinggalan sikit. Saya harap ianya sedikit sebanyak membantu dan menjadi panduan kepada mereka-mereka yang sedang mempelajari PHP. Korang yang ada tips atau trick lain boleh la letak kat ruangan komen.

Gunakan single quotes

Cuba elakkan menggunakan double quotes dalam variable. Ini kerana PHP tidak ‘baca’ variable di dalam single quote dan secara langsung mengurangkan run-time PHP.

$teks= 'Malaysia';
echo 'Selamat Pagi $teks.';
// Paparan: Selamat Pagi $teks.
echo "Selamat Pagi $teks.";
// Paparan: Selamat Pagi Malaysia.

Skrip ini lebih efisien

echo 'Selamat Pagi ' . $teks . '.';

berbanding daripada skrip berikut

echo "Selamat Pagi $teks.";

Tips & Singkatan

  1. $variable = $variable + 1; boleh ditulis seperti berikut $variable ++; atau $variable --;
  2. $teks = 'Malaysia';
    $teks = "Selamat Pagi $teks.";
    

    boleh disingkatkan menjadi

    $teks = 'Malaysia';
    $teks .= 'Selamat Pagi ' . $teks . '.';
    
  3. if ($saham == 'naik') {
    		$duit ++;
    }

    singkatkan menjadi..

    if ($saham == 'naik') $duit ++;

    dan struktur menggunakan else

    if ($saham == 'naik') $duit ++;
    else $duit --;
  4. if ($variable == true) echo 'Some string.';
    elseif ($somevariable == false) echo 'Other string';

    singkatkan menjadi..

    if ($variable) echo 'Some string.';
    elseif (!$somevariable) echo 'Other string';
  5. Contoh shortcut untuk if-else statement
     if( $warna == 'biru' ) {
            echo 'Biru';
        } else {
            echo 'Warna lain';
        }

    boleh disingkatkan menggunakan ternary operators

    echo ( $warna == 'biru' ) ? 'Biru' : 'Warna lain';

Hello world!

Everything change on my blog.. I didn’t really have time at all tonight, but I decided to have a go at it anyway. Thanks to Elena Gafita for great theme, which only needed some minor modding for widgets and style.

Again, thank you WordPress. Thank you to the people that visit here frequently, or used to.

Apa yang paling kita nak, itulah yang susah kita dapat