function bp_gtm_get_term_name_by_id($term_id, $link = false, $count = false) { global $bp; $term_name = BP_GTM_Taxon::get_term_name_by_id($term_id); if ($link == true && $count == true) { $pre_term = '<a href="' . bp_get_group_permalink() . $bp->gtm->slug . '/terms/view/' . $term_id . '" title="' . sprintf(_n('%d element', '%d elements', bp_gtm_count_term_usage($term_id, $bp->groups->current_group->id), 'bp_gtm'), bp_gtm_count_term_usage($term_id, $bp->groups->current_group->id)) . '">'; $post_term = '</a>'; } elseif ($link == false && $count == true) { $pre_term = '<span title="' . bp_gtm_count_term_usage($term_id, $bp->groups->current_group->id) . '"'; $post_term = '</span>'; } elseif ($link == true && $count == false) { $pre_term = '<a href="' . bp_get_group_permalink() . $bp->gtm->slug . '/terms/view/' . $term_id . '" title="' . __('Tasks and projects with this term', 'bp_gtm') . '">'; $post_term = '</a>'; } elseif ($link == false && $count == false) { $pre_term = ''; $post_term = ''; } $term = $pre_term . $term_name . $post_term; return $term; }
<h4><?php printf(__('View tasks and projects for <i>"%s"</i>', 'bp_gtm'), BP_GTM_Taxon::get_term_name_by_id($bp->action_variables[2])); ?> </h4> <?php do_action('bp_before_gtm_term_view'); ?> <?php $elements = BP_GTM_Taxon::get_elements_4term($bp->action_variables[2]); $gtm_link = bp_get_group_permalink() . $bp->gtm->slug . '/'; //var_dump($gtm_link); die; ?> <p> </p> <?php if (count($elements['tasks']) && !$elements['tasks']['0']) { ?> <table class="forum zebra table-left"> <thead> <tr> <th id="th-title"><?php _e('Task Name', 'bp_gtm'); ?> </th> <th id="th-postcount"> <?php _e('Done?', 'bp_gtm'); ?> </th> </tr>