Skip to content


Reset File Association in Linux From Nautilus

If you have ever experienced, for example, installing an application that turned out change the way how a file is opened. For example, to open a txt file in gnome, gedit is used. But, at a time, you install, geany or mousepad. When you want to open the txt file again, instead of calling gedit, system will call mousepad to open it.

Continued…

Posted in Tips N Trick.

Tagged with , , , , .


Add Custom Column To Media Page

How do you get full image URL in Media Library? I bet you will go through this step:

  1. Go to Media » Library
  2. On Media Library list, click file name.
  3. Form Edit Media appeared. Select File URL and use it.

For single image operation, this should be enough. But, if you did have a lot of pictures, this operation would be very annoying. For this, I have a simple solution. With a few lines of code that later summarized into a plugin. Then you will have a way to access the images directly from the Media Library.

Continued…

Posted in Tutorial.

Tagged with , , , .


Get Only n Words From String

Here’s the code:

function trim_word( $words, $howmany = 1){
	$x = explode(" ", $words);
	if(count( $x) <=$howmany ){
		return $words;
	} else {
		return implode(" ", array_slice( $x, 0, $howmany));
	}
}

Here’s the output:

$words = "this is string that is long enough that I want to trim it.";

echo trim_word($words, 10) . "\n";
//this will echo: this is string that is long enough that I want

UPDATE:

  1. 2010-02-05 15:03:25 – Fixing $howmany usage. Sorry, for the inconvenience:D

Posted in snippet.

Tagged with , , , .


Adsense under Image: Reloaded

A few month ago, my friend Jauhari contacted me, asking specific question about a wordpress plugin called Adsense Under Image. At that time, I crawl the code and though that it would be cool if it can have multiple images and or set randomly where the adsense code appeared. I try to contact the developer to submit my idea. But, the website listed is dead and the plugin itself is now aged more than 2 years. Now became dead site:(.

Continued…

Posted in [CR]Adsense Under Image - Reloaded.

Tagged with , , , , .


ImageShack Linux Uploader

Has been using imageshack for years, my only complain is the lack of desktop uploader for linux. However, few days ago, when I open up imageshack to upload some images, I stumble upon section called “More Ways to Upload”. Curious, I click it and I saw list of 3rd party apps. There’s an uploader for linux too!. A great feature that I find useful is, the ability to upload images into our account. So that I can delete some stuff that is no longer required. Oh, did I mention that it came in .deb? YES .DEB!

Posted in Reviews.

Tagged with , , , .


Test Your Site on Multiple Browser Using Adobe BrowserLab

Having Ubuntu as development environment is great! But, I things get complicated when I came to testing your site on IE. Yes, we can test it using IEs4lin project. But, my experience told me that the result is not quite the same as using IE on pure windows installation.

Yesterday, I got message from colleague at California. He told me about Adobe BrowserLab. A cool service from Adobe to test how our site looks on several web browser. It display the site like Pixel Perfect plugin for FireBug. Give it a try and you’ll be amazed!

Free Image Hosting at www.ImageShack.us

Posted in Reviews.

Tagged with , , , , , .


Loading Contact-Form-7 Plugin Outside Post/Page/The_Loop

Hi, just want to share little snippet. I was developing wordpress site for my client and I want to use Contact-Form-7 (CF7) to speed-up my development time. I need to add form (custom form) outside the loop / post / page content. From CF7’s documentation, there’s no single text explaining how to do it.

So, I guess I have to get my hand dirty by crawling the code. Here’s how I do that.
From anywhere on wordpress theme files, put this code to display your CF7 form:

<?php echo do_shortcode ( '[contact-form 2 "Banquet Inquires"]' ); ?>

Posted in Tips N Trick.

Tagged with , , .


Web Scrapping Made Easy, With YQL

Usually, when someone asked me question: “how do you scrap data from certain website?”. My answer would be using some REGEXs. However, Yahoo now has something interesting on it’s developer site. Instead of doing REGEX, we can just QUERY our target page with YQL and extract the data as XML or JSON.

Continued…

Posted in Tutorial.

Tagged with , , , , .


CR-Post2PingFM 0.8 Released

Just minor enhancement on admin page for Ping post template. I added 10 messages template form for you to fill it out. The plugin will randomly select non empty template for ping.fm updating purpose.

Posted in [CR] Post to Ping.FM.

Tagged with , , .


Display Drupal Taxonomy Like Craiglist Does

So you have a classified site build on top of drupal. Someday, you encounter this craiglist page and though that you would like to mimic that page. Don’t worry, I’ve been implementing in on my recent project and I would like to share it here.

Continued…

Posted in Tutorial.

Tagged with , , .