I tried the module "onthisdate" of the tutorial.
The module create a block but the block of my new module does not appear in my pages.
Can you help me please.
this is the module :
<?php
function onthisdate_menu() {
$items = array();
$items[] = array('path' => 'onthisdate',
'title' => t('on this date'),
'callback' => '_onthisdate_all',
'access' => user_access('access content'),
'type' => MENU_CALLBACK);
return $items;
}
function _onthisdate_all() {echo "bonjour anis";
} // function _onthisdate_all
function onthisdate_help($section='') {
$output = '';
switch ($section) {
case "admin/modules#description":
$output = t("Displays links to nodes created on this date");
break;
}
return $output;
} // function onthisdate_help
function onthisdate_perm() {
return array('access content', 'access onthisdate', 'administer onthisdate');
} // function onthisdate_perm
function onthisdate_block($op='list', $delta=0) {
// listing of blocks, such as on the admin/block page
if ($op == "list") {
$block[0]["info"] = t("On This Date");
return $block;
} else {
// our block content
// content variable that will be returned for display
$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 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
$queryResult = db_query($query);
while ($links = db_fetch_object($queryResult)) {
$block_content .= l($links->title,'node/'.$links->nid) . '