How can I set up a block with different quotes visible for all users? I'm not interested i different quotes for different users.

Comments

kbahey’s picture

Status: Active » Closed (fixed)

In your sites/all/modules directory, create a directory called "custom", and in it create the following two files:

custom.info

name = Custom
description = Customizations for this web site
package = Custom

custom.module

function custom_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      $blocks[0]['info'] = t('Stock Quote Block');
      return $blocks;

    case 'view':
      $block['subject'] = t('Stock Quote');
      $block['content'] = stock_do_quote('short', 'IBM HP AAPL');

      return $block;
  }
}

Then visit admin/build/block and enable the module.

A second, simpler, but less secure approach is inserting the following php code in a block:

print stock_do_quote('short', 'IBM HP AAPL');