Changeset 4012
- Timestamp:
- 02/02/2011 08:52:58 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-forums/bp-forums-loader.php
r3933 r4012 129 129 'parent_url' => $forums_link, 130 130 'parent_slug' => $this->slug, 131 'screen_function' => 'bp_ forums_screen_topics',131 'screen_function' => 'bp_member_forums_screen_topics', 132 132 'position' => 20, 133 133 'item_css_id' => 'forums-friends' … … 140 140 'parent_url' => $forums_link, 141 141 'parent_slug' => $this->slug, 142 'screen_function' => 'bp_ forums_screen_replies',142 'screen_function' => 'bp_member_forums_screen_replies', 143 143 'position' => 40, 144 144 'item_css_id' => 'forums-friends' … … 151 151 'parent_url' => $forums_link, 152 152 'parent_slug' => $this->slug, 153 'screen_function' => 'bp_ forums_screen_favorites',153 'screen_function' => 'bp_member_forums_screen_favorites', 154 154 'position' => 60, 155 155 'item_css_id' => 'forums-favs' -
trunk/bp-forums/bp-forums-screens.php
r4010 r4012 61 61 add_action( 'bp_screens', 'bp_forums_directory_forums_setup' ); 62 62 63 function bp_ forums_screen_topics() {63 function bp_member_forums_screen_topics() { 64 64 global $bp; 65 65 66 do_action( 'bp_ forums_screen_topics' );66 do_action( 'bp_member_forums_screen_topics' ); 67 67 68 68 bp_core_load_template( apply_filters( 'bp_forums_screen_topics', 'members/single/home' ) ); 69 69 } 70 70 71 function bp_forums_screen_replies() { 71 function bp_member_forums_screen_replies() { 72 global $bp; 73 74 do_action( 'bp_member_forums_screen_replies' ); 75 76 bp_core_load_template( apply_filters( 'bp_member_forums_screen_replies', 'members/single/home' ) ); 77 } 78 79 function bp_member_forums_screen_favorites() { 80 global $bp; 81 82 do_action( 'bp_member_forums_screen_favorites' ); 83 84 bp_core_load_template( apply_filters( 'bp_member_forums_screen_favorites', 'members/single/home' ) ); 85 } 86 87 function bp_forums_screen_single_forum() { 88 global $bp; 89 90 if ( !bp_is_forums_component() || !bp_is_current_action( 'forum' ) || empty( $bp->action_variables[0] ) ) 91 return false; 92 93 do_action( 'bp_forums_screen_single_forum' ); 94 95 bp_core_load_template( apply_filters( 'bp_forums_screen_single_forum', 'forums/single/forum' ) ); 96 } 97 add_action( 'bp_screens', 'bp_forums_screen_single_forum' ); 98 99 function bp_forums_screen_single_topic() { 72 100 global $bp; 73 101 … … 75 103 return false; 76 104 77 do_action( 'bp_forums_screen_ replies' );105 do_action( 'bp_forums_screen_single_topic' ); 78 106 79 bp_core_load_template( apply_filters( 'bp_forums_screen_ replies', 'forums/single/topic' ) );107 bp_core_load_template( apply_filters( 'bp_forums_screen_single_topic', 'forums/single/topic' ) ); 80 108 } 81 add_action( 'bp_screens', 'bp_forums_screen_replies' ); 82 83 function bp_forums_screen_favorites() { 84 global $bp; 85 86 do_action( 'bp_forums_screen_favorites' ); 87 88 bp_core_load_template( apply_filters( 'bp_forums_screen_favorites', 'members/single/home' ) ); 89 } 109 add_action( 'bp_screens', 'bp_forums_screen_single_topic' ); 90 110 91 111 ?> -
trunk/bp-forums/bp-forums-template.php
r4010 r4012 449 449 450 450 $defaults = array( 451 'type' => 'thumb',452 'width' => false,451 'type' => 'thumb', 452 'width' => false, 453 453 'height' => false, 454 'alt' => __( 'Profile picture of %s', 'buddypress' )454 'alt' => __( 'Profile picture of %s', 'buddypress' ) 455 455 ); 456 456 … … 565 565 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/' . bp_current_item() ); 566 566 else 567 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/' . $bp->current_action);567 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() ); 568 568 569 569 return apply_filters( 'bp_get_the_topic_permalink', trailingslashit( $permalink . 'topic/' . $forum_template->topic->topic_slug ) ); … … 901 901 if ( empty( $topic_id ) && bp_is_current_component( 'groups') && bp_is_current_action( 'forum' ) && 'topic' == $bp->action_variables[0] ) 902 902 $topic_id = bp_forums_get_topic_id_from_slug( $bp->action_variables[1] ); 903 elseif ( empty( $topic_id ) && bp_is_current_component( 'forums') && bp_is_current_action( 'topic' ) && !empty( $bp->action_variables[0] ) ) 904 $topic_id = bp_forums_get_topic_id_from_slug( $bp->action_variables[0] ); 903 905 904 906 if ( is_numeric( $topic_id ) ) { … … 1107 1109 } 1108 1110 1109 function bp_forum_permalink() { 1110 echo bp_get_forum_permalink(); 1111 } 1112 function bp_get_forum_permalink() { 1113 global $bp; 1114 1115 if ( $bp->is_single_item ) 1116 $permalink = trailingslashit( bp_get_root_domain() . '/' . $bp->current_component . '/' . bp_current_item() ); 1111 function bp_forum_permalink( $forum_id = 0 ) { 1112 echo bp_get_forum_permalink( $forum_id ); 1113 } 1114 function bp_get_forum_permalink( $forum_id = 0 ) { 1115 global $bp; 1116 1117 if ( bp_is_groups_component() ) { 1118 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_current_item() . 'forum' ); 1119 } else { 1120 if ( empty( $forum_id ) ) { 1121 global $topic_template; 1122 if ( isset( $topic_template->forum_id ) ) 1123 $forum_id = $topic_template->forum_id; 1124 } 1125 1126 if ( $forum = bp_forums_get_forum( $forum_id ) ) 1127 $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/forum/' . $forum->forum_slug ); 1128 else 1129 return false; 1130 } 1131 1132 return apply_filters( 'bp_get_forum_permalink', trailingslashit( $permalink ) ); 1133 } 1134 1135 function bp_forum_name( $forum_id = 0 ) { 1136 echo bp_get_forum_name( $forum_id ); 1137 } 1138 function bp_get_forum_name( $forum_id = 0 ) { 1139 global $bp; 1140 1141 if ( empty( $forum_id ) ) { 1142 global $topic_template; 1143 if ( isset( $topic_template->forum_id ) ) 1144 $forum_id = $topic_template->forum_id; 1145 } 1146 1147 if ( $forum = bp_forums_get_forum( $forum_id ) ) 1148 return apply_filters( 'bp_get_forum_name', $forum->forum_name, $forum->forum_id ); 1117 1149 else 1118 $permalink = trailingslashit( bp_get_root_domain() . $bp->current_component . '/' . $bp->current_action ); 1119 1120 return apply_filters( 'bp_get_forum_permalink', trailingslashit( $permalink . 'forum' ) ); 1150 return false; 1121 1151 } 1122 1152 -
trunk/bp-groups/bp-groups-screens.php
r3983 r4012 416 416 global $bp; 417 417 418 if ( !bp_is_ current_component( 'groups' ) || !bp_is_current_action( $bp->activity->slug) || empty( $bp->action_variables[0] ) )418 if ( !bp_is_groups_component() || ( bp_is_active( 'activity' ) && !bp_is_current_action( $bp->activity->slug ) ) || empty( $bp->action_variables[0] ) ) 419 419 return false; 420 420
Note: See TracChangeset
for help on using the changeset viewer.