Skip to:
Content

BuddyPress.org

Changeset 2953


Ignore:
Timestamp:
04/26/2010 11:22:07 PM (16 years ago)
Author:
johnjamesjacoby
Message:

Fixes #2343 props boonebgorges and 3sixty

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-forums/bp-forums-templatetags.php

    r2935 r2953  
    77    var $topic;
    88
     9    var $forum_id;
     10
    911    var $in_the_loop;
    1012
     
    2628        $this->type = $type;
    2729        $this->search_terms = $search_terms;
     30        $this->forum_id = $forum_id;
    2831
    2932        switch ( $type ) {
     
    694697    var $post;
    695698
     699    var $forum_id;
    696700    var $topic_id;
    697701    var $topic;
     
    717721        $this->topic_id = $topic_id;
    718722        $forum_template->topic = (object) bp_forums_get_topic_details( $this->topic_id );
     723        $this->forum_id = $forum_template->topic->forum_id;
    719724
    720725        $this->posts = bp_forums_get_topic_posts( array( 'topic_id' => $this->topic_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num ) );
     
    812817        $topic_id = bp_forums_get_topic_id_from_slug( $bp->action_variables[1] );
    813818
    814     if ( is_numeric( $topic_id ) )
     819    if ( is_numeric( $topic_id ) ) {
    815820        $topic_template = new BP_Forums_Template_Topic( $topic_id, $per_page, $max );
    816     else
     821
     822        // Current topic forum_id needs to match current_group forum_id
     823        if ( $bp->current_component == $bp->groups->slug && $topic_template->forum_id != groups_get_groupmeta( $bp->groups->current_group->id, 'forum_id' ) )
     824            return false;
     825
     826    } else {
    817827        return false;
     828    }
    818829
    819830    return apply_filters( 'bp_has_topic_posts', $topic_template->has_posts(), &$topic_template );
Note: See TracChangeset for help on using the changeset viewer.