From d468fb1ef6c49358e2dc35b4385334cbb4f5a940 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 28 Jul 2012 17:28:54 +0000 Subject: [PATCH] =?UTF-8?q?Ticket=20#936=20->=20Revisi=C3=B3n=20de=20la=20?= =?UTF-8?q?ejecuci=C3=B3n=20de=20b=C3=BAsquedas.=20No=20salen=20resultados?= =?UTF-8?q?=20al=20buscar=20un=20grupo.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.ASong2U_Web/trunk@47 cd1a4ea2-8c7f-e448-aada-19d1fee9e1d6 --- wp-content/themes/score/functions.php | 30 ++- wp-content/themes/score/header.php | 7 +- .../lib/buddypress/search-buddypress.php | 183 ++++++++++++++++++ .../themes/score/lib/scripts/custom.php | 2 +- .../themes/score/members/members-loop.php | 1 + .../themes/score/post-loop-dedication.php | 15 +- wp-content/themes/score/post-loop.php | 16 +- wp-content/themes/score/search-loop.php | 55 ++++++ wp-content/themes/score/search-single.php | 13 ++ wp-content/themes/score/search.php | 12 +- 10 files changed, 315 insertions(+), 19 deletions(-) create mode 100644 wp-content/themes/score/lib/buddypress/search-buddypress.php create mode 100644 wp-content/themes/score/search-loop.php create mode 100644 wp-content/themes/score/search-single.php diff --git a/wp-content/themes/score/functions.php b/wp-content/themes/score/functions.php index ad1bb00..b5499aa 100644 --- a/wp-content/themes/score/functions.php +++ b/wp-content/themes/score/functions.php @@ -21,6 +21,11 @@ if ( !defined( 'DEDICATION_CATEGORY_SLUG' ) ) /* * ************************* Concerts Information ********************* */ +if ( !defined( 'MUSICNEWS_CATEGORY_SLUG' ) ) + define( 'MUSICNEWS_CATEGORY_SLUG', 'music-news' ); + +/* * ************************* Concerts Information ********************* */ + if ( !defined( 'CONCERTS_CATEGORY_SLUG' ) ) define( 'CONCERTS_CATEGORY_SLUG', 'concerts' ); @@ -78,6 +83,7 @@ if ($theme_reviews_follow == "0") { // BuddyPress Functions if (function_exists('bp_is_active') && file_exists(ghostpool_bp . 'functions-buddypress.php')) { require_once(ghostpool_bp . 'functions-buddypress.php'); + require_once(ghostpool_bp . 'search-buddypress.php'); } /* * ************************* Flags img function *********************** */ @@ -474,23 +480,27 @@ add_filter('request', 'gp_posts_per_page'); /* * ************************* Search Criteria ************************** */ function SearchFilter($query) { - require(ghostpool_inc . 'options.php'); - if (!is_admin()) { if ($query->is_search) { - if ($theme_search_criteria == "Review Posts Only") { - $query->set('meta_key', 'ghostpool_post_type'); - $query->set('meta_value', 'Review'); - } elseif ($theme_search_criteria == "All Posts") { - $query->set('post_type', 'post'); - } + $query->set('meta_query', array( + 'relation' => 'OR', + array( + 'key' => 'ghostpool_dedication_artist', + 'value' => $query->query_vars['s'], + 'compare' => 'LIKE' + ), + array( + 'key' => 'ghostpool_dedication_song', + 'value' => $query->query_vars['s'], + 'compare' => 'LIKE' + ) + )); } return $query; } } - -add_filter('pre_get_posts', 'SearchFilter'); +//add_filter('pre_get_posts', 'SearchFilter'); /* * ************************* Shortcode Empty Paragraph Fix ************************** */ diff --git a/wp-content/themes/score/header.php b/wp-content/themes/score/header.php index 0296c12..aca8f73 100644 --- a/wp-content/themes/score/header.php +++ b/wp-content/themes/score/header.php @@ -16,6 +16,8 @@ + + > @@ -25,7 +27,7 @@ - +
@@ -42,7 +44,7 @@ - + @@ -62,6 +64,7 @@
  • +
  • diff --git a/wp-content/themes/score/lib/buddypress/search-buddypress.php b/wp-content/themes/score/lib/buddypress/search-buddypress.php new file mode 100644 index 0000000..5ad78dd --- /dev/null +++ b/wp-content/themes/score/lib/buddypress/search-buddypress.php @@ -0,0 +1,183 @@ +current_component == BP_SEARCH_SLUG)//if thids is search page + bp_core_load_template(apply_filters('bp_core_template_search_template', 'search-single')); //load the single searh template +} + +add_action("advance-search", "bpmag_show_search_results", 1); //highest priority + +/* we just need to filter the query and change search_term=The search text */ + +function bpmag_show_search_results() { + //filter the ajaxquerystring + add_filter("bp_ajax_querystring", "bpmag_global_search_qs", 100, 2); +} + +//show the search results for member*/ +function bpmag_show_member_search() { + /*if (!bp_has_members( bp_ajax_querystring( 'members' ) ) ) : return; endif;*/ + ?> +

    +
    + + + total_member_count > 18): ?> + total_member_count), "bpmag"); ?> + +
    +
    +
    + + +

    +
    + + + total_group_count > 18): ?> + total_group_count > 18), "bpmag"); ?> + +
    +
    +
    + + +

    + +
    +

    +
    +
    +
    + + query; + $cat_concerts = get_category_by_slug(CONCERTS_CATEGORY_SLUG); + $cat_musicnews = get_category_by_slug(MUSICNEWS_CATEGORY_SLUG); + if ($cat_concerts && $cat_musicnews) : + $args['cat'] = implode(',', array($cat_concerts->term_id, $cat_musicnews->term_id)); + query_posts($args); + endif; + ?> +
    + +
    +
    + + +

    +
    + + +
    +
    +
    + +

    +
    + + +
    +
    +
    + + current_component == BP_SEARCH_SLUG) + return true; + return false; +} + +//show forums search +function bpmag_show_dedications_search() {?> +

    + +
    +

    +
    +
    +
    + + + query; + $args['category_name'] = DEDICATION_CATEGORY_SLUG; + query_posts($args); + ?> + +
    + +
    +
    +
    + + \ No newline at end of file diff --git a/wp-content/themes/score/lib/scripts/custom.php b/wp-content/themes/score/lib/scripts/custom.php index a1b1657..5c92623 100644 --- a/wp-content/themes/score/lib/scripts/custom.php +++ b/wp-content/themes/score/lib/scripts/custom.php @@ -2,7 +2,7 @@ jQuery(document).ready(function(){ - jQuery('.wp-pagenavi a').live('click', function(e){ + jQuery('.home-page .wp-pagenavi a').live('click', function(e){ e.preventDefault(); link = jQuery(this).attr('href'); jQuery('#content').html('Loading...'); diff --git a/wp-content/themes/score/members/members-loop.php b/wp-content/themes/score/members/members-loop.php index 9c3a30b..d751f85 100644 --- a/wp-content/themes/score/members/members-loop.php +++ b/wp-content/themes/score/members/members-loop.php @@ -14,6 +14,7 @@ +