Monday, May 30, 2011

Creating a database in iWeb's PanelBox

iWeb is a Canadian web hosting company that offers shared hosting, managed and unmanaged dedicated servers and colocation.

What is PanelBox?

PanelBox is custom cPanel interface used by iWeb for its hosting accounts.

Creating a database

  1. To create a database in PanelBox, first login to your account. The default url would be /cpanel.

  2. Under General Options, click on Database.

  3. Select whatever Database you want to setup > either MySQL or PostgreSQL. For this guide, we'll be using MySQL.

  4. Name your database and click on "Create Database".

    New Database

  5. Now you need to create a user for the database you just created. Hover again over MySQL, and select "Add new user".

  6. Name the user, and give a strong password. Click "Create User" to proceed creating a new database user.

    New User

  7. Next step is to add the user you created to the database, hover over MySQL and select "Add User To Database".

  8. On the Add User To Database page, select the user and database you created and hit "Submit".

  9. Manage User Privileges page should appear next, check "All Privileges" and then click on "Make Changes".

Now that you have setup the database, you should be able see it under MySQL > Current Databases.

Saturday, May 14, 2011

Random Image Banners in Wordpress

There are lots of different ways to get this done, either by using one of many Wordpress plugins, or just writing custom code. But for this tutorial, we'll be using a Wordpress plugin called WP Bannerize.

  1. Download the plugin from this page. Extract and upload to your server, location should be your_wordpress_directory_root/wp-content/plugins.

  2. Login to your blog, and on your left sidebar, click on Plugins. Look for WP Bannerize, and click Activate to enable the use of the plugin.

  3. Once the plugin is activated, you should be able to see on your admin sidebar the WP Bannerize controls. You can now start adding banners by clicking on "Add new".

  4. Browse for the image, and fill out other attributes like destination URL, etc.

  5. Now that you have your banners ready, you need to insert into your theme the following:

    <?php if(function_exists( 'wp_bannerize' )) wp_bannerize('limit=1&random=1'); ?>


    The default code would just be:

    <?php if(function_exists( 'wp_bannerize' )) wp_bannerize(); ?>

    but adding limit and random makes your banners appear in random order.