Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change Reply button on activty stream posting for Forums!

Viewing 11 replies - 1 through 11 (of 11 total)
  • @skateage

    Participant

    bump

    @cnorris23

    Participant

    In your theme’s activity/entry.php file change:

    `
    <a href="” class=”acomment-reply” id=”acomment-comment-“> ()
    `

    to:

    `
    if ( my_bp_activity_type_is_new_forum_post() ) {
    <a href="” class=”acomment-reply” id=”acomment-comment-“>
    } else {
    <a href="” class=”acomment-reply” id=”acomment-comment-“> ()
    }
    `

    and add the following to your theme’s functions.php file:

    `function my_bp_activity_type_is_new_forum_post() {
    ( ‘new_forum_post’ == bp_get_activity_type() ) ? return true : return false;
    }`

    @janismo

    Participant

    hi @cnorris23 ,

    tried to implement your changes, result is (for functions.php):

    Parse error: syntax error, unexpected T_RETURN

    @el_terko

    Participant

    I have the following code in my bp-custom.php file
    `function my_bp_activity_entry_meta() {

    if ( bp_get_activity_object_name() == ‘blogs’ && bp_get_activity_type() == ‘new_blog_post’ ) {?>
    <a class="view-post" href="”>Ver nuevo post
    <?php }

    if ( bp_get_activity_object_name() == ‘blogs’ && bp_get_activity_type() == ‘new_blog_comment’ ) {?>
    <a class="view-post" href="”>Ver comentario
    <?php }

    if ( bp_get_activity_object_name() == ‘activity’ && bp_get_activity_type() == ‘activity_update’ ) {?>
    <a class="view-post" href="”>Ver actualizacion
    <?php }

    if ( bp_get_activity_object_name() == ‘groups’ && bp_get_activity_type() == ‘new_forum_topic’ ) {?>
    <a class="view-thread" href="”>Ver hilo en el foro
    <?php }

    if ( bp_get_activity_object_name() == ‘groups’ && bp_get_activity_type() == ‘new_forum_post’ ) {?>
    <a class="view-post" href="”>Ver respuesta en el foro
    <?php }

    }
    add_action(‘bp_activity_entry_meta’, ‘my_bp_activity_entry_meta’);`

    Trim what you don’t need. Mine is translated to spanish also

    @janismo

    Participant

    thanks @el_terko ,

    it works, but do you know how to remove reply button for certain activities and change order of meta buttons. At the moment view button stands 4 in a row?

    @el_terko

    Participant

    Gee, afraid not, I am just a cut-and-paster
    Maybe use the above code as a place to start from

    @cnorris23

    Participant

    @janismo Yep. I see the problem. Sorry about that. It’s a lot harder to catch your mistakes when you’re not using a dedicated code editor ;) Try this instead.

    `

    <a href="” class=”acomment-reply” id=”acomment-comment-“>

    <a href="” class=”acomment-reply” id=”acomment-comment-“> ()

    `

    @janismo

    Participant

    @el_terko ,

    if I put only code from your last post, it adds “view” button to all activities, which acts 100% like “reply” button (hides/reveals text box).
    if additionally I put your function from previous post, then I get “Parse error: syntax error, unexpected T_RETURN” again :)

    actually, I thought it will be another copy/past work. if it takes lots of time, no need to bother about.

    thanks!

    @cnorris23

    Participant

    I think that was a javascript issue. It thought it was still a normal reply. Give the code below a shot.

    `

    <a href="” class=”acomment-view” id=”acomment-comment-“>

    <a href="” class=”acomment-reply” id=”acomment-comment-“> ()

    `

    @janismo

    Participant

    @el_terko

    ok, latest news from fighting field:
    last code in itself adds working “view” button to every activity, reply buttons still are there.
    function my_bp_activity_type_is_new_forum_post() still returns same error.

    Edit: no need to proceed with this question, I will use code by josemv. thanks again

    @cnorris23

    Participant

    For anyone else with this question, the following code should work:

    `

    <a href="” class=”acomment-view” id=”acomment-comment-“>

    <a href="” class=”acomment-reply” id=”acomment-comment-“> ()

    function my_bp_activity_type_is_new_forum_post() {
    if ( ‘new_forum_post’ == bp_get_activity_type() )
    return true;

    return false;
    }`

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Change Reply button on activty stream posting for Forums!’ is closed to new replies.
Skip to toolbar