footer block through custom module and fetch node image field in Drupal 7 I want to create footer block through custom module and want to add five images through node.Five images should change one by one after one hour.

Can anybody tell me how to do this ?

&lt;?php


function chat_block_info() {
  $blocks['chat_footer'] = array(
    'info' =&gt; t(' FOOTER'),
    'cache' =&gt; DRUPAL_CACHE_GLOBAL,
  ); 
  return $blocks;
}

function chat_block_view($delta = '') {
  $block = array();

  switch($delta) {

    case 'chat_footer' :
      $block['chat_footer'] = array(
        '#markup' =&gt; chat_footer_block('footer'),
      );
      break;
  }
  return $block;
}

function chat_footer_block($parm) {
 if ($param == 'footer')
 {
   $node = node_load(11111);
    $uri_top = $node-&gt;field_footer_image['und'][0]['uri']; 
    $alt_top =$node-&gt;field_footer_image['und'][0]['alt'];
   $image_top = theme('image_style', array('style_name' =&gt; $footer_chat,
        'path' =&gt; $uri_top,
        'getsize' =&gt; TRUE,
        'alt' =&gt; $alt_top,
        'title' =&gt; "IMG"
      ));

}

}
To accomplish this I would probably use a combination of hook_cron() to check in every hour, persistent variables to track the last loaded image (see variable_set and variable_get) and the great Ajax Blocks module so that your block is refreshed without having to rebuild the entire page each time.