January 2010

Drupal hook: hook_cron

You've just published a Drupal website and people find it very useful. So, they started signing up with your website and its really very good traffic now. You have planned to implement some features and you want to let know about to all the members of the site. There are two ways: you send e-mails to individuals by using their contact form or implement a system with which you create a node and the site itself sends e-mails. How about sending the e-mails at specific period of time? ohh.. yeah. that's great. Drupal's hook_run makes it happen. Since, there are more features to come, you want to do this every time you have something new to let others know about, you would use hook_cron, which performs specific tasks assigned to it periodically.

Share your Drupal codes

We are pleased to announce a successful implementation of CodeBook, a feature which lets you share your Drupal codes and shows your Drupal skill to the world. By creating CodeBooks, you can showcase your Drupal Development skills by referring the CodeBooks to your potential clients as well as recruiters. This is all about helping the community in learning the Drupal in an easier way. So, Join the movement!

We, the people of India...

Happy Republic Day!

We, the people of India, are celebrating 60 years of becoming sovereign. By looking back, we are proud of our progress we achieved after becoming independent. British rule is an old story. We love to talk about the progress and the honor India and Indians, all over the world, have earned. Unstable and Untrustworthy neighbors have tried to disturb our life by fighting proxy wars, but we are stand still like Himalayas. We, the people of India, proud to be Indians!!

Jai Hind!!

Video Chat! have you tried it?

Its our pleasure to announce the inclusion of Video chat. Now, you can chat using video on Drupal Developer. Pretty nice interface and very good quality video. Making it more easy for Drupal developers to communicate and act faster. Try it today and drop a feedback. We are hearing you.

Drupal hook: hook_install

hook_install() creates tables in the database for the module to which its associated. hook_install not just restricted creating tables but it also creates vocabularies, terms in the vocabularies and sets variables to be used by modules. The hook_install set ups the basic requirement for a module to function properly. Not all the modules require to implement hook_install but which saves data to own tables and for providing extra features for which there are no tables or fields exists from where information can be fetched.

  • Drupal 5: Table definition and all other required set up for the module
  • Drupal 6, 7: drupal_install_schema('[hook]')

Here is an example of hook_install()

<?php
/**
* Implementation of hook_install
*

Drupal Developer on your mobile phone

Now you can stay connected to Drupal Developer as you go and can access the free Codes and information about Drupal.
Drupal Developer is now available on mobile phone. You can do every thing on Drupal Developer with your mobile phone as you usually do on computer. Try it now let us know what do you think about this new feature.

Drupal module hooks: install file

When Developing a custom module for Drupal, we need to use Drupal APIs and we need to make use of Drupal hooks. There are many Drupal hooks available and different hooks go in different files.

In this section we will learn about all those required hooks which should be written when developing a custom Drupal module.

First we will look at the hooks which are written in .install file.

I'd like to make a note here that don't mistaken the .module as the Drupal module. A Drupal module is consist of one or more .module file, one or more .info file and optionally, one or more .install file.

So, first we look at the hooks in .install file.

hook_install()

  • Drupal 5.x - Table structure and other items like vocabulary and its terms to be used by the module.

Administrator

Advertise

Drupal Developer is offering services with no cost. Its free and will be free. But to maintain and distribute the salary to supporting staff, we need to offer the advertisements feature. By publishing your ads on Drupal Developer, you give a little back to the community. This will encourage us to provide the best resources available for Drupal Development. If you really like our idea and would like to publish your add on Drupal Developer, please use the site contact form and let us know what's on your mind.

Syndicate content

Recent comments

toolbar powered by www.mit3xxx.de