i am trying to create a theme overide to allow an image cache preset to display in a submodules comment area.

I have tried numerous time to theme override function correctly, but have been unsuccessful and need some help.

below is the code I have been directed to use. user_picture resolves fine, but I would like to use an imagecache preset I have named user_image_thumbnail.

But like I said no matter how I code it, it does not resolve to the image cache preset I am trying to define.

any help with how exactly this should be displayed would be greatly appreciated.

/**
* Formats a comment.
*
* @param $comment
* The comment object.
* @param $classes
* An array of extra classes to include in the comment status wrapper div.
* @param $destination
* The destination query string for edit and delete links. Usually the current
* page unless this function is called from a JavaScript callback page.
* @return
* The fully themed status comment or FALSE if the current user does not have
* permission to view the comment.
*/
function theme_fbssc_item($comment, $classes = array(), $destination = '') {
if (!fbssc_can_view($comment)) {
return FALSE;
}
$author = user_load(array('uid' => $comment->uid));
array_unshift($classes, 'fbssc_comment');
$classes = implode(' ', $classes);
$output = '';
$output .= ''. theme('user_picture', $author) .''; //This is line where the picture is added
$output .= ''. theme('username', $author) .'';
$comment_text = _facebook_status_run_filter($comment->comment);
$comment_text = nl2br($comment_text);
$output .= ''. $comment_text .'';
$output .= '';
$output .= ''. theme('facebook_status_time', $comment->comment_time) .'';
$q = $_GET['q'];
if ($destination) {
$q = $destination;
}
elseif (strpos($q, 'fbssc/js') !== FALSE) {
$q = '';
}
if (fbssc_can_edit($comment)) {
$output .= ''.
l(t('Edit'), 'statuses/comment/'. $comment->cid .'/edit', array('query' => array('destination' => $q)))
.'';
}
if (fbssc_can_delete($comment)) {
$output .= ''.
l(t('Delete'), 'statuses/comment/'. $comment->cid .'/delete', array('query' => array('destination' => $q)))
.'';
}
$output .= '';
//Invokes hook_fbssc_render_alter(&$output, $comment).
drupal_alter('fbssc_render', $output, $comment);
return $output;
}

Comments

glitz’s picture

Im close but cant get it...

if i use this line:

$output .= ''. theme('user_picture', $author') .''; //This is line where the picture is added

it shows the users picture I want but using the default size (very large)

and if I use this:

$output .= ''. theme('user_picture', $user') .''; //This is line where the picture is added

This gives me the right image cache size but all of the pictures are of an anonymous user.

How can I apply the correct image size (used in $user) but pull the picture from $author?

THANKS!

glitz’s picture

Project:ImageCache Profiles» ImageCache
Version:6.x-1.3» 6.x-2.0-beta9
glitz’s picture

Project:ImageCache» ImageCache Profiles
Version:6.x-2.0-beta9» 6.x-1.3
glitz’s picture

????