Topic RSS
Thanks for that code, I tried that. If I post in a forum that's only say for select members it still shows in the activity feed in BuddyPress this is my code with your suggestion – http://pastebin.com/qGAE2ds6
@cprpoker I wish my community used my site more, lol Did they just not like it?
Here it is:
function sf_hook_post_save($newpost, $action){global $bp;global $current_user;if ($current_user->sfaccess){// allowed stuff here$activity = new BP_Activity_Activity();$date_recorded = date('Y-m-d H:i:s', strtotime('+6 hours'));$user_fullname = bp_core_get_user_displayname($newpost['userid']);$username = bp_core_get_username($newpost['userid']);$topic_title = sf_get_topic_name_from_id($newpost['topicid']);//$topic_title = $newpost['topic_slug'];$mycontent = $newpost['postcontent'];$max_length = 300;if(strlen($mycontent) > $max_length){$mycontent = substr($mycontent,0,$max_length);$mycontent = $mycontent . ".....";}if ($action=="topic") { $the_action = " created the topic "; } else { $the_action = " posted in the topic "; }$activity = new BP_Activity_Activity ();$activity->user_id = $newpost['userid'];$activity->component = "simplepress";$activity->type = "new_forum_post";$activity->action = ''.$user_fullname.'' . $the_action . '' . $topic_title . ':';$activity->content = $mycontent;$activity->primary_link = $newpost['url'];$activity->secondary_item_id = '';$activity->date_recorded = $date_recorded;$activity->hide_sitewide = 0;$activity->save ();} else {// whoops no access}return;}
Off-Topic: It's actually a struggle just to get them to use the forum itself and even to comment on the blog posts! So BuddyPress just added bells and whistles that were ignored as well. I wanted to scale back and make it as basic as I could.
The reason there is a lack of involvement from my community is that we are a group/league (of poker players) that are centered around Twitter. So that becomes our main communication platform. I am concentrating more on Twitter integration with comments and forum posts instead.
Thanks!
Visit the Twitter Poker Tour Forum to see my Simple-Press implementation
and also,not sure what an activity feed in bp is… obviously, when you post, you have permission to view the forum, so you will pass the check… sounds like I mis understood what you are trying to do… I think you want the permission check on the other side, which you may not be able to do…
so, yeah, understanding better now, I would instead add a check for only the forums that you want to post to bp activity feed…ie
if ($newpost['forumid'] == 1 OR $newpost['forumid'] == 2 etc etc
{
add to feed
} else {
dont add
}
Most Users Ever Online: 444
Currently Online: SPQC, joelrob
56 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
-Radio-: 1251
Lee H: 606
Luffer: 535
Conrad_Farlow: 502
jim: 478
neon: 263
ovizii: 240
Tal: 240
Member Stats:
Guest Posters: 2626
Members: 7363
Moderators: 1
Admins: 2
Forum Stats:
Groups: 5
Forums: 16
Topics: 10898
Posts: 79583
Newest Members: Rick Thomas, joelrob, ndc, MacBravO, irlandes1, triphop, betokan, Jonathan Yovani Muñoz, somosguatemala, ahcreate
Moderators: Brandon C (162)
Administrators: Yellow Swordfish (22240), Mr Papa (23688)
Log In
Register
Home
Add Reply
Add Topic
Offline




Quote

Visit 

Privacy Policy



