Custom made blocks not getting displayed in Blocks page I am new to Drupal. I tried to write custom module(Sample).. After completion of Module, Enabled at Module. But it is not showing at Block Page.

Please check the below code and correct me..

first.info

;$Id$

name = First
description = A first module.
package = Drupal 7 Development
core = 7.x
files[] = first.module

;dependencies[] = autoload
;php = 5.2


first.module

function first_block($op = 'list', $delta = 0, $edit = array()){
    switch ($op) {
       case 'list':
        $block = array();
        //List out all blocks you want to create here
        $block[0]["info"] = t('Display info'); 
        return $block; 
       case 'view':    
        switch ($delta) {
          case 0:
            $block['subject'] = "ADMIN Header of the block";
            global $user;
            if(in_array('Site admin', array_values($user-&gt;roles) || $user-&gt;uid == 1)) {
              $block['content'] = "input form";
              $block['subject'] = "Header of the block";
            }    
            return $block;
        }
    }           
}
Did you try to (steps in order):


use a minimal hook_block_info() definition for your block (such as
the one below or even without 'cache' option!) the very first time?
manually remove your block's entries in block table, if any? 
then clean all caches?


Longer version of why these steps may help:

Using a minimal block definition such:

function sso_block_info() {
  $blocks['applinks'] = array(
    'info'   =&gt; t('Single Sign On'),
    'cache'  =&gt; DRUPAL_NO_CACHE, // this can also be left out!
  );
  return $blocks;
}


Would not list my block in the "Disabled" pseudo-region of admin/structure/block!

Troubleshooting revealed that block had been inserted in block table, but its value for the region column was blank and not the usual '-1' that every other currently disabled block contained! 

Tip: updating this value to -1 directly within DB made block 'Single Sign On' show up in block admin's Disabled zone instantly!

Then I manually removed my block's entries from DB and cleaned caches to effect Drupal calling again hook_block_info. This time my block showed up correctly in block admin UI the first time!

My hunch is that existing config entries in DB for blocks will sometimes interfere with what is indeed correct block registration code! Cache clearing will not affect entries in block table! I guess that certain perhaps invalid combinations of options in hook_block_info() will cause D7 to register a block with a blank value for the region (a block appears in) instead of -1 (a disabled block).