Changeset 2168 for trunk/bp-forums.php
- Timestamp:
- 12/14/2009 03:24:05 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/bp-forums.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-forums.php
r2077 r2168 62 62 63 63 do_action( 'bbpress_init' ); 64 65 /* Check to see if the user has posted a new topic from the forums page. */ 66 if ( isset( $_POST['submit_topic'] ) && function_exists( 'bp_forums_new_topic' ) ) { 67 /* Check the nonce */ 68 check_admin_referer( 'bp_forums_new_topic' ); 69 70 if ( $group = groups_get_group( array( 'group_id' => $_POST['topic_group_id'] ) ) ) { 71 /* Auto join this user if they are not yet a member of this group */ 72 if ( !is_site_admin() && 'public' == $group->status && !groups_is_user_member( $bp->loggedin_user->id, $group->id ) ) 73 groups_join_group( $group->id, $group->id ); 74 75 if ( $forum_id = groups_get_groupmeta( $group->id, 'forum_id' ) ) { 76 if ( !$topic = groups_new_group_forum_topic( $_POST['topic_title'], $_POST['topic_text'], $_POST['topic_tags'], $forum_id ) ) 77 bp_core_add_message( __( 'There was an error when creating the topic', 'buddypress'), 'error' ); 78 else 79 bp_core_add_message( __( 'The topic was created successfully', 'buddypress') ); 80 81 bp_core_redirect( bp_get_group_permalink( $group ) . '/forum/topic/' . $topic->topic_slug . '/' ); 82 } 83 } 84 } 85 64 86 do_action( 'bp_forums_directory_forums_setup' ); 65 bp_core_load_template( apply_filters( 'bp_forums_template_directory_forums_setup', 'directories/forums/index' ) ); 87 88 bp_core_load_template( apply_filters( 'bp_forums_template_directory_forums_setup', 'forums/index' ) ); 66 89 } 67 90 } … … 391 414 } 392 415 add_filter( 'user_has_cap', 'bp_forums_filter_caps' ); 416 417 /** 418 * bp_forums_filter_template_paths() 419 * 420 * Add fallback for the bp-sn-parent theme template locations used in BuddyPress versions 421 * older than 1.2. 422 * 423 * @package BuddyPress Core 424 */ 425 function bp_forums_filter_template_paths() { 426 if ( 'bp-sn-parent' != basename( TEMPLATEPATH ) && !defined( 'BP_CLASSIC_TEMPLATE_STRUCTURE' ) ) 427 return false; 428 429 add_filter( 'bp_forums_template_directory_forums_setup', create_function( '', 'return "directories/forums/index";' ) ); 430 } 431 add_action( 'init', 'bp_forums_filter_template_paths' ); 432 393 433 ?>
Note: See TracChangeset
for help on using the changeset viewer.