Category Archives: Website Development

Belajar Ruby 1

Bukan, saya bukan Ruby programmer atau mengerti bahasa pemrograman ruby. Justru saya baru belajar ruby satu – dua minggu ini. Alasan saya belajar ruby ? Bosan dgn PHP! *just kiding* alasan pastinya tidak ada, tapi karena saya tertarik belajar web framework rails yg berbasis ruby, obviously ruby knowledge is a must. Lucu aja misalnya belajar codeigniter tapi nggak tau PHP :)
Continue reading

Include Joomla core functionality in external PHP file

Once I need to have Joomla core class in external files, answer can be found here. To repeat myself, here’s minimum code required to have Joomla functionality in our own file.

<?php
//define constant
define( '_JEXEC', 1 );
define( 'DS', DIRECTORY_SEPARATOR );
 
//you need to adjust joomla path according to your joomla installation
define( 'JPATH_BASE', $_SERVER[ 'DOCUMENT_ROOT' ] . DS . 'joomla' );
 
//include joomla core files
require_once( JPATH_BASE . DS . 'includes' . DS . 'defines.php' );
require_once( JPATH_BASE . DS . 'includes' . DS . 'framework.php' );
require_once( JPATH_BASE . DS . 'libraries' . DS . 'joomla' . DS . 'factory.php' );
 
//create application
$mainframe =& JFactory::getApplication('site');
 
//in this point, you're ready to use joomla functionality
 
//example: initialize database object
$db = JFactory::getDBO();
 
//or import plugin helper
JLoader::import('joomla.plugin.helper');
 
//to test whether some plugins is enabled
$pluginenabled = &JPluginHelper::isEnabled('authentication', 'joomla');

Happy coding!

[solved] Aptana Studio 3 error during file commit

If you’re using Aptana Studio 3 in Ubuntu 11.04 and having error similar like this

Unhandled event loop exception
No more handles [MOZILLA_FIVE_HOME='/usr/lib64/xulrunner-addons'] (java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
	/home/adi/Aptana Studio 3/configuration/org.eclipse.osgi/bundles/223/1/.cp/libswt-mozilla-gtk-3659.so: libxpcom.so: cannot open shared object file: No such file or directory
	no swt-mozilla-gtk in java.library.path
	/tmp/swtlib-64/libswt-mozilla-gtk-3659.so: libxpcom.so: cannot open shared object file: No such file or directory
	Can't load library: /tmp/swtlib-64/libswt-mozilla-gtk.so
)

I was having the above error when trying to commit a file. The solution is to install the older xulrunner package which is 1.9.2 by typing:

sudo apt-get install xulrunner-1.9.2

good luck!

Mau belajar CodeIgniter ?

SuBali, komunitas startup Bali akan mengadakan kegiatan workshop perdana-nya. Workshop ini akan menjadi salah satu kegiatan rutin SuBali sebagai bentuk sharing knowledge antara sesama startupers. Untuk workshop kali ini temanya CodeIgniter, salah satu PHP framework yang cukup terkenal akan kemudahan penggunaannya terutama bagi developer pemula.

Yang tertarik untuk mengikuti workshop ini tidak dikenakan biaya tapi berupa donasi se-ikhlasnya. Detail dan pendaftaran bisa dilihat diĀ http://eevent.com/subali/workshop-subali

How to add eShop in custom post type in WordPress 3

By default, eShop shopping cart plugin will use standard post to display it’s product options. But it would be better if we can use custom post type which is available in wordpress 3 to have separate post type for our product. First we need to install eShop and Custom Post Type UI then use Custom Post Type UI to create custom post type easily instead of messing around with functions.php.

Next is look for editing eshop-product-entry.php file inside eshop plugin folder. Search for this code approx on line 13

add_meta_box( 'epagepostcustom', __( 'Product Entry', 'eshop' ), 'eshop_inner_custom_box', 'post', 'normal','high' );

Now replace ‘post’ with your newly created post type, i.e: product.

add_meta_box( 'epagepostcustom', __( 'Product Entry', 'eshop' ), 'eshop_inner_custom_box', 'product', 'normal','high' );

That’s all, when you add new product, there’s eShop options available for that custom post type.

How to display future post in WordPress

This is small snippet to display all future posts starting today. Add this before doing the loop

<?php
function filter_where($where = '') {
  //posts in the last 30 days
  $where .= " AND post_date >= '". date('Y-m-d', strtotime('now')) . "'";
  return $where;
}
add_filter('posts_where', 'filter_where');
query_posts($query_string . "post_status=future,publish&orderby=date&order=ASC");
?>

You can limit the result or change order. See Codex for details of using query_posts

The right web host for your business

Some people thought that in order to get a great service, they’ll have to spend a big amount of money. Well, not really. Sometimes, spending more is not even advisable.

I don’t think there’s still a need for me to explain why a business should set up a website. It has been proven to be a very effective way of marketing a product, service or company. You can buy a hosting package from many different hosting providers. But not all of them are reliable enough to make sure your website is always online. Every minute and every hour is important for a business especially if you’re serious on getting your business a good start.

Continue reading

Workshop Web Development gratis di Surabaya

Mau berkarir di dunia web development? atau sekedar menyalurkan hobi ? kebetulan di Surabaya akan segera diadakan workshop singkat yang terdiri dari kelas web design dan web programming. Tidak dipungut biaya untuk mengikuti workshop yang rencananya akan diadakan di THR mulai tanggal 22 Juli 2009.

Saya sendiri Insya Allah akan kesana kepengen silaturahmi dengan rekan2 yang lain :) . Keterangan detail bisa dilihat infonya di web PHPUG