Skip to:
Content
Pages
Categories
Search
Top
Bottom

modify contents/display of individual activities


  • ORyanMcentire
    Member

    @oryanmcentire

    I’m wondering what would have to be adjusted to alter the activity stream? Or display a customized version?

    What i’d like to do is shorten the output a little more, rather than displaying a summary and then content of the action as it does by default.

    for example:
    if you were on a user’s profile I could have a narrow widget set up that displays something like:

    posted in the forums
    5mins ago
    
    replied to a comment
    10mins ago
    
    liked a comment
    2 days ago
    

    I am imagining spitting each event out as a list item and clicking on it would link to the event in question.

    Basically i’m just wondering if anyone knows a good place to start?

    I’ve started digging into activity-loop.php which lead me to entry.php but after that i kind of get lost in the myriad of embedded loops…

Viewing 9 replies - 1 through 9 (of 9 total)

  • ORyanMcentire
    Member

    @oryanmcentire

    And I am using the most current BP and WP


    @ChrisClayton
    Participant

    @chrisclayton

    @ORyanMcentire The content section for multi-lined activity is called via bp_activity_content_body() around line 46 inside the entry.php file.

    If you remove that, then all the activities will become two lines (the action, and the meta buttons).

    “Bob posted an update 200 years ago
    comment, favorite, delete”

    That should get it close to what you seem to be looking for. To modify the action line however, is slightly more difficult… and requires filtering of the bp_activity_action function.

    and to modify the meta buttons is around line 60 of entry.php


    ORyanMcentire
    Member

    @oryanmcentire

    @chrisclayton,
    hmm, yea I saw that in there, but What i’m looking to do is shorten the actual event as per the example in the original post.

    I’d like to change the entirety of the output to something like:

    
    <li>
    <a href="link to event">commented on a blog post</a>
    <span>5mins ago</span>
    </li>
    

    I can’t figure out where the actual structure of the activities are being constructed. I have a feeling it may be in the core?

    If I can find it I should be able to replicate it else where.

    IDK if that helps clarify?


    Paul Wong-Gibbs
    Keymaster

    @djpaul

    You would have to add some filters (or a language translation .mo file) to change the text used to create activity items. Do you know enough PHP to do this if we can find out what filters you’d need to use?


    ORyanMcentire
    Member

    @oryanmcentire

    Hey @djpaul,
    Yea I am pretty fluent in PHP. I’m not awesome with WP filters but I can usually figure stuff out.

    I don’t think the .mo route would allow me to change the structure of the actual code being spit out, so i don’t know that that would really work. What I am looking to have displayed is literally the exact wording and layout that i have in my previous posts. those weren’t just shortened for the sake of space here in the forums. That’s actually what I would like displayed to the user. super short and super simple.


    ORyanMcentire
    Member

    @oryanmcentire

    Any Ideas on the filters I would need to use?


    ORyanMcentire
    Member

    @oryanmcentire

    Bump?


    @ChrisClayton
    Participant

    @chrisclayton

    You can either filter the actions directly, for activity_updates theirs the ‘bp_activity_new_update_action’ filter.

    https://buddypress.trac.wordpress.org/browser/tags/1.5.5/bp-activity/bp-activity-functions.php#L879

    New_Member = bp_core_activity_registered_member_action
    https://buddypress.trac.wordpress.org/browser/tags/1.5.5/bp-members/bp-members-signup.php#L534

    New_blog_post = bp_blogs_activity_new_post_action
    https://buddypress.trac.wordpress.org/browser/tags/1.5.5/bp-blogs/bp-blogs-functions.php#L195

    etc.

    Or; you can filter the templates – with ‘bp_get_activity_action’ (best if you don’t need to edit the output directly but want to add a line break after every action. etc)
    https://buddypress.trac.wordpress.org/browser/tags/1.5.5/bp-activity/bp-activity-template.php#L1056


    ORyanMcentire
    Member

    @oryanmcentire

    So digging a bit further it looks like if I am to control what the activity looks like, i need to be able to control how the activity gets saved, not displayed.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘modify contents/display of individual activities’ is closed to new replies.
Skip to toolbar