BuddyDev

Search

Gallery Counter in Groups Tab Bar

  • Participant
    Level: Initiated
    Posts: 20
    Maurice on #46209

    how can i show the gallery counter in the tab bar in the groups?

    only in the profiles the counter works.

    thx for help

  • Keymaster
    (BuddyDev Team)
    Posts: 24642
    Brajesh Singh on #46217

    Hi Maurice,
    Thank you for the question.
    At the moment, It will need you to update the code for our group extension as we haven’t put the count in the title.

    If you are interested in that, Please do let me know.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 20
    Maurice on #46268

    yes of course! i think is a important infocounter for group users
    thx.

  • Keymaster
    (BuddyDev Team)
    Posts: 24642
    Brajesh Singh on #46284

    Hi Maurice,
    Please open mediapress/modules/buddypress/groups/mpp-bp-groups-group-extension.php

    In that file, on line 29, just before args, please add the following code

    
    			if ( bp_is_group() ) {
    				$count = mpp_get_gallery_count( array(
    					'component'    => 'groups',
    					'component_id' => groups_get_current_group()->id,
    				) );
    			} else {
    				$count = 0;
    			}
    
    

    and then in the args, on line 29, Please change this

    
    'nav_item_name'     => __( 'Gallery', 'mediapress' ),
    

    to

    
    'nav_item_name'                => sprintf( __( 'Gallery <span>%d</span>', 'mediapress' ), $count ) ,
    

    That would do it.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 20
    Maurice on #46312

    great! it works fine ;))

  • Keymaster
    (BuddyDev Team)
    Posts: 24642
    Brajesh Singh on #46322

    Thank you for confirming.

    Regards
    Brajesh

The topic ‘Gallery Counter in Groups Tab Bar’ is closed to new replies.

This topic is: not resolved