Changeset 4010
- Timestamp:
- 02/02/2011 07:37:25 AM (14 years ago)
- Location:
- trunk/bp-forums
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-forums/bp-forums-functions.php
r3917 r4010 268 268 269 269 if ( isset( $bbdb ) ) { 270 $count = $bbdb->get_results( $bbdb->prepare( "SELECT t.topic_id FROM {$bbdb->topics} AS t". groups_add_forum_tables_sql( '' ) . " WHERE " . groups_add_forum_where_sql( "t.topic_status = 0" ) ) ); 270 if ( bp_is_active( 'groups' ) ) { 271 $groups_table_sql = groups_add_forum_tables_sql(); 272 $groups_where_sql = groups_add_forum_where_sql( "t.topic_status = 0" ); 273 } else { 274 $groups_table_sql = ''; 275 $groups_where_sql = "t.topic_status = 0"; 276 } 277 $count = $bbdb->get_results( $bbdb->prepare( "SELECT t.topic_id FROM {$bbdb->topics} AS t {$groups_table_sql} WHERE {$groups_where_sql}" ) ); 271 278 $count = count( (array)$count ); 272 279 } else { -
trunk/bp-forums/bp-forums-screens.php
r3982 r4010 72 72 global $bp; 73 73 74 if ( !bp_is_forums_component() || !bp_is_current_action( 'topic' ) || empty( $bp->action_variables[0] ) ) 75 return false; 76 74 77 do_action( 'bp_forums_screen_replies' ); 75 78 76 bp_core_load_template( apply_filters( 'bp_forums_screen_replies', ' members/single/home' ) );79 bp_core_load_template( apply_filters( 'bp_forums_screen_replies', 'forums/single/topic' ) ); 77 80 } 81 add_action( 'bp_screens', 'bp_forums_screen_replies' ); 78 82 79 83 function bp_forums_screen_favorites() { -
trunk/bp-forums/bp-forums-template.php
r3983 r4010 335 335 336 336 $defaults = array( 337 'type' => 'thumb',338 'width' => false,337 'type' => 'thumb', 338 'width' => false, 339 339 'height' => false, 340 'alt' => __( 'Profile picture of %s', 'buddypress' )340 'alt' => __( 'Profile picture of %s', 'buddypress' ) 341 341 ); 342 342 … … 376 376 global $forum_template; 377 377 378 return apply_filters( 'bp_get_the_topic_object_name', $forum_template->topic->object_name ); 378 if ( isset( $forum_template->topic->object_name ) ) 379 $retval = $forum_template->topic->object_name; 380 else 381 $retval = ''; 382 383 return apply_filters( 'bp_get_the_topic_object_name', $retval ); 379 384 } 380 385 … … 394 399 global $bp, $forum_template; 395 400 396 /* Currently this will only work with group forums, extended support in the future */ 397 return apply_filters( 'bp_get_the_topic_object_permalink', bp_get_root_domain() . '/' . $bp->groups->root_slug . '/' . $forum_template->topic->object_slug . '/forum/' ); 401 // Currently this will only work with group forums, extended support in the future 402 if ( bp_is_active( 'groups' ) ) 403 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $forum_template->topic->object_slug . '/forum/' ); 404 else 405 $permalink = ''; 406 407 return apply_filters( 'bp_get_the_topic_object_permalink', $permalink ); 398 408 } 399 409 … … 416 426 global $forum_template; 417 427 428 if ( !isset( $forum_template->topic->object_id ) ) 429 return false; 430 418 431 $defaults = array( 419 'type' => 'thumb',420 'width' => false,432 'type' => 'thumb', 433 'width' => false, 421 434 'height' => false, 422 'alt' => __( 'Group logo for %s', 'buddypress' )435 'alt' => __( 'Group logo for %s', 'buddypress' ) 423 436 ); 424 437 … … 547 560 global $forum_template, $bp; 548 561 549 if ( !empty( $forum_template->topic->object_slug ) )550 $permalink = trailingslashit( bp_get_root_domain() . '/' . $bp->groups->root_slug . '/' . $forum_template->topic->object_slug);551 else if ( !empty( $bp->is_single_item) )552 $permalink = trailingslashit( bp_get_root_domain() . '/' . $bp->current_component. '/' . bp_current_item() );562 if ( bp_is_active( 'groups' ) && !empty( $forum_template->topic->object_slug ) ) 563 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $forum_template->topic->object_slug . '/forum' ); 564 else if ( bp_is_single_item() ) 565 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/' . bp_current_item() ); 553 566 else 554 $permalink = trailingslashit( bp_get_root_domain() . '/' . $bp->current_component. '/' . $bp->current_action );555 556 return apply_filters( 'bp_get_the_topic_permalink', trailingslashit( $permalink . ' forum/topic/' . $forum_template->topic->topic_slug ) );567 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/' . $bp->current_action ); 568 569 return apply_filters( 'bp_get_the_topic_permalink', trailingslashit( $permalink . 'topic/' . $forum_template->topic->topic_slug ) ); 557 570 } 558 571
Note: See TracChangeset
for help on using the changeset viewer.