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
Jun 4, 2010
1:32 am

SP Master
Forum Posts: 22240
Member Since:
Nov 9, 2008
Offline

It's in the code above (the actual function) which uses an SP hook.

See our wiki for details.

Yellow Swordfish
Jun 11, 2010
2:09 am
Member
Forum Posts: 103
Member Since:
May 8, 2010
Offline

In the actiity stream overview.

When you click the VIEW activity  (as in view the given forum post) button in activity stream, it takes you to an activity display, and not the actual forum/post. Is there a way to make the VIEW button, take the user to the actual post or make the title/heading of the post in the activity stream, function as a link in the activity stream?

Jun 11, 2010
6:11 pm

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

will have to wait for the user that wrote the hook comes on back…

Jul 10, 2010
4:46 pm
Stang5_0
Guest

This might be an easy question.. Wink

Works great!  Thanks to the author for sure.

As it stands now, when notification of a forum post is inserted into the stream, it looks like this:

stang5_0 created the topic Get points for posting in the forum and replying:   sometime ago ·

 

With it like that, forum posts are always at the top, where with a normal activity, is has a time stamp such as:

stang5_0 [Image Can Not Be Found] posted a tweet:   4 hours, 9 minutes ago ·

 

Is there a parameter I can add to the call or something that will allow for a time stamp as opposed to whatever it is doing?

Thank you,

Stang

Jul 11, 2010
9:17 am

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

will need to wait for the hook author to come on back… sorry…

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

Made some progress. Now when you filter activity in buddypress it's under "Show Forum Replies".

I have it set up so you can't reply to forum topics/blog posts/blog comments in the activity feed. So people can't reply to your forum post in the activity feed. Which can get confusing.

Anyway, last piece of the puzzle is a direct link to the post. So I'm using $directURL as a test and it is pointing to Google. So how do a put in the permalink to the post in simple press forum?

After some more thought .. wouldn't this post to the activity feed even if the forum is only for certain members/levels?

 function sf_hook_post_save($newpost, $action)
 {
   global $bp;
   $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']);
   $directURL = 'http://www.google.com';
   
   $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 = $directURL;
   $activity->secondary_item_id = '';
   $activity->date_recorded = $date_recorded;
   $activity->hide_sitewide = 0;
   $activity->save ();
 
   return;
 }
Aug 13, 2010
2:50 pm

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

try

$newpost['url']

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

That did it! Cool

Last issue I have is posts from"protected" membership forums would post in the activity feed. Can I do something like. If forum id= 2,5,3 etc don't run that code?
Aug 13, 2010
2:59 pm

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

add

global $current_user;

and then where you want to check, add

if ($current_user->sfaccess)
{
// allowed stuff here
} else {
// whoops no access
}

basically, sfaccess is a permission check for permission to view current forum…

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

Just as an FYI, I have uninstalled BuddyPress and I am running solely on Wordpress and Simple:Press Forum. BuddyPress just didn't add anything to my community.

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

Forum Timezone: America/Chicago

Most Users Ever Online: 444

Currently Online: SPQC, joelrob
56 Guest(s)

Currently Browsing this Page:
3 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)