A A A

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Integrating Simple:Press into BuddyPress Activity Stream
Aug 13, 2010
3:04 pm

SP Master
Forum Posts: 23688
Member Since:
Dec 10, 2006
Offline

at least you left the important two there! Wink Cool

Aug 13, 2010
3:05 pm
Member
Forum Posts: 27
Member Since:
Feb 3, 2009
Offline

Absolutely!! Smile

Visit the Twitter Poker Tour Forum to see my Simple-Press implementation

Aug 13, 2010
3:09 pm
Member
Forum Posts: 77
Member Since:
Sep 20, 2009
Offline

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?

Aug 13, 2010
3:12 pm

SP Master
Forum Posts: 23688
Member Since:
Dec 10, 2006
Offline

that link doesnt work…

Aug 13, 2010
3:13 pm
Member
Forum Posts: 77
Member Since:
Sep 20, 2009
Offline

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;
 }
Aug 13, 2010
3:13 pm
Member
Forum Posts: 27
Member Since:
Feb 3, 2009
Offline

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

Aug 13, 2010
3:16 pm

SP Master
Forum Posts: 23688
Member Since:
Dec 10, 2006
Offline

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

}

Aug 13, 2010
3:17 pm

SP Master
Forum Posts: 23688
Member Since:
Dec 10, 2006
Offline

cprpoker, then you need a tweet me button for each post!

Aug 13, 2010
3:24 pm
Member
Forum Posts: 77
Member Since:
Sep 20, 2009
Offline

You sir are a Genius! It works, mission complete. :: virtual high 5 ::

Aug 13, 2010
4:21 pm

SP Master
Forum Posts: 23688
Member Since:
Dec 10, 2006
Offline

good to hear!  will you make it available for others?

Forum Timezone: America/Chicago

Most Users Ever Online: 444

Currently Online: SPQC, joelrob
56 Guest(s)

Currently Browsing this Page:
1 Guest(s)

See All Online Activity

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

Moderators: Brandon C (162)

Administrators: Yellow Swordfish (22240), Mr Papa (23688)