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 file association, geany, gedit, mousepad, Nautilus.
By Arief Bayu Purwanto
– February 5, 2010
How do you get full image URL in Media Library? I bet you will go through this step:
- Go to Media » Library
- On Media Library list, click file name.
- 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 admin, media library, plugin, wordpress.
By Arief Bayu Purwanto
– February 4, 2010
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:
- 2010-02-05 15:03:25 – Fixing $howmany usage. Sorry, for the inconvenience

Posted in snippet.
Tagged with array_slice, PHP, string, trim.
By Arief Bayu Purwanto
– February 3, 2010
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 adsense, image, plugin, ressurected, wordpress.
By Arief Bayu Purwanto
– February 2, 2010
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 imageshack, Linux, ubuntu, upload.
By Arief Bayu Purwanto
– January 26, 2010
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!
Posted in Reviews.
Tagged with adobe, browserlab, firebug, ies4lin, pixel perfect, ubuntu.
By Arief Bayu Purwanto
– January 25, 2010
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 contact-form-7, plugin, wordpress.
By Arief Bayu Purwanto
– January 24, 2010
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 json, manga, regex, xml, yql.
By Arief Bayu Purwanto
– January 21, 2010
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 ping.fm, post2pingfm, update.
By Arief Bayu Purwanto
– January 20, 2010
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 craiglist, drupal, theme.
By Arief Bayu Purwanto
– January 20, 2010
Recent Comments