i just developed my own module let's say "test" and i want this module to select all users that i have on drupal and display it on my page say "page1" so,i created test.module that contains:

test.module
**********
<?

function test_menu()
{
$items[]=array();
$items[]=array(
'path' =>'node/10', // "this is the page that i want to display result on it"
'title'=>t("this is test module"),
'description'=> t("Here is the test module"),
'page callback'=>'drupal_get_form',
'page arguments'=>'test_settings',
'access'=>user_access('access administration page'),
'type'=>MENU_CALLBACK,);

return $items;
}

function test_settings()
{
drupal_set_message(t("hello test module"));
}

?>

and test.install
************


function test_install() 
{
      $q=db_query("select * from users");
	  
	  while($arr=db_fetch_array($q))
	  {
		
<?
foreach($arr as $value)
{
?>

<?

}
}

}

function test_uninstall()
{

print "No data is available";

}

?>

and test.info
**********
name = test
description = Enables keeping easily and regularly updated user web pages or blogs.

version = VERSION
core = 6.x

; Information added by drupal.org packaging script on 2009-05-13
version = "6.12"
project = "drupal"
datestamp = "1242243950"

then ,i can see the test module and check that i want to enable it but,when i go to menu section i canot find it and i didnot find the list of users in page that i spacify..........so what is the expected problem..?

thanks for ur time

<? echo $row[0];?> <? echo $row[1];?>

Comments

mradcliffe’s picture

Your hook_menu follows Drupal 5 specification yet you are developing for Drupal 6.

amira’s picture

so,could u tell me what i can do..?

marcvangend’s picture

Have a look at http://api.drupal.org/api/function/page_example_menu/6, in particular the hook_menu implementation.

amira’s picture

have the same problem ....i can't get the test module under menu items and nothing happened new :S:S

any help.....

marcvangend’s picture

Can you please provide more information? What exactly did you do? What did you expect? What happened? What did you try? Show us your code...
See http://drupal.org/node/19279 for useful tip on reporting bugs.

amira’s picture

i just developed my own module let's say "test" and i want this module to select all users that i have on drupal and display it on my page say "page1" so,i created test.module that contains:

test.module
**********
<?

function test_menu()
{
$items[]=array();
$items[]=array(
'path' =>'node/10', // "this is the page that i want to display result on it"
'title'=>t("this is test module"),
'description'=> t("Here is the test module"),
'page callback'=>'drupal_get_form',
'page arguments'=>'test_settings',
'access'=>user_access('access administration page'),
'type'=>MENU_CALLBACK,);

return $items;
}

function test_settings()
{
drupal_set_message(t("hello test module"));
}

?>

and test.install
************

function test_install() 
{
      $q=db_query("select * from users");
      
      while($arr=db_fetch_array($q))
      {
        

<?
foreach($arr as $value)
{
?>

<? echo $row[0];?>
<? echo $row[1];?>

<?

}
}

}

function test_uninstall()
{

print "No data is available";

}

?>

and test.info
**********
name = test
description = Enables keeping easily and regularly updated user web pages or blogs.

version = VERSION
core = 6.x

; Information added by drupal.org packaging script on 2009-05-13
version = "6.12"
project = "drupal"
datestamp = "1242243950"

then ,i can see the test module and check that i want to enable it but,when i go to menu section i canot find it and i didnot find the list of users in page that i spacify..........so what is the expected problem..?

thanks for ur time

rightchoice2c_me’s picture

Go through the below link.
Module Creation

BTW do you know for what we use .install file???

marcvangend’s picture

When posting code, please wrap it it <code>...</code>.

morthylla’s picture

I don't know if you read the documentation already, but the problem of your code is that the hook_menu in Drupal 6 (i.e. the test_menu function) should not be constructed the way you did it. Follow the documentation links at the other comments and your code will work. :)