Changeset 2189 for trunk/bp-activity/bp-activity-templatetags.php
- Timestamp:
- 12/16/2009 09:38:39 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/bp-activity/bp-activity-templatetags.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-templatetags.php
r2168 r2189 343 343 } 344 344 345 if ( !bp_is_activity_permalink() ) {346 if ( 'activity_comment' == $activities_template->activity->component_action )347 $meta = '</span> <span class="activity-header-meta"> · <a href="' . $bp->root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $activities_template->activity->item_id . '">' . __( 'View Thread', 'buddypress' ) . '</a>';348 else349 $meta = '</span> <span class="activity-header-meta"> · <a href="' . $bp->root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $activities_template->activity->id . '">' . __( 'View Thread', 'buddypress' ) . '</a>';350 }351 352 345 /* Add the delete link if the user has permission on this item */ 353 346 if ( ( $activities_template->activity->user_id == $bp->loggedin_user->id ) || $bp->is_item_admin || is_site_admin() ) … … 497 490 498 491 return apply_filters( 'bp_get_activity_permalink_id', $bp->current_action ); 492 } 493 494 function bp_activity_thread_permalink() { 495 echo bp_get_activity_thread_permalink(); 496 } 497 function bp_get_activity_thread_permalink() { 498 global $bp, $activities_template; 499 500 if ( 'new_blog_post' == bp_get_activity_action_name() || 'new_blog_comment' == bp_get_activity_action_name() || 'new_forum_topic' == bp_get_activity_action_name() || 'new_forum_post' == bp_get_activity_action_name() ) 501 $link = bp_activity_feed_item_link(); 502 else { 503 if ( 'activity_comment' == bp_get_activity_action_name() ) 504 $link = $bp->root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $activities_template->activity->item_id; 505 else 506 $link = $bp->root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $activities_template->activity->id; 507 } 508 509 return apply_filters( 'bp_get_activity_thread_permalink', $link ); 499 510 } 500 511 … … 514 525 ) ); 515 526 516 $ mini_class = '';527 $class = ''; 517 528 if ( in_array( $activities_template->activity->component_action, (array)$mini_activity_actions ) ) 518 $mini_class = ' mini'; 519 520 return apply_filters( 'bp_get_activity_css_class', $activities_template->activity->component_name . ' ' . $activities_template->activity->component_action . $mini_class ); 529 $class = ' mini'; 530 531 if ( bp_activity_get_comment_count() && bp_activity_can_comment() ) 532 $class .= ' has-comments'; 533 534 return apply_filters( 'bp_get_activity_css_class', $activities_template->activity->component_name . ' ' . $activities_template->activity->component_action . $class ); 521 535 } 522 536 … … 616 630 } 617 631 632 function bp_activity_can_comment() { 633 global $bp; 634 635 if ( false === get_site_option( 'bp-disable-blogforum-comments' ) || (int)get_site_option( 'bp-disable-blogforum-comments' ) ) { 636 if ( 'new_blog_post' == bp_get_activity_action_name() || 'new_blog_comment' == bp_get_activity_action_name() || 'new_forum_topic' == bp_get_activity_action_name() || 'new_forum_post' == bp_get_activity_action_name() ) 637 return false; 638 } 639 640 if ( 'activity_comment' == bp_get_activity_action_name() ) 641 return false; 642 643 return true; 644 } 645 618 646 function bp_sitewide_activity_feed_link() { 619 647 echo bp_get_sitewide_activity_feed_link();
Note: See TracChangeset
for help on using the changeset viewer.