[Buddypress] Activity stream customizing

6.07K viewsCorebuddypress
3

Hi all!

Since 4.0 and the BuddyPress addon, I’m trying to integrate BP even further with AnsPress. I managed to customize the text on BP activity stream, so that it pulls the title of the question like for regular posts.

I replace:

Fred asked a new question 2 months ago

With:

Fred asked a new question: How to override BP? 2 months ago

 

The filter for achieving this is already working, so if you like the idea (@rahul?), I can push it to Github to be included in core.

If the team/Rahul prefers that the activity item stays the way it is, then I would like to know how to override buddypress.php because I can’t seem to find it in the templates folder as per instructed on this page. Is there a way to override this file?

Good week to you all!

Hello Fred, Sure, feel free to send a pull request. I will check and merge to core. Thanks a lot. Which buddypress.php file you are talking about? I don’t think there is any buddypress.php file in templates? Lemme know.

1

Hi @Rahul!

Sorry for the late reply, I didn’t get a notification. I was quite busy anyway. I just started working on this again but I’m a bit stuck on the way to commit everything in a pull request. My customization is working great by:

  1. Modifying Anspress/addons/free/buddypress.php. I just change this to this.
  2. Then adding to bp-custom.php a filter for [Question] and [Answer] to replace it with the post title (see here for the filter).

Everything is working as intended but bp-custom.php is of course not part of AnsPress and is different for every website. When I try to insert my filter in Anspress/addons/free/buddypress.php, I get a blank page.

Any advice on how to be able to insert my filter in buddypress.php so that it works?

Cheers!

Fred

commented on answer

Hello, There must be some error logged in logfile. Please share log file with me.

Thanks for your quick reply Rahul! I found the error with debug mode and even though I didn’t understand everything it felt like my filter was called in the middle of something. I just put it at the end of buddypress.php and it’s working! It makes sense actually since you are including BuddyPress hooks and files at the end and I’m using a BP hook. ^^; I’ll check on how to make the new strings translatable and I’ll make a pull request. 😀

Ah! Looks like it’s already translatable! ^^;

0

This is great, Fred. I was about to request this and found your question.

Please let us know when this has been committed.

commented on answer

Hi Bruce!
Glad you like the idea. I committed it quite a while ago but the team has been busy with new version of AnsPress and I think my commit needs some adjustment. In case you wanna check: https://github.com/anspress/anspress/pull/372

Hello Guys,
It was not committed because I need to add prefetch logic first. Else it will slow load page. @fred sorry for delay.

No need to apologize Rahul, this is not a priority and it’s great to know you’re making sure my contribution is not breaking down everything. Sorry for not being able (yet!) to do that as well. 😉