- ability to customize stream headers. (i.e. Day of the week, Date - Time is shown now, no way to change format)
- ability to choose # of days to display in activity stream (or # of items)
- ability to customize stream headers. (i.e. Day of the week, Date - Time is shown now, no way to change format)
- ability to choose # of days to display in activity stream (or # of items)
Comments
Comment #1
akalsey commentedIn the future, please create separate issues for separate requests. This makes it easier to track the requests and ensures that one doesn't fall through the cracks.
- You can now customize the headers via a theme function (in CVS version)
- The module already honors the global drupal settings for how many posts to display.
Comment #2
spiffyd commented@akalsey
Sorry about not separating requests - will do in the future.
About # of posts display, I understand the module honors the global drupal post settings but is there a way to customize # of posts for...
- activity stream page only?
- activity stream blocks only?
Comment #3
akalsey commentedNo, but as Views support leaks in (there's a patch for the 5.x branch -- #266615: Add views support) then you can do that by creating a View.
Comment #4
spiffyd commented@akalsey,
Can you point me in the right direction as to how I can do this?
Comment #5
eojthebraveYou need to override the theme_activitystream_header(&$action)function in your themes template.php file. Read more about it here. http://drupal.org/node/173880#function-override
Comment #6
akalsey commentedWhat you'll want to do is find the function theme_activitystream_header(&$action) and copy it into your template.php. Chagne the name of the function so that "theme_" is renamed to "yourthemename_" and then make whatever changes to the new function you wish. Upload it to your server and you'll be set.
Comment #7
spiffyd commented@eojthebrave, @akalsey,
I cannot find function theme_activitystream_header(&$action) anywhere in any of the activity stream modules. Did you mean function theme_activitystream_item($action) from the activitystream.module? Please advise.
Comment #8
akalsey commentedIn CVS it's line 285.
Comment #9
akalsey commentedIn 6.x Beta 1
Comment #10
spiffyd commentedAs a recent Drupal transplant, I have yet discovered something that I should add to this thread...
Originally, I thought I needed to tweak the module's code to get a customized display of the stream's header's dates and times.
So it turns out Dates/Times can be shown in 3 built in formats: long, medium, short. The formats of each can be customized under "Date and Time" settings (/admin/settings/date-time). The headers in Activity Stream uses the medium format. So instead of tweaking the code, all I simply had to do was alter them in the medium format section in the Date and Times settings page!
Comment #11
spiffyd commentedI am using the Marinelli theme so I added the following to my templates.php. I changed 'medium' to 'short' but I still don't see Activity Stream reflecting the change as it should be...
Suggestions?
Comment #12
akalsey commentedThat should work. Either that or
Comment #13
spiffyd commented@akalsey
I used your phptemplate version and got errors:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'marinelli_activitystream_header' was given in /home2/denislam/public_html/spiffyd/includes/theme.inc on line 597.
Comment #14
spiffyd commented@#12... That doesn't work.
But I tried actually going into the module file and changing...
to...
That didn't change anything either. I also tried clearing browers and Drupal caches. Didn't do anything... Please advise?
Comment #15
spiffyd commentedComment #16
akalsey commentedWorks for me using the latest release.
I created a new site on my dev server with a fresh copy of Drupal 6.4. I downloaded Activity Stream from d.o. I installed Activity Stream and set up my twitter account. Ran cron and verified my twitter updates appeared at /stream.
I copied garland to /sites/all/themes/garlandtest and went to admin/build/themes and made it the default theme. Then I copied the following code to the end of /sites/all/themes/garlandtest/template.php...
I then cleared the cache under admin/settings/performance as described at http://drupal.org/node/173880#theme-registry to rebuild the theme registry.
Loaded /stream again and verified that #### appears before the date.
Comment #17
spiffyd commentedI believe you meant using phptemplate_activitystream_header instead of theme_activitystream_header as that would cause a duplicate function calling and fatal error.
But in any case, yes your modified code will result in the display of "####" in the activity stream. However, the date format still doesn't change if you modify it. Try changing 'medium' to 'short', does your format change? For me, it does nothing. Medium formatting still shows. And I tried doing this in a fresh Drupal 6.4 installation.
You can see how your date/time should be formatted under "Date/Time Settings" -- there are 3 types: short, medium, and long.
Comment #18
eojthebrave"short" is an invalid argument for the format_date function. http://api.drupal.org/api/function/format_date
Try using either 'small', 'medium', or 'large' instead.
Comment #19
akalsey commentedYes, phptemplate_activitystream_header is the correct function name. Pasted the wrong text. Sorry about that.
"Short" isn't a valid date format in Drupal. Your options are "small", "medium", "large", and "custom". Using anything other than one of these four options will result in the medium date being used. Try using "small" instead. The Drupal UI labels this format as "short" but the API calls it "small".
Comment #20
akalsey commentedLooks like my post crossed paths with eojthebrave's.
Closing this issue.
Comment #21
spiffyd commentedWow, can't believe I had this oversight...
Thanks so much eojthebrave.