Ho creato il mio primo modulo con l'aiuto del manuale in inglese con drupal 4.7.
Il nodo è tipo quello che c'è in questo sito per il forum che visualizza gli ultimi argomenti.
Ecco il modulo da me creato visualizza i nodi creati l'ultima settimana.
crea un blocco come quello che c'è qui sulla sinistra e se clicco su i vari link mi mostra i nodi nel content.
Funziona correttamente l'unica cosa è che se clicco su leggi tutto non mi trova il nodo.
Praticamente la pagina 'q=lastweekposts' non esiste.
come mai? non riesco a capirlo.
ho anche controllato le differenze tra 4.6 e 4.7 ma non trovo l'errore
vi passo il codice cosi capite meglio e potete capire dove sbaglio.

function lastweekposts_help($section='')
{
   $output = '';
    switch ($section)
    {
     case "admin/modules#description":
    $output = t("Mostra i link dei nodi creati l'ultima settimana'");
    break;
case "admin/help#lastweekposts":
    $output = t("ora ti spiego:questo modulo mostra i link creati da te o da altri l'ultima settimana");   
    break;
    }
   return $output;
}


function lastweekposts_perm()
{
return array('acces content','acceslastweekposts','admister lastweekposts');
}

function lastweekposts_menu()
{
$item = array();
$item[] = array('path' => 'lastweekposts',
                'title' => t('lastweekposts'),
'callback' => '_lastweekposts_all',
'acces' => user_access('access content'),'type' => MENU_CALLBACK); 
    return $items;
}

function lastweekposts_block($op='list',$delta=0) {
if ($op=="list") {
  $blocks[0]["info"] = t('Last Week Posts');
  return $blocks;
} else if ($op=="view" && user_access('access lastweekposts')) {
          switch ($delta) {
           case 0 :
          $block['subject'] = 'Last Week Posts';
      $block['content'] = _lastweekposts_block_content();
   break;
  }
  return $block;
       }
}

function _lastweekposts_block_content() {
   $block_content = '';
    // Get today's date
   $today = getdate();
    // calculate midnight one week ago
   $start_time = mktime(0, 0, 0,$today['mon'],($today['mday'] - 7), $today['year']);
    // we want items that occur only during the last week, so calculate 7 days
   $end_time = $start_time + 604800;
    // 60 * 60 * 24 * 7= 604800 seconds in a week
   $limitnum = variable_get("lastweekposts_maxdisp", 5);
   $query = "SELECT nid, title, created FROM " . "{node} WHERE created >= '" . $start_time ."' AND created <= '". $end_time . "' LIMIT " . $limitnum;
    // get the links
   $queryResult = db_query($query);
   while ($links = db_fetch_object($queryResult)) {
        $block_content .= l($links->title, 'node/'.$links->nid) .'</a><br>';
   }
    // add in our block a 'more' link that displays the page with all the links
   $block_content .= "<div class=\"more-link\">".l(t("more"), "lastweekposts", array("title" => t("More posts.")))."</div>";
     // check to see if there was any content before setting up the block
    if ($block_content == '') {
     // no content from a week ago, return nothing.
         return;
    } else {
          return $block_content;
      }
}

function lastweekposts_settings() {
     // only administrators can access this module
    if (!user_access("admin lastweekposts")) {
      return message_access();
    }
   $form['lastweekposts_maxdisp'] = array('#type'=>'textfield',
                '#title'=>t('Maximum number of links'),
'#default_value'=>variable_get("lastweekposts_maxdisp", "5"),
'#description' => t("The maximum number of links to display in the block."),
'#maxlength'=>2,
'#size'=>2               
                        );
          
    return $form;
}





function _lastweekposts_all(){
  // content variable that will be returned for display
  $page_content = '';

  // Get today's date
  $today = getdate();

  // calculate midnight one week ago
  $start_time = mktime(0, 0, 0, $today['mon'], ($today['mday'] - 7), $today['year']);

  // we want items that occur only on the day in question,
  // so calculate 1 day
  $end_time = $start_time + 86400;
  // 60 * 60 * 24 = 86400 seconds in a day

  $query = "SELECT nid, title, created FROM " .
           "{node} WHERE created >= '" . $start_time .
           "' AND created <= '". $end_time . "'";

  // get the links (no range limit here)
  $queryResult =  db_query($query);
  while ($links = db_fetch_object($queryResult)) {
    $page_content .= l($links->title, 'node/'.$links->nid).'<br />';
  }
   if ($page_content == '') {
    // no content from a week ago, let the user know
    $page_content = "No events occurred on this site on this date in history.";
   }

  return $page_content;
}

QUALCUNO PUO' AIUTARMI?

L'amore porta amore credo