i've added a block which shows the activity for a particular user, as well as the site-wide activity streams.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | users_stream.patch | 1.3 KB | George2 |
| users_stream.patch | 1.29 KB | George2 |
i've added a block which shows the activity for a particular user, as well as the site-wide activity streams.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | users_stream.patch | 1.3 KB | George2 |
| users_stream.patch | 1.29 KB | George2 |
Comments
Comment #1
akalsey commentedLooks good. I'd suggesting using the activitystream_user_load() function instead of user_load. The module loads user details quite often and user_load() isn't cached. For this reason, the module provides activitystream_user_load() as a wrapper around user_load().
In the case of this patch, we'd only need to call user_load once instead of twice.
It takes one parameter, a uid, and returns the user object for that uid.
Comment #2
George2 commentedComment #3
George2 commentedComment #4
akalsey commentedApplied to 6.x-2.0
Comment #5
pribeh commentedK, last time I'm asking for help porting stuff back to good old Drupal 5. I'm trying to get this working with 5.x-1.3 (along with panels and APK). I've managed to patch "hook_block()" in D5 AS with the patch here (almost) successfully. I've selected the block to be shown on user profiles (via panels interface) and I get the following error message whilst viewing a user profile:
warning: Missing argument 1 for arg(), called in activitymodule on line 793 - which is:
.. defined in /includes/path.inc on line 148 - which is:
I promise, last time. If you'd like me to file this as a separate issue I will.
Comment #6
George2 commentedyou've got your problem (and answer) right there - in 5, arg() demands an argument and only returns one part of q, unlike 6.
so, use the value of $_GET['q'] just like the function and explode, just like that function
Comment #7
pribeh commentedThanks for helping George,
I figured that out by looking through my php book, threw $_GET['q] inside the brackets, which fixed the error message but I still don't get a block appearing on profile pages. Sorry, I'm horrible at php still. What am I doing wrong? Here's what my hook_block looks like:
Comment #8
George2 commentedi think it's best to start up a new issue, and if you're new to php, maybe you shouldn't be working on a module yet ;)