Hello,

I've implemented a _block function for the Digg This module on my local version. No need to change any code, just add the following function.

function diggthis_block($op = 'list', $delta = 0, $edit = array()) {
    $blocks = array();

    switch ( $op ) {
        case 'list':
            $blocks[0] = array(
                'info' => t('Digg This'),
                'weight' => 0,
            );
            break;

        case 'view': default:
            // If $op is "view", then we need to generate the block for display
            if ( arg(0) == "node" && is_numeric(arg(1)) ) {
                // Load the node information
                $node = node_load(arg(1));
                $blocks['content'] = theme('diggthis_button', $node);
                $blocks['subject'] = variable_get('diggthis_block_title_'.$delta, t("Digg"));
            }
            break;
      }
      return $blocks;
}

This allows you to place the Digg button any place where a block may be added, in case you don't want it to appear in the node content. To avoid the button from appearing twice, you can uncheck all the node types on the Digg This settings page (admin/settings/diggthis).

Comments

yaph’s picture

Assigned: Unassigned » yaph

Thanks for the code. I'll add it to the next release.

yaph’s picture

Status: Needs review » Fixed

Added a block in CVS HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.