Closed (fixed)
Project:
Digg this
Version:
master
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Anonymous (not verified)
Created:
29 May 2008 at 19:49 UTC
Updated:
17 May 2020 at 12:23 UTC
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
Comment #1
yaph commentedThanks for the code. I'll add it to the next release.
Comment #2
yaph commentedAdded a block in CVS HEAD.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.