Change Reply button on activty stream posting for Forums!
-
Hey Buddypress!
Im interested in changing the reply button for forum posts on the activity stream listing. Instead of having the “reply” button it would have a “View Post” button that would take you to the permalink of the forum post. Im not sure how difficult a task like this would be but i dont have the experience to figure it out by my lonesome.
so…. instead of this:
http://img641.imageshack.us/img641/199/replyn.gifIt would say this:
http://img842.imageshack.us/img842/8449/reply2.gifand take you here: http://www.skateage.com/groups/skateboarders/forum/topic/the-berrics-or-the-fantasy-factory/#post-140
If someone has a solution or is willing to find one i would be thrilled to the point of explosion.
-
bump
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;
}`hi @cnorris23 ,
tried to implement your changes, result is (for functions.php):
Parse error: syntax error, unexpected T_RETURN
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
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?
Gee, afraid not, I am just a cut-and-paster
Maybe use the above code as a place to start from@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-“> ()
`
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” againactually, I thought it will be another copy/past work. if it takes lots of time, no need to bother about.
thanks!
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-“> ()
`
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
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;
}`
- The topic ‘Change Reply button on activty stream posting for Forums!’ is closed to new replies.