Changeset 1887
- Timestamp:
- 09/16/2009 07:46:47 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core.php
r1878 r1887 388 388 global $bp; 389 389 390 if ( !is_home() &&is_null( $bp->displayed_user->id ) && $bp->current_component == BP_MEMBERS_SLUG ) {390 if ( is_null( $bp->displayed_user->id ) && $bp->current_component == BP_MEMBERS_SLUG ) { 391 391 $bp->is_directory = true; 392 392 -
trunk/bp-core/bp-core-catchuri.php
r1801 r1887 55 55 56 56 /* Loop and remove empties */ 57 for ( $i = 0; $i <= count( $bp_uri ); $i++)58 if ( empty( $bp_uri[$ i] ) ) unset( $bp_uri[$i] );57 foreach ( (array)$bp_uri as $key => $uri_chunk ) 58 if ( empty( $bp_uri[$key] ) ) unset( $bp_uri[$key] ); 59 59 60 60 if ( defined( 'BP_ENABLE_MULTIBLOG' ) || 1 != BP_ROOT_BLOG ) { … … 64 64 array_shift( $bp_uri ); 65 65 } 66 67 /* Get total URI segment count */68 $bp_uri_count = count( $bp_uri ) - 1;69 $is_member_page = false;70 66 71 67 /* Set the indexes, these are incresed by one if we are not on a VHOST install */ … … 88 84 array_shift( $paths ); 89 85 90 for ( $i = 0; $i < $bp_uri_count; $i++) {91 if ( in_array( $ bp_uri[$i], $paths )) {92 unset( $bp_uri[$ i] );86 foreach ( (array)$bp_uri as $key => $uri_chunk ) { 87 if ( in_array( $uri_chunk, $paths )) { 88 unset( $bp_uri[$key] ); 93 89 } 94 90 } … … 105 101 106 102 /* Catch a member page and set the current member ID */ 107 if ( !defined( 'BP_ENABLE_ROOT_PROFILES' ) ) { 103 if ( !defined( 'BP_ENABLE_ROOT_PROFILES' ) ) { 108 104 if ( ( $bp_uri[0] == BP_MEMBERS_SLUG && !empty( $bp_uri[1] ) ) || in_array( 'wp-load.php', $bp_uri ) ) { 109 105 // We are within a member page, set up user id globals 110 106 $displayed_user_id = bp_core_get_displayed_userid( $bp_uri[1] ); 111 107 112 108 unset($bp_uri[0]); 113 109 unset($bp_uri[1]); … … 206 202 207 203 /* Don't hijack any URLs on blog pages */ 208 if ( !$bp_skip_blog_check) {209 if ( bp_is_blog_page())204 if ( bp_is_blog_page() ) { 205 if ( !$bp_skip_blog_check ) 210 206 return false; 207 } else { 208 $wp_query->is_home = false; 211 209 } 212 210 … … 255 253 if ( !$bp_path && !bp_is_blog_page() ) { 256 254 if ( is_user_logged_in() ) { 257 wp_redirect( $bp-> loggedin_user->domain );255 wp_redirect( $bp->root_domain ); 258 256 } else { 259 257 wp_redirect( site_url( 'wp-login.php?redirect_to=' . site_url() . $_SERVER['REQUEST_URI'] ) ); -
trunk/bp-forums.php
r1869 r1887 51 51 return false; 52 52 53 if ( !bp_forums_is_installed_correctly() ) { 54 bp_core_add_message( 'The forums component has not been set up yet.', 'buddypress' ); 55 bp_core_redirect( $bp->root_domain ); 56 } 57 53 58 $bp->is_directory = true; 54 59 -
trunk/bp-forums/bp-forums-bbpress.php
r1858 r1887 67 67 if ( !$tables_installed = (boolean) $bbdb->get_results( 'DESCRIBE `' . $bbdb->forums . '`;', ARRAY_A ) ) 68 68 require_once( ABSPATH . 'wp-admin/upgrade-functions.php' ); 69 69 70 70 require_once( BB_PATH . 'bb-admin/includes/functions.bb-admin.php' ); 71 72 71 73 72 if ( is_object( $wp_roles ) ) { … … 91 90 if ( !isset( $bb->site_id ) ) 92 91 $bb->site_id = BP_ROOT_BLOG; 93 94 92 95 93 /* Check if the tables are installed, if not, install them */ -
trunk/bp-forums/bp-forums-templatetags.php
r1858 r1887 295 295 return apply_filters( 'bp_get_the_topic_object_name', $forum_template->topic->object_name ); 296 296 } 297 297 298 298 function bp_the_topic_object_slug() { 299 299 echo bp_get_the_topic_object_slug(); … … 309 309 } 310 310 function bp_get_the_topic_object_permalink() { 311 global $ forum_template;312 311 global $bp, $forum_template; 312 313 313 /* Currently this will only work with group forums, extended support in the future */ 314 return apply_filters( 'bp_get_the_topic_object_permalink', $bp->root_domain . '/' . BP_GROUPS_SLUG . '/' . $forum_template->topic->object_slug . '/ ' );314 return apply_filters( 'bp_get_the_topic_object_permalink', $bp->root_domain . '/' . BP_GROUPS_SLUG . '/' . $forum_template->topic->object_slug . '/forum/' ); 315 315 } 316 316 … … 323 323 return apply_filters( 'bp_get_the_topic_last_poster_name', bp_core_get_userlink( $forum_template->topic->topic_last_poster ) ); 324 324 } 325 325 326 326 function bp_the_topic_object_avatar( $args = '' ) { 327 327 echo bp_get_the_topic_object_avatar( $args ); … … 341 341 return apply_filters( 'bp_get_the_topic_object_avatar', bp_core_fetch_avatar( array( 'item_id' => $forum_template->topic->object_id, 'type' => $type, 'object' => 'group', 'width' => $width, 'height' => $height ) ) ); 342 342 } 343 343 344 344 function bp_the_topic_last_poster_avatar( $args = '' ) { 345 345 echo bp_get_the_topic_last_poster_avatar( $args ); -
trunk/bp-themes/bp-sn-parent/directories/forums/forums-loop.php
r1871 r1887 40 40 </td> 41 41 <td class="td-group"> 42 <a href="<?php bp_the_topic_object_permalink() ?> forum/"><?php bp_the_topic_object_avatar( 'type=thumb&width=20&height=20' ) ?></a>43 <a href="<?php bp_the_topic_object_permalink() ?> forum/" title="<?php bp_the_topic_object_name() ?>"><?php bp_the_topic_object_name() ?></a>42 <a href="<?php bp_the_topic_object_permalink() ?>"><?php bp_the_topic_object_avatar( 'type=thumb&width=20&height=20' ) ?></a> 43 <a href="<?php bp_the_topic_object_permalink() ?>" title="<?php bp_the_topic_object_name() ?>"><?php bp_the_topic_object_name() ?></a> 44 44 </td> 45 45 <td class="td-postcount">
Note: See TracChangeset
for help on using the changeset viewer.