Skip to:
Content
Pages
Categories
Search
Top
Bottom

Need help locating the activity-header code

  • @modemlooper

    Moderator

    @Andy or anybody who may know.

    Where in the theme files can I edit the code for an activity header that says where and when with the view and delete links. I don’t see this anywhere.

    admin commented on the blog post Layout Test 3 hours, 25 minutes ago View Delete

    I need to relocate / edit this if I can.

Viewing 13 replies - 1 through 13 (of 13 total)
  • @sbrajesh

    Participant

    It is in the activity/entry.php

    Take a look at the entry.php, this function does it in bp 1.2

    <?php bp_activity_action() ?>

    Hope it helps

    @modemlooper

    Moderator

    Yeah saw that but I wanted to exclude certain parts of this. Not sure how.

    @mikepratt

    Participant

    @modemlooper You’ll need to ask Andy for hook into bp_insert_activity_meta() in bp-activity-templatetags.php so you can re-write the function

    @r-a-y

    Keymaster

    Apply a filter to bp_get_activity_action (I believe that’s the filter that contains the view/delete links)

    This is some test code you can use:

    function my_remove_activity_action($content) {
    //MANIPULATE $content here
    //$content will probably contain the view and remove links
    //you'll have to code this yourself

    return $content;
    }
    add_filter('bp_get_activity_action','my_remove_activity_action');

    You’ll have to figure out a way to strip

    @modemlooper

    Moderator

    Need some help with this. I’ve located the code in ajax.php to edit the activity comment meta. Problem is I don’t want to fudge with core. I copied files over to child theme but BP doesn’t recognize this file in the child theme. I’ve changed this code yet it does not reflect on the page. What am i missing?

    Code:

    <div class="acomment-meta">
    <?php echo bp_core_get_userlink( bp_get_activity_user_id() ) ?> · <?php printf( __( '%s ago', 'buddypress' ), bp_core_time_since( gmdate( "Y-m-d H:i:s" ) ) ) ?> ·
    <a class="acomment-reply" href="#acomment-<?php bp_activity_id() ?>" id="acomment-reply-<?php echo attribute_escape( $_POST['form_id'] ) ?>"><?php _e( 'Reply', 'buddypress' ) ?></a>
    <a href="<?php echo wp_nonce_url( $bp->root_domain . '/' . $bp->activity->slug . '/delete/' . bp_get_activity_id() . '?cid=' . $comment_id, 'bp_activity_delete_link' ) ?>" class="delete acomment-delete confirm"><?php _e( 'Delete', 'buddypress' ) ?></a>
    </div>

    @r-a-y

    Keymaster

    Yeah, I’ve also had problems trying to get the child theme to override the default theme’s ajax.php.

    @modemlooper

    Moderator

    I guess I’ll just delete

    <?php bp_activity_action() ?>

    and add my own code

    @hypergripe

    Participant

    Hey @modemlooper;

    I’d like to know how you do that… I’m trying to alter the layout of the updates on our (child theme) activity stream page at http://www.hypergripe.com/activity/ so that when a blog update is mentioned, the permalink to the blog post is on the next line and bolded, or in an h3 tag or something to look like a blog title – (the way the code is now the second link does not have a css identifier, and adding css to that specific link is impossible – i think).

    I tried to alter the core bp-blogs.php file on line 433 and line 468, where it SEEMS the code for the activity stream is getting generated, but when I change this line:

    $activity_action = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '' . $post->post_title . '' );

    to this:

    $activity_action = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '
    ' . $post->post_title . '' );

    then upload it, there is no change on the activity stream page….

    I’m baffled. Ya, I know I’m changing core files – I’ve customized a few core files but have made a schedule of changes for future updates – or until there are gentler fixes. :)

    Thanks in advance – your participation in other threads has been very helpful!

    @mikepratt

    Participant

    @modemlooper Odd. I had to over-write ajax.php as well for the exact same reason (needed a place to hook background sprites into) and my new ajax.php files is recognized just fine. Of course, because there are no filters in place, I have to be diligent about keeping up on any changes to ajax.php

    @modemlooper

    Moderator

    Sorry back to this.

    Where is this function being called from? I can’t find the code at all.

    <?php bp_activity_action() ?>

    @modemlooper

    Moderator

    found the comment code but I need the code that pulls in what type of activity it is.

    @jordashtalon

    Member

    @modemlooper

    I don’t know if this was your question but I found the function in /wp-content/buddypress/bp-activity/bp-activity-templatetags.php

    I’m trying to do the same thing as @hypergripe

    The default layout of the Actions (forum actions) is like this:

    Admin posted on the forum topic TOPIC NAME in the group GROUP NAME: 39 minutes ago · View · Delete

    Content of forum post

    I want it to look like this:

    TOPIC NAME

    Admin said:

    Content of Forum Post

    View Full – Delete

    Group/Category: GROUP NAME

    I think that layout would be more intuitive for my users.

    It would be way helpful to be able to sort and have more control over <?php bp_activity_action() ?>

    Has anyone made progress in this regard? Any tips would be appreciated.

    @jordashtalon

    Member

    I don’t think my thread is completely related I started a new one here:

    https://buddypress.org/forums/topic/trying-to-alter-layout-of-bp_activity_action

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Need help locating the activity-header code’ is closed to new replies.
Skip to toolbar