How can I set "Show NewBlogPosts" as default on acitivity-stream?
-
I have the activity as home.
How can I set the “Show new BlogPosts” instead of “No filter” as default?
Thanks for help.
-
Nobody ?
Guillaume – To the best of my knowledge, bp_get_activities does not currently support multiple arguments like you’d like it to.
ok i got my hands dirty and went in.. went in deeep !
Found out that multiple args are in fact supported. I used the following query with the function @boone provided above to show only activity updates and new members
$query_string .= ‘&type=activity_update,new_member&action=activity_update,new_member’;Now i dont know what exactly is “type” so i just duplicated whats on “action” to it as i couldn’t find any reference to it in the code or maybe i missed it?
Hope this help some one
Thanks
Cool, I’m glad to be wrong about this one!
@brainwaves
Certainly was a help, thanks! Had been playing with this aspect yesterday trying to use activity-loop.php to control different page views for the main activity loop but this aspect had alluded me.So it’s possible to do:
if ( bp_has_activities( bp_ajax_querystring( ‘activity’ ).’per_page=14&action=activity_update,new_blog_comment’));
which works nicely.I had worked out the per_page concatonation but thought it not possible to have more than one action.
For reference this also provides me with control over the activity loop pulled into the index page:
<?php if(bp_is_front_page()): ?>
<?php bp_has_activities(‘per_page=6’); ?>
<?php endif; ?>@brainwaves
You’re my hero. Thanks !Other question. Is it possible to do the same thing for groups activity ? And for users activity ?
Glad i could help
@guigoz: all of the following support multiple arguments (this is right out of the bp-activity.php – line 577)
* ‘user_id’ => false, // user_id to filter on
* ‘object’ => false, // object to filter on e.g. groups, profile, status, friends
* ‘action’ => false, // action to filter on e.g. activity_update, profile_updated
* ‘primary_id’ => false, // object ID to filter on e.g. a group_id or forum_id or blog_id etc.
* ‘secondary_id’ => false, // secondary object ID to filter on e.g. a post_idI’ve spent a few hours playing around with BP based on info in this thread but am having some trouble. Does anyone know how to make it so that only updates from the group admin appear in the “Activity” feed?
Thanks
any help with how to do this so only status updates from the group admin show in the activity feed for the groups?
Thanks
hi is there a way to edit this code so it does the same thing but for the group activity page?
i ‘ve success change buddypress activity stream default option with multiple option, you just put this in functions.php in your theme.
function blog_posts_by_default( $query_string ) {
global $bp;
if ( !$query_string )
$query_string = ”;
if ( ($bp->current_component == BP_ACTIVITY_SLUG || !$bp->current_component) && !strpos($query_string, ‘type=’)){
if ( strpos( $query_string, ‘action’ ) == 0 )
$query_string .= ‘type=activity_update,new_blog_post,new_blog_comment,new_forum_post&action=activity_update,new_blog_post,new_blog_comment,new_forum_post’;
}
return $query_string;
}
add_filter( ‘bp_dtheme_ajax_querystring’, ‘blog_posts_by_default’ );you can see the result here: http://blog.uin-malang.ac.id
i hope it run well in your site..@boonebgorges Thank you very much for your help. I looked for days to get a working solution, but couldn’t get it work like you did!
Bookmark post
Thanks Evey body for all your help, this is what i needed and after a day of “WHY GOD WHY’s”
It works!
Great Functions!!! i have been looking for it. only thing i am trying to do now is to use the function only when under friends activity. so in groups activity and Favorites “no filter” will be normal.
i was trying something like that :function blog_posts_by_default( $query_string ) {
global $bp;
if ( !$query_string )
$query_string = ”;if ( ($bp->current_component == BP_ACTIVITY_SLUG . ‘/’ . BP_FRIENDS_SLUG . ‘/’ || !$bp->current_component) ) {
if ( strpos( $query_string, ‘action’ ) == 0 )
$query_string .= ‘&action=activity_update,new_member&scope=groups,friends,profile’;
}return $query_string;
}
add_filter( ‘bp_dtheme_ajax_querystring’, ‘blog_posts_by_default’ );and i tried many other ways but all gave the same results.
WHAT’S A FILTER?…oH..nOT ANYTHING… jUST A PLUG…
CAN YOU FIND OUT WHICH ONE IS BEST FORSUPPOSE YOU IMPORTED A
COMPUTER
DOES THAT HELP TO NOT …. WELL DOWNLOAD TWO APPS.wohooo this thread is awesome! @boonebgorges you are also my hero!
Any idea on how to tweak the code to work for groups too? To show only the updates.
- The topic ‘How can I set "Show NewBlogPosts" as default on acitivity-stream?’ is closed to new replies.