Need Help moving image location in the "activity" module

boon4376 - October 31, 2009 - 18:44

I have added [author-picture] to the activity module, and I am trying to make my activity area look more like facebooks. I've succeeded in most respects by using CSS, however i do not know how to actually get the image to move into a different spot. It only appears on its own row. I would like it to rather appear in its own column.

I have tried altering the module like they do on this page (at the bottom) http://drupal.org/node/353445 but it doesn't seem to change anything.

=-=

VM - October 31, 2009 - 18:49

you may have to look in the .module file and locate the theme funtion. Move it to a template.php and alter as needed.

ok so I commented out the

boon4376 - October 31, 2009 - 19:11

ok so I commented out the function in the .module and copied it to my template.php file... here is the code as it is instructed on the link I posted in the original topic

<?php
>
function
theme_activity_table($activities) {
 
$display_headers = array(
   
'created' => array('field' => 'created', 'data' => t('Date')),
   
t('Message'),
  );

 
$rows = array();
  foreach (
$activities as $activity) {
    if (
$activity_message = activity_token_replace($activity)) {
     
$activity['delete-link'] = activity_delete_link($activity);
     
$row = array(
        array(
'data' => theme('activity_timestamp', $activity['created']), 'class' => 'activity-table-timestamp'),
        array(
'data' => theme('activity', $activity_message, $activity), 'class' => 'activity-table-message'),
        array(
'data' => theme('activity_user_picture', activity_user_load($activity['uid'])), 'class' => 'activity-table-user-picture'), // I added this line
     
);
     
$rows[] = $row;
    }
  }
 
$output = theme('table', $display_headers, $rows, array('class' => 'activity-table'));
 
$output .= theme('pager');
  return
$output;
}
?>

Still my code changes don't seem to do anything

=-=

VM - October 31, 2009 - 19:48

you don't comment out the function in the module. it gets overridden when the theme layer finds the same function. Commenting it out in the .module file won't allow drupal to know what to do with the altered one, I'd think.

The function above requires the name of your theme in the function, I believe. (I'll look for specific documentation and link here)

Ensure to clear your theme registry after altering template.php for the change so take effect per documentation.

When i did it without

boon4376 - November 1, 2009 - 04:10

When i did it without commenting I got an error that something had already been declared.

Wow i feel so stupid... I

boon4376 - November 1, 2009 - 21:42

Wow i feel so stupid... I was doing it correctly all along, except I was modifying it for the page display instead of the block display.

(i have the block as a panel in the users profile)

New question now... This is

boon4376 - November 1, 2009 - 21:59

New question now...

This is the code for the block display

<?php
/**
* Theme function for displaying an activity block on a user profile.
*/
function theme_activity_user_profile_activity($activities) {
  if (
$content = theme('item_list', $activities, NULL, 'ul', array('class' => 'activity-list'))) {
    return
$content;
  }
}
?>

How do I add the author picture to this display

 
 

Drupal is a registered trademark of Dries Buytaert.