Hi there,

Thanks for this excellent module. I'm trying to get this to work with a block that I've created for the activity module which shows the (displayed) user's recent activity. The block refresh appears to work with every block supplied by the module ("logged in user's" and "everyone's" recent activity). But for some reason I get a blank slate when the (displayed) user's activity block tries to refresh.

The code for the block has been inserted into the module. Here is the code for the "all activity" block that does refresh:

 case 'all':
          if (user_access('view public activity')) {
            $activity =  activity_get_activity(ACTIVITY_ALL, NULL, variable_get('activity_block_'. $delta, 5) + 1);
            if ($count = count($activity)) {
              drupal_add_css(drupal_get_path('module', 'activity') .'/activity.css');
              if ($count > variable_get('activity_block_'. $delta, 5)) {
                $more_link = theme('activity_more_link', 'activity');
                array_pop($activity);
              }
              $activities = array();
              foreach ($activity as $item) {
                $activities[] = theme('activity', activity_token_replace($item), $item) . activity_delete_link($item);
              }
              return array(
                'subject' => t('Recent activity'),
                'content' => theme('activity_block', $activities)
              );
            }
          }
          break;

And here is the code for the user block that does not refresh:

 case 'user':
            if (user_access('view public activity') && arg(0) == "user" && is_numeric(arg(1))) {
              $uid = arg(1);
              $author = activity_user_load($uid);
              $activity =  activity_get_activity($uid, NULL, variable_get('activity_block_'. $delta, 5) + 1);
              if ($count = count($activity)) {
                drupal_add_css(drupal_get_path('module', 'activity') .'/activity.css');
                if ($count > variable_get('activity_block_'. $delta, 5)) {
                  $more_link = theme('activity_more_link', 'activity');
                  array_pop($activity);
                }
                $activities = array();
                foreach ($activity as $item) {
                  $item['delete-link'] = activity_delete_link($item);
                  $activities[] = theme('activity', activity_token_replace($item), $item);
                }
                return array(
                  'subject' => t("@username's activity", array('@username' => $author->name)),
                  'content' => theme('activity_block', $activities)
                );
              }
            }
            break;

Any help is uber-appreciated.

Comments

pribeh’s picture

K,

I realized that offering you a chance to look at the site might help. Go to http://lc3.figureandground.net/user/2 and look for "thomas cermak's activity" block toward the bottom left. Manual refresh is on.

bocaj’s picture

Status: Active » Closed (won't fix)

Marking as "won't fix" since there has been no activity on this forum in quite some time.

Dublin Drupaller’s picture

Status: Closed (won't fix) » Active

having a similar problem. did you find a fix for this?

Dublin Drupaller’s picture

Version: 5.x-1.x-dev » 6.x-1.0-alpha1

am using 6.x aplha 1

Dublin Drupaller’s picture

Status: Active » Closed (won't fix)

oops. posted this in the wrong place..more likely something to do with activity.module.