drupal 6

Customise block.tpl.php

The default block.tpl.php resides at:

  modules/system/block.tpl.php

This can be copied and placed within the 'theme' directory. Afterwhich, this version will be used.

Customise block.tpl.php by block

To make specific to a particular block simply include the 'blockname' as follows: block-blockname.tpl.php.

e.g. block-views-news-block_1.tpl.php

Customise block.tpl.php by Region

To make specific to a region where the block is located simply include the 'region' as follows: block-region.tpl.php.

Create variable for use within page.tpl.php

Within the template.php file add something like below:

function phptemplate_preprocess_page(&$vars) {
  $vars['random_descriptor'] = rand(1,2);
  $vars['sample_variable'] = t('Lorem ipsum.');
  $vars['random_key_message'] = rand(1,3);
  $vars['faq_terms'] = theme('links', $variables['taxonomy'], array('class' => 'links inline'));
  // To remove a class from $classes_array, use array_diff().
  //$vars['classes_array'] = array_diff($vars['classes_array'], array('class-to-remove'));
}

Then within the page.tpl.php add something like below: