Google Chrome 3 Released!

Google rolled out the latest version of Google Chrome few days ago. This release is still in the beta. The features in the new version are amazing.

Google Chrome Screenshot

  1. Rearrangable and Dockable Shortcut Icons – Previously the icons that you see when you open a new empty tab lists the last few websites you visited in the order of the frequency of visit. The new version allows you to re-arrange these icons as well as dock them.
  2. Themes - This version even features the long awaited themes feature. Google’s own theme gallery is visible as two shortcuts if you clear your entire history. Some of the themes are still unstable which makes them break in Vista sometimes.
  3. More Icons For Recent History – Previously only three links that you visited last were shown in a new empty tab in the bottom right corner of the screen. In the new version, two entire rows with 5 links in each are visible.
  4. Faster Java script Engine – Google claims that the new version has a 30% improvement in the speed of the V8 Javascript engine over the previous versions.

Apart from the theming system the browser is very stable. Click here to try it out.

Although this doesn’t look like a lot of changes in the number of features. The team behind Google Chrome must have made many changes to attain the 30% improvement in speed. This is yet another step in Google’s efforts to make the next big operating system which they announced a few weeks ago.

How To Add A Administration Page In WordPress

When adding new features to a wordpress website you may have to create a configuration page for the feature you created.

For example, the twitter plugin (which adds your twitter feed to the sidebar) should be configurable to specify the username and the number of tweets to display. This is important in cases where the plugin will be distributed and be used by non-technical users.

admin-section

This article will show you:

1. How to create an admin section like the one shown in the image on the right.

2. How to create sub pages for each of those sections

3. Show the content (usually a form) you want when the sub page link is clicked.

What We’ll Create:

admin-menu

This is a part of a module that I am working on right now. This module adds an autoresponder that has most of the features of Aweber.com.

Step 1: Add An Admin Menu Hook

Add an admin_menu callback function in your main PHP file. If you don’t know what a hook is, it is simply a special function that you ask wordpress to call at a particular stage of initializing the output. In this case the stage is building the administration menu.

add_action('admin_menu','wpr_admin_menu');

Step 2: Adding menu items

Adding Admin Section

First we add a separate section called “Newsletters” which can be expanded to show some more links to sub sections (Home, Subscribers in the above picture). To add a section we use this function:

add_menu_page(page_title, menu_title, access_level/capability, file, [function], [icon_url]);

So in our plugin we use:

add_menu_page('Newsletters','Newsletters',8,__FILE__);

If you leave out the [function] parameter, wordpress will display the first sub page under the section when the section is clicked (and not expanded using the small arrow on the right). Click here to read the detailed documentation of the function.

Access Capability

I need this section to be visible only to the admin user therefore I have used access_level as 8. Click here to see other access level values.

Adding Sub Sections

The sub sections – Home, Newsletter, Subscribers, Messages and Reports are added using the following function.

add_submenu_page(parent, page_title, menu_title, access_level/capability, file, [function]);

In our plugin we use:

add_submenu_page(__FILE__,'Newsletters','Newsletters', 8, "newsletter", "wpr_newsletter");

The first parameter is the parent file. This should be the same as the top level menu’s file parameter. Click here to read the detailed documentation of the function. In the parameters, add the parent, page title, menu title and access level capability and then add any unique value for the file attribute

Customizing the first sub section’s link text

When you add sub sections using the add_submenu_page function as shown above, the first section always takes the name of the top-level section itself. To change that to something you want, call the add_submenu_page function as shown below immediately after the add_menu_page function.

add_submenu_page(__FILE__,'Dashboard', 'Home', 8, __FILE__, "wpr_dashboard");

The only difference is the parent attribute and the file attribute in the function are et to the same file. Above function will set the link of the first section to ‘Home’. The wpr_dashboard function will be called when this page is to be displayed.

function wpr_dashbaord()
{
     echo "Dashboard Content Goes here!";
}

Below is the code for the menu in the picture :

add_action('admin_menu','wpr_admin_menu');

function wpr_admin_menu()
{
     add_menu_page('Newsletters', 'Newsletters',8,__FILE__);
     add_submenu_page(__FILE__, 'Dashboard', 'Home', 8, __FILE__,"wpr_dashboard");
     add_submenu_page(__FILE__, 'Newsletters', 'Newsletters', 8, "newsletter","wpr_newsletter");
     add_submenu_page(__FILE__, 'Subscribers', 'Subscribers', 8, "subscribers", "wpr_subscribers");
     add_submenu_page(__FILE__, 'Messages', 'Messages', 8, "messages", "wpr_messages");
     add_submenu_page(__FILE__, 'Reports', 'Reports', 8, "reports", "wpr_reports");
}

Guest Post On BuildInternet : Four Ways To Make Equal Height Columns

One of the most difficult tasks when moving from table based layouts to css based layouts is creating equal height columns. Many newcomers to web design will find these frustrating to create.

I’ve written a guest post at one of my favourite web development blogs – BuildInternet on how to create just that. The article discusses four methods to create equal height column layouts in HTML/CSS. I’m very excited about this article because this is my first guest post on another blog. I will be making many others like this. Please take a look:

Four Methods to Create Equal Height Columns

Drupal Module: Twitter Block – Add Your Twitter Feed To Your Drupal Website

Why don’t you show how relevant you are to your site visitors and get more followers on twitter? Once they start following you, you can start pointing them to your website again and again now that you have their attention.

Unfortunately there isn’t a simple way to create this block from the existing drupal modules. The procedure to create a Twitter block is very convoluted using Views and what not.

twitterblock

But first, a little rant. It seems like a lot of developers are more focused on being ‘standards complaint’ (politically correct) than create easy to use software as if they create software for other developers.

“Oh! let’s not rehash the code here, that’s not good core re-use. Let’s ask users of our module to download and install 10 other modules on which we will base this module!”

This block is installed through the module (download below).

The block is highly customizable. Check out the options you have in the administrator’s interface.

This interface is found in Administer > Sites Building > Blocks > Twitter Block [configure]

configuration

The blocks can be theme using css as each element is enclosed in a <div> of appropriate name.

Download

Click here to download the module.

Installation Steps

1. Install the Module: Just place the module in the modules directory of your drupal site or sites/all/modules/ directory if you have multiple installations. Log in as administrator and go to Site Building > Modules. Scroll to the bottom and find “Other” package. Expand it, check the TwitterBlock one and click Save Changes.

2. Place The Block In A Region: Now go to Administer > Site Building > Blocks. At the bottom of the list you will find Twitter Block. Drag it to the required region and click Save Changes.

3. Enter Username/Password: Once you click save, you will still not see the block, you must enter the username and password. So click on ‘configure’ next to Twitter block and enter your username and password. Choose a appropriate update frequency and click Save.

You’re all done. Your module should be working now. Leave a comment on this post regarding bug fixes and other issues.

License

This module is provided under the GPL license. Read the full version here.

Introducing Gefine – Google Powered Dictionary!

gefine

One of coolest featuers in Google is the ability to find the definition of a word using the “define:” prefix. The advantage of the Google dictionary is that it also lists the definitions that are not official and “approved by oxford” – the kind of words that a publisher of a dead-wood dictionary will not add it its book.

img

 

Just because it isn’t on the dictionary doesn’t mean the word doesn’t exist right? That’s why I created this tool. You can get the definition of any word on the desktop. Perfect for finding up and coming fads and lingo.

gefine-shot

Gefine dictionary viewer is available for Windows and Linux.

In the next version, I will be adding Urban Dictionary support and possibly automatic word completion.

License

This tool is provided under the GPL license.

Download

Download For Windows – Click Here

Download For Linux – (Coming Soon)!

Source Code

Gefine is written in Qt C++. It is a GUI Library for creating applications for Windows, Macintosh and Linux. The code is in C++.

Click here to download the source code

Need Gefine For Your Macintosh?

I don’t have a executable file for Mac but if you have a Mac and would like to help create a Mac version of gefine please download the source code, install the Qt C++ framework and compile the source. Send me an e-mail if you need help. Please give me the binaries so I may distribute it to others.

How To Create A New Block In Drupal 6

One of the most common questions that new drupal users come across is finding out how to create a new block.

Blocks are sections of a page that can be placed in any one of the regions supported by the theme that is currently active. A block usually gives some special features such as a log in form, a poll, a list of links to a section of your page or something similar. Some special modules add new blocks that you can place in your website.

Why Would You Add A Block?

You may want to add a new block for adding some HTML code for your such as for an advertisement block or a website hit counter. The block may need to have some text or HTML code that should be displayed in all (or selected) pages of your website.

You may even add a block to execute some PHP code in your web page. In this example I will show you how to add a block that displays the current time and date. Although I am using PHP code, you can even use HTML or even plain text.

How Would You Add A Block?

There are two methods to create a custom block for drupal. This article will discuss both methods. The first method can be used by anyone. The second method is better suited to you if you have to distribute the code to someone else.

There are two methods to create a custom block for drupal. This article will discuss both methods. The first method can be used by anyone. The second method is better suited to you if you have to distribute the code to someone else.

Important Note: If you are going to add some PHP code in the block, then you must enable the PHP input type. In drupal 6 this is done by enabling the PHP Filter core module. In drupal 5 this is done by going to Administer > Site Configuration > Input Formats and adding PHP Input type.

phpfilter


Step 1: Go To The Administration Panel > Blocks and click on the Add Block link (tab).

creatingblocks-1


Step 2. Fill in the form along with the necessary PHP code. And click on the ‘Save Block’ button.

addingblock


Advantage : The advantage of this method is that it is very simple. It can be done quickly and easily by anyone. Even a non-programmer can do it in a matter of minutes.


Disadvantage: For non-programmers this is a minor disadvantage – that you cannot distribute the block as a small piece of code that another person can place in their modules folder, enable it and arrange the new block on their website. For developers this method means they cannot distribute the functions of the block without giving long instructions on how to enable it (which is usually error-prone).

The Developer’s Method: Meant for creating a block for distribution

This method is ideal if you want to create special functionality that goes with your theme or just generally a new block for any drupal website.


In this method we will create a new module which will add a “Time And Date” module to the Administer > Site Building > Blocks section.



1. Create a new directory under sites/all/modules called timeanddate.


2. Under timeanddate directory, create a file called timeanddate.info and enter the following code in it as it is:

; $Id$
name = timeanddate
version = 1.0
description =This module adds an advertisement block. This is to be used with the authorist theme
core = 6.x
PHP = 4.3

2. Under the same directory, create another file called timeanddate.module.


Firstly we have let drupal know that we want to create a new block. We do this by defining a function called _block(). Modulename here is timeanddate, so our function will be:

<?php
function timeanddate_block($op='list',$delta=array(),$edit=array())
{
      switch ($op)
     {

     	case 'list':
                       $blocks[0]['info'] = t('Time And Date');
                       return $blocks;
                       break;
      }

}

Save it and go to Adminsiter > Site Building > Blocks. Defining this function in the timeandmodule.module file will add a new block named ‘Time And Date’ to your Administer > Site Building > Blocks section. Don’t try to add this to a region yet. You will not see a new region if you do so.


function timeanddate_block($op='list',$delta=array(),$edit=array())
{
      switch ($op)
     {

     	case 'list':
                       $blocks[0]['info'] = t('Time And Date');
                       return $blocks;
                       break;
      case 'view':
           ob_start();

//start block content
?>

enter your plain text or html here.

<?php
//end block content
          $content = ob_get_clean();
          $blocks['subject'] = t('Time And Date');
          $blocks['content'] = $content;
       break;
      }
}

Enter your HTML code in place of “enter your plain text or html here”. If you are using PHP code to generate some output to the browser, replace the code that is in between ‘ob_start();’ and ‘$content = ob_get_clean();

In our example, we will be using php code, so our function, with the addtion of “echo date(‘gi:i d D m Y”);” which prints the current date and time, becomes this:


function timeanddate_block($op='list',$delta=array(),$edit=array())
{
      switch ($op)
     {

     	case 'list':
                       $blocks[0]['info'] = t('Time And Date');
                       return $blocks;
                       break;
      case 'view':
           ob_start();

           echo date('gi:i d D m Y');

          $content = ob_get_clean();
          $blocks['subject'] = t('Time And Date');
          $blocks['content'] = $content;
       break;
      }
}

That’s it. Now we have a block that shows the time. This module can be distributed to other website owners as well.

Time And Date Module

How To Install A Drupal Module

This article will show you how to install a module in drupal.

Drupal modules are pieces of software that are added to the drupal cms software to add some features. For example a contact form can be added using drupal modules. This feature doesn’t come built into drupal by default.

Drupal modules can be downloaded from the drupal moule repository. Click here to go to the module repository.

Once you dowload a module do the following steps to install it.

1. Extract the archive to a folder on your computer. We are going to upload the directory that has the module files (*.info, *.module *.install) in it.

2. In the directory where you installed drupal, under sites/all/ create a folder called modules.

3. Upload the folder extracted in step 1 to this directory.

4. Log into your drupal installation as an administrator. Go to Administer > Site Building > Modules

5. The module must be listed in the resulting page. Click on the check box near the name of the module and click save configuration.

That’s it!

The Shock And Awe Of The Dollar

There is a tendency for people in many countries to fear the dollar figure. I am talking about the USD – The currency of the United States Of America.

When someone in India asked me how much I charged for a single theme, I quoted $50. They immeditely went defensive and said $50 is too much. I offered to do it for Rs. 2000 and they readily accepted. At that time $50 was equal to Rs. 2000. Heck, $50 was Rs. 40 lesser!

I know some friends who have made bad purchases especially web hosting because they were afraid of the dollar. Take yahoo small business for example. They quote the price in Indian rupees this seemed more approachable to many here and went along with it.

There are many web hosting companies that charge an arm and leg in India and provide 1/100th of the resource provided by a web host from a western country.

The same people are in complete awe when I say I made $xxx for thsi project. They go around telling everyone how wonderful and talented I am and that I am “earning in dollars”.

This is a very real psychological problem that many in non-western countries have. Try to take a moment to see if you have it too. It may be keeping you from making the best purchasing decisions.

How To Install Drupal On Your Shared Hosting Server.

Drupal is the best content management system I have ever come across. It has all the features necessary to build any website. Drupal can save you thousands of dollars in development costs by simplifying the development of complex applications and portal websites. The drupal community has created thousands of plugins which can be configured to achieve any functionality desired in a content management system. This article will show you how to install Drupal on your shared hosting server. This article will show you how to install drupal in a shared hosting server.

Read more »

There Is Something About Google Chrome

There is something about Google Chrome that I can’t figure out. Like how they manage to load the application in a matter of milliseconds. This single feature is responsible for converting me from firefox to chrome.

Google chrome brings the concept of minimalism to browsers. Minimalism has worked perfectly for their instant messaging client – Google Talk (which is popularly known by its executable file name ‘gtalk’). There are no extensions, there are no themes or any of the other non-sense that bloats an application.

No Such thing As Releases?

I am not sure if this is true but I suspect that the updates are not issued through the usual method of sequential releases. Updates and security fixes are applied automatically. The application seems to do this in the background.

A few months ago, shortly after chrome’s release, the browser tabs had a tendency to crash left and right. But that stopped without me having to update or re-install the application.

Recently, downloading a executable file shows a warning in the taskbar. These alerts never showed before.