Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- remove_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu', 100 );
- add_action("bp_adminbar_menus","show_search_form_in_admin_bar");
- function show_search_form_in_admin_bar(){?>
- <div id="search-bar">
- <form action="<?php echo bp_search_form_action() ?>" method="post" id="search-form">
- <input type="text" id="search-terms" name="search-terms" value="" />
- <?php echo bp_search_form_type_select() ?>
- <input type="submit" name="search-submit" id="search-submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
- <?php wp_nonce_field( 'bp_search_form' ) ?>
- </form><!-- #search-form -->
- <?php do_action( 'bp_search_login_bar' ) ?>
- </div><!-- #search-bar -->
- <?php }
- add_filter("bp_search_form_type_select", "bpmag_remove_search_dropdown" );
- function bpmag_remove_search_dropdown($select_html){
- return '';
- }
- /**
- *
- * Show blog posts in search
- */
- function bpmag_show_site_blog_search(){
- ?>
- <div class="blog-search-result search-result">
- <h2 class="content-title"><?php _e("News Search","bpmag");?></h2>
- <?php locate_template( array( 'search-loop.php' ), true ) ; ?>
- <a href="<?php echo bp_get_root_domain().'/?s='.$_REQUEST['search-terms']?>" ><?php _e("View All matched Posts","bpmag");?></a>
- </div>
- <?php
- }
- //Hook Blog Post results to search page
- add_action("advance-search","bpmag_show_site_blog_search",10);
- //show the search results for member*/
- function bpmag_show_member_search(){
- ?>
- <div class="memberss-search-result search-result">
- <h2 class="content-title"><?php _e("Members Results","bpmag");?></h2>
- <?php locate_template( array( 'members/members-loop.php' ), true ) ; ?>
- <?php global $members_template;
- if($members_template->total_member_count>1):?>
- <a href="<?php echo bp_get_root_domain().'/'.BP_MEMBERS_SLUG.'/?s='.$_REQUEST['search-terms']?>" ><?php _e(sprintf("View all %d matched Members",$members_template->total_member_count),"bpmag");?></a>
- <?php endif; ?>
- </div>
- <?php
- }
- //Hook Member results to search page
- add_action("advance-search","bpmag_show_member_search",10); //the priority defines where in page this result will show up(the order of member search in other searchs)
- function bpmag_show_groups_search(){
- ?>
- <div class="groups-search-result search-result">
- <h2 class="content-title"><?php _e("Group Search","bpmag");?></h2>
- <?php locate_template( array('groups/groups-loop.php' ), true ) ; ?>
- <a href="<?php echo bp_get_root_domain().'/'.BP_GROUPS_SLUG.'/?s='.$_REQUEST['search-terms']?>" ><?php _e("View All matched Groups","bpmag");?></a>
- </div>
- <?php
- //endif;
- }
- //Hook Groups results to search page
- if(bp_is_active( 'groups' ))
- add_action("advance-search","bpmag_show_groups_search",10);
- //show forums search
- function bpmag_show_forums_search(){
- ?>
- <div class="forums-search-result search-result">
- <h2 class="content-title"><?php _e("Forums Search","bpmag");?></h2>
- <?php locate_template( array( 'forums/forums-loop.php' ), true ) ; ?>
- <a href="<?php echo bp_get_root_domain().'/'.BP_FORUMS_SLUG.'/?s='.$_REQUEST['search-terms']?>" ><?php _e("View All matched forum posts","bpmag");?></a>
- </div>
- <?php
- }
- //Hook Forums results to search page
- 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() )
- add_action("advance-search","bpmag_show_forums_search",20);
- //show blogs search result
- function bpmag_show_blogs_search(){
- ?>
- <div class="blogs-search-result search-result">
- <h2 class="content-title"><?php _e("Blogs Search","bpmag");?></h2>
- <?php locate_template( array( 'blogs/blogs-loop.php' ), true ) ; ?>
- <a href="<?php echo bp_get_root_domain().'/'.BP_BLOGS_SLUG.'/?s='.$_REQUEST['search-terms']?>" ><?php _e("View All matched Blogs","bpmag");?></a>
- </div>
- <?php
- }
- //Hook Blogs results to search page if blogs comonent is active
- if(bp_is_active( 'blogs' ))
- add_action("advance-search","bpmag_show_blogs_search",10);
- //modify the query string with the search term
- function bpmag_global_search_qs(){
- return "search_terms=".$_REQUEST['search-terms'];
- }
- function bpmag_is_advance_search(){
- global $bp;
- if($bp->current_component == BP_SEARCH_SLUG)
- return true;
- return false;
- }
- function bp_dtheme_add_custom_header_support() {
- /* Set the defaults for the custom header image (http://ryan.boren.me/2007/01/07/custom-image-header-api/) */
- define( 'HEADER_TEXTCOLOR', 'FFFFFF' );
- define( 'HEADER_IMAGE', '/images/default_header.jpg' ); // %s is theme dir uri
- define( 'HEADER_IMAGE_WIDTH', 1250 );
- define( 'HEADER_IMAGE_HEIGHT', 125 );
- function bp_dtheme_header_style() { ?>
- <style type="text/css">
- #header { background-image: url(<?php header_image() ?>); }
- <?php if ( 'blank' == get_header_textcolor() ) { ?>
- #header h1, #header #desc { display: none; }
- <?php } else { ?>
- #header h1 a, #desc { color:#<?php header_textcolor() ?>; }
- <?php } ?>
- </style>
- <?php
- }
- function bp_dtheme_admin_header_style() { ?>
- <style type="text/css">
- #headimg {
- position: relative;
- color: #fff;
- background: url(<?php header_image() ?>);
- -moz-border-radius-bottomleft: 6px;
- -webkit-border-bottom-left-radius: 6px;
- -moz-border-radius-bottomright: 6px;
- -webkit-border-bottom-right-radius: 6px;
- margin-bottom: 20px;
- height: 100px;
- padding-top: 25px;
- }
- #headimg h1{
- position: absolute;
- bottom: 15px;
- left: 15px;
- width: 44%;
- margin: 0;
- font-family: Arial, Tahoma, sans-serif;
- }
- #headimg h1 a{
- color:#<?php header_textcolor() ?>;
- text-decoration: none;
- border-bottom: none;
- }
- #headimg #desc{
- color:#<?php header_textcolor() ?>;
- font-size:1em;
- margin-top:-0.5em;
- }
- #desc {
- display: none;
- }
- <?php if ( 'blank' == get_header_textcolor() ) { ?>
- #headimg h1, #headimg #desc {
- display: none;
- }
- #headimg h1 a, #headimg #desc {
- color:#<?php echo HEADER_TEXTCOLOR ?>;
- }
- <?php } ?>
- </style>
- <?php
- }
- add_custom_image_header( 'bp_dtheme_header_style', 'bp_dtheme_admin_header_style' );
- }
- if ( !defined( 'BP_DTHEME_DISABLE_CUSTOM_HEADER' ) )
- add_action( 'init', 'bp_dtheme_add_custom_header_support' );
- ?>
Add Comment
Please, Sign In to add comment