Hi.
i'm new to development and trying to figure out how to add custom functionallity to drupal via custom modules.Although i dont think there's not another module outthere that do what you want to build ;) . . . So basically what i want to know is this->
if i build a custom module lets say. sms i must do the following for a start.
1. ( Directory Structure )
create a sites/all/modules/sms* folder
add a sms.info file and a sms*.module file.
If i want to add more code it's a good practice to add sms*.inc.file inside the sms folder.

I'll skip the details of the info file . . . . :)
2. ( hook_and_other_drupal_language ) inside my sms.module file
Add for the menu.

function sms*_menu(){
$items['sms*']=array(
'page callback' => 'sms*_send_message',
'access callback' => TRUE ,
'type' => MENU_CALLBACK
) ;

function sms*_send_message(){
$global user;
$this_user=$user->uid;
etc . . .
etc . . . .

}

so . . . these're the typical 'naming' rures for getting it right?Or am i missing something?

*====> this is because i gave the name 'sms' for my module.

Comments

cliffsmith-cio’s picture

You're correct that you implement a Drupal hook by naming your function MODULENAME_HOOKNAME(). The code you've included in your post is more or less on target, assuming you're doing return $items; at the end of your hook_menu() implementation.

Posting your .info and .module files will help if you're having trouble with a specific module you're working on.

nikitas’s picture

yes. . . u're right i forgot to write the return $items; . . .
p.s : For the moment i'm just in the process of learning so i'm avoiding specif module files etc.When i think i'm on 'steady' version . . . i'll upload my code for checking!if anyone is interested ;) . . .