sbrajesh

Brajesh Singh

Oct 25th, 2010
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. //To add forum tag search to global unified search
  2. //show forum tags search
  3. function bpmag_show_forums_tag_search(){
  4. //only if tag exists
  5. if(bb_get_tag($_REQUEST['search-terms'])):?>
  6.    
  7.  <div class="forums-search-result search-result">
  8.    <h2 class="content-title"><?php _e(sprintf("Forum topics for tag %s",$_REQUEST['search-terms']),"bpmag");?></h2>
  9.   <?php locate_template( array( 'forums/tag-topics.php' ), true ) ;  ?>
  10.   <a href="<?php echo bp_get_root_domain().'/'.BP_FORUMS_SLUG.'/tag/'.$_REQUEST['search-terms']?>" ><?php _e("View All matched forum topics","bpmag");?></a>
  11. </div>
  12.   <?php
  13.   endif;
  14.   }
  15.  
  16. //Hook Forums results to search page
  17. if ( bp_is_active( 'forums' ) && bp_is_active( 'groups' ) && ( function_exists( 'bp_forums_is_installed_correctly' ) && !(int) bp_get_option( 'bp-disable-forum-directory' ) ) && bp_forums_is_installed_correctly() )
  18.  add_action("advance-search","bpmag_show_forums_tag_search",20);
  19.  
  20. ?>
Add Comment
Please, Sign In to add comment