Skip to:
Content
Pages
Categories
Search
Top
Bottom

Old Plugin to add a Blog tab to Group needs repairl


  • redheadkelly
    Participant

    @redheadkelly

    I found this great old Blog Categories for Groups plugin to add a Blog tab to my Groups. It basically allows you to set which categories you want associated with each Group & then displays just those posts in the tab.

    It seems to do exactly what I want it to do except that the tabs bar is displayed twice when you are in the Blog tab. http://fryingpan.redheadkelly.net/groups/haplogroup-r1b-lineage-ii/articles/

    I think it is coming from this part of the code somewhere. Or maybe in combination with the Custom Community theme?

    //setup nav
    function bcg_setup_nav($current_user_access){
        global $bp;
      
      if(!bp_is_group())
          return;
        if(bcg_is_disabled($bp->groups->current_group->id))
              return;
        //register form if the BPDev PostEditor Exists
        if(function_exists('bp_new_simple_blog_post_form')){
            $form_params=array('post_type'=>'post',
                               'post_author'=>  bp_loggedin_user_id(),
                               'post_status'=>'draft',
                               'current_user_can_post'=>  bcg_current_user_can_post(),
                               'show_categories'=>true,
                               'show_tags'=>false,//current version does not support the tag
                               'allowed_categories'=>bcg_get_categories($bp->groups->current_group->id),//selected cats,
                               'allowed_tags'=>array());
            $form=bp_new_simple_blog_post_form('bcg_form',$form_params);
           
        }   
        $group_link = bp_get_group_permalink($bp->groups->current_group);
        bp_core_new_subnav_item( array( 'name' => __( 'Articles', 'bcg' ), 'slug' => BCG_SLUG, 'parent_url' => $group_link, 'parent_slug' => $bp->groups->current_group->slug, 'screen_function' => 'bcg_screen_group_blog', 'position' => 10,'user_has_access'=>$current_user_access, 'item_css_id' => 'blog' ) );
    
    }
    add_action("groups_setup_nav","bcg_setup_nav");
    
    //load the blog home page for group
    function bcg_screen_group_blog(){
        //load template
        bp_core_load_template( apply_filters( 'groups_template_group_blog', 'bcg/home' ) );
    }

    WordPress 3.5.1
    BuddyPress 1.7
    Custom Community 1.14

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Old Plugin to add a Blog tab to Group needs repairl’ is closed to new replies.
Skip to toolbar