<?php
// $Id$
/**
* @file
* Implements block for showing archives, user picture, and links for blog sidebars.
*/
function blog_sidebar_block
($op =
'list',
$delta =
0,
$edit =
array()) {
switch ($op) {
case 'list':
$blocks[0]['info'] = t('Additional blog information');
return $blocks;
case 'view':
if ($node->type == 'blog') {
$block['subject'] = t('About the author');
$block['content'] =
$node->
type .
theme('bloginfo',
$author);
// do whatever you want to create the content of your block using $node and $author
// ...
return $block;
}
else {
$block['subject'] = t('Type error');
$block['content'] = $node->type;
return $block; // you want to make sure this block is not displayed on other pages.
}
}
}
}
function theme_bloginfo($author) {
$user_pic = $base_path . $author->picture;
return '<img src="http://localhost/' . $user_pic . '">';
}