Closed (outdated)
Project:
Activity
Version:
6.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
10 Mar 2009 at 06:57 UTC
Updated:
29 Oct 2025 at 14:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sirkitree commentedWe don't currently have a block for this, but there is a way you can do this easily if you look at the code implemented within hook_user()
This basically retrieve's all activity for the current user whose profile you are viewing and shows it. You could just as easily put this in a hook_block() and in the line
$activities = activity_get_activity($account->uid, NULL, variable_get('activity_user_profile_records', 5));you would use$user->uidinstead of$account->uidafter declaringglobal $userSo in short you can paste something like this into your site's custom module: (not tested)
Comment #2
bflora commentedHow can I do this by just adding some code to my profile page template? I don't want to create another module or mess around with drupal hooks.
I'm currently trying to use this code:
Where arg(1) is the current profile page's UID.
But this isn't working. What am I doing wrong? All it shows me is "Array" instead of the activity feed. Thanks.
Comment #3
sirkitree commentedIn a core profile system (no mods to the profile) it should already show up. that is what hook_user(), case view does.
Have you modified your user profiles with another module?
As for your code above, if you print_r($activities), that should work. But you don't want to print_r the theme function that you're passing $activities into as the theme function does not return an array.
Comment #4
socialnicheguru commentedcould this be an option as part of the Activity module?
Facebook status gives you a similar capability to see the status of the person you are viewing. That makes a lot of sense.
Comment #5
bflora commentedI've got a production site with 1000 registered users. The user profiles were written by hand to make sure they do what they need to do.
So I need to find a way to get the activity for a profile to appear on them using custom code.
Good point about the print_r. I only had that in there to see if I could see what was wrong.
The problem with that code I posted above is that all it returns is "array()"
How do I get it ot return the actual activity?
Is there different code I should use?
Comment #6
jaydub commentedrelated issue: #373480: My activity block: Can it also display activity of person whose profile i am viewing
Comment #7
jaydub commentedOk how about someone try this patch which adds a new block for viewing activity for the user you are currently viewing.
this is for the 6.1 branch against the latest -dev snapshot.
Comment #8
dropchew commentedWith the above patch,
1)eg, if visitor comments on a node, its will be recorded as 'you' commented on the node and not 'visitor' when viewing as a visitor
2)eg, if a member change his status (facebook style status module), when viewing as a visitor, it will be recorded as 'you' and not the member's name.
So far these are my findings. Thanks.
Comment #9
jaydub commented#1 - don't see this behaviour. Can you detail exactly what steps you took to get this result?
#2 - fbstatus module is maintained outside of Activity and likely needs to have its support
for Activity updated as there have been a lot of changes on our end.
Comment #10
jaydub commentedThe patch from #7 was committed to CVS. Please try a -dev release to try out this block.
Comment #11
pribeh commentedAny update for the 5.4 implementation of this? Thanks so much.
Comment #12
jaydub commentedRight now the 6.x branch has a lot more users than 5.x so we're looking to make sure that features are working in the 6.x branch before considering porting to 5.4. I highly encourage you to play with a 6.1-dev snapshot as 6.1.x and on into the future 6.2.x will be the primary focus of development.
Comment #13
pribeh commentedThanks jaydub. Unfortunately, the site I'm working that heavily uses activity will be in five for awhile until various other modules (panels and APK in particular) become stable for 6.
Comment #14
pribeh commentedOK, so I went ahead and just inserted the following
$block['user']['info'] = t("Activity (User): show activity of the user being viewed");and
in 5.x-4.x under hook_block() the same way it appears in the 6 dev version.
Everything works pretty much. The only issue I have, which is a half blessing, is that, having put this block in my APK (user) panel (with bio), it shows comments made on the profile [edit: or any node made by displayed user] by other users as well as every activity made by the user - and nothing else. Since I'm not using core do comments made by other users on nodes by the user (who's profile is being viewed) get shown? I like it even if it's not supposed to happen. The only thing is that simply displays "user commented on user" without the other tokens I've setup for comments like "saying [comment...". All other comments display properly except the one shown in this block made on the node profile by other users.
Comment #15
pribeh commentedAnother bug I have is that when using block refresh (http://drupal.org/project/block_refresh) the block refreshes a blank slate unlike the rest of the activity blocks which seem to pull in fresh data fine.
Comment #16
jaydub commentedThat module doesn't exist for Drupal 6 so I'm afraid I can't really assess why the feature in this issue doesn't work for you. I encourage you to delve into block_refresh and see how it works and post your results here.
Comment #17
pribeh commentedYup will do.
Comment #18
jaydub commentedThe original issue request is in CVS now. For the poster in #15 you can open a new issue although keep in mind that there is no d5 implementation of this yet and since your problem with block_refresh is on a d5 module it might not get addressed.
Comment #19
patchak commentedI saw that activity module now has views integration, so is there a way that I can actually reproduce this kind of functionnality using the views integration??
Not sure this is possible tho...
Patchak
Comment #20
sirkitree commentedIt should be possible now, yes. The basic idea would be to give your Activity view a uid argument, or filter.
If anyone tries this out please report back and give us a recipe - I'd like to start a handbook page of different Views that people can plug into their sites. Thanks!
Comment #21
nitram079 commentedhere is the view I have created (6.x-2.x-dev on drupal 6.14 with latest dev of views). It does the job and can be included e.g. in panels on user profiles
Comment #22
jcisio commentedChange to 2.x as per #21.
The views #21 includes info from the panel_pane plugin, which it shouldn't. I created a similar views, too, but there is also activity_comment. I don't know how to export a minimal view, neither.
Comment #23
rjbrown99 commentedThe patch in this issue seems to be in #7, and a follow up note in #10 states that it was committed. It seems that the main issue here was addressed, and at 14 months out from the last update I'm rolling the status to fixed.
Comment #24
jcisio commentedHum, it is fixed in 1.x. Is it fixed in 2.x? Currently in 2.x we need a default view, which is not available yet.
Comment #25
_shyD6 reached its EOL back in February 2016, and there is no active release for D6 for this module anymore.
Development or support is not planned for D6. All D6-related issues are marked as outdated in a bunch.
If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.
Thanks!