I'm currently displaying an activity feed on my user profiles using the activity_table function as specified in another thread on here.

It returns a two-column table with dates on the left and the activity on the right.

How do I get rid of the date column? I've tried looking at the module code to see if there's a line I can comment out, but I'm not sure what the heck that would be. Pleas advise. Thanks!

Comments

sirkitree’s picture

call activity_get_activity() and format the results as you see fit.

bflora’s picture

Uh, how? I don't see a handbook for the module explaining how I should format it. Are there parameters I should put in the function call that wil get rid of the dates?

jaydub’s picture

Version: 5.x-3.0-beta2 » 5.x-4.x-dev
Component: Code » User interface
Category: support » task

add more themeable elements

liliplanet’s picture

Hi,

I'm trying to show the user-profile picture instead of the date and the following works, yet the picture is the default profile picture (so they all the same) ..

In activity.module I added:

theme('user_picture', $this_user),

function theme_activity_table($activities) {
  global $user;

  $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)) {
      $rows[] = array(
       theme('user_picture', $this_user),
        theme('activity', $activity_message, $activity),
      );
    }
  }
  $output = theme('table', $display_headers, $rows);
  $output .= theme('pager');
  return $output;
}

Any ideas please?

Look forward to any reply.
Lilian

jaydub’s picture

If you are using the 5.4 branch which is where active development is focused then you don't have to modify the theme_activity_table function directly but rather you should override the theme function in your theme. I don't know whether or not you are familiar with the drupal theming system so I won't get into specifics of how to do this except to link to the theme documentation.

You can see this thread for more details specific to Activity:

http://drupal.org/node/323380#comment-1075140

http://drupal.org/theme-guide

And specifically for theme override concepts:

http://drupal.org/node/173880

jaydub’s picture

By the way you have this code:

theme('user_picture', $this_user),

but the variable $this_user is not set anywhere so you would never get any result -other- than the default picture since $this_user provides no user context.

jaydub’s picture

Category: task » support
sirkitree’s picture

Status: Active » Closed (fixed)

Closed for a month of inactivity.