Helping you Build Your Own Social Network!

Faster, better and easier!

Creating a Unified Search From Different Search Bar

(49 posts) (5 voices)
  • Started 2 years ago by gregfielding
  • Latest reply from Rob Kennedy

Tags:

No tags yet.


  1. hi Greg
    I am sorry to hear that.
    They way they have done the theme/response of wpmudev seems well written crap to me. A theme should make clear reference of what it is doing. And including the things like this should never create any issue. It is the theme which the culprit.

    To remind them, you may point them to this thread, or let them know, this is not a plugin, it is a code snippet which is used in theme to allow global search.

    If you want, give me access to the theme, I will modify it and see why it is not working. Do you have a test site/blog where you can give me access to this and I can modify.

    Please let me know.

    Thanks
    Brajesh

    Posted 2 years ago #
  2. And Just to note down, their usage of function.php is inappropriate if the things we have discussed in this thread are correct.

    Posted 2 years ago #
  3. Possible clue...

    When pressing about possible different functions.php functions, I got this response...

    You have to understand and if you look at our code you would we basically since Daily have implemented a system where we keep the buddypress core files as clean and apart as possible.. this is what the library/ section is about and the functions.php calls - which are VALID and not invalid as was wrongly claimed by the snippet developer.

    Now, the only thing we 'do' differently but a ton of other themes do is we reference in functions.php:

    //load buddypress default functions//
    if($bp_existed == 'true') {
    require_once(DEVLIB . '/functions/bp-functions.php' );
    }

    What this basically means is 'call in the file here of bp-functions.php'.. bp-functions.php contains ALL of the core buddypress functions and 'bits' that are in the default theme for buddypress. Why do we do this? Several reasons:

    1. Future compatibility: we can upgrade to new version of buddypress without many file changes so can make sure you get updates faster
    2. We can make sure themes do not just have to run on buddypress, wordpress or wordpress mu but can run on all.

    Not sure what to make of all of this. I appreciate your offer to help look at my code (and I know you are slammed right now). Would you need to access a totally separate install? Or could I just give you cpanel/admin access?

    What's easier for you?

    Posted 2 years ago #
  4. hi Greg
    well, I appreciate their response. My point was, if the updates are concerned this is why parent/child theme are made for. You don't need to include the things manually[the above code snippet they have provided will not load the code you edited automatically in sub blogs until and unless something is done very DIFFERENTLY), but again, there may be confusions because of the posts in this thread as I have not seen their code.

    Anyway, I believe, our goal is to help you/anyone who needs and not to give you some reasons and say you should be contacting ABC/xyz.

    As I told earlier, yes, please give me access to any of the install, I just need ftp access to theme and the wp-admin(In case something goes wrong, otherwise wp-admin access is not required).
    Please let me know which ever is easy for you(Please PM me the details, do not publish here the credentials).
    I will check and fix it and will certainly get to know what was wrong.

    Posted 2 years ago #
  5. @Brajesh

    Thanks for the above. Silly me, of course I should link to the permalink - and I even had a strong indication of that fact on line 28 of search-loop.php where the excerpt is linked!

    I should study more... then ask questions when I get lost :-)

    One thing though, the code should read as follows:
    <h3 class="post-title"><a><?php the_permalink();?>"><?php the_title();?></a></h3>

    Posted 2 years ago #
  6. hi Patrick
    You are most welcome :)

    No the above code is not correct, the_permalink() simply return the link url, but we need an anchor tag, right.
    so we wrap it as

    <h3 class="post-title"><a href="<?php the_permalink();?>"><?php the_title();?></a></h3>

    Hope that helps.

    Posted 2 years ago #
  7. Hi Brajesh,

    Oops, my string got mangled... :-(

    I was referring to the ;? which is missing from <?php the_permalink()"> in your first post.

    Thanks again!

    Posted 2 years ago #
  8. hi sorry,
    yes, I had missed that.

    Posted 2 years ago #
  9. @greg
    I have updated your thme, Please check it working here
    http://housingstorm.com/search/?s=greg

    The problem was name conflict in parent/child theme functions.php[you had added the functions twice]

    It should be working well now.

    Thanks
    Brajesh

    Posted 2 years ago #
  10. Brajesh,

    I've got the search to work (somehow???)

    But I still have the issue code appearing in functions.php of the parent theme and crashing the site.

    The code that appears is from your snip:

    //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($qs){
    if(bpmag_is_advance_search())
    return "search_terms=".$_REQUEST['s'];

    return $qs;

    }

    function bpmag_is_advance_search(){
    global $bp;
    if($bp->current_component == BP_SEARCH_SLUG)
    return true;
    return false;
    }

    Is there any way to edit this snip somehow so it wouldn't mess up things if it did get inserted in the parent file?

    Posted 2 years ago #
  11. Hi Greg
    I am not sure whether we should find a work around for this or not. The problem is, I am still not sure why the functions/code we put in child theme's functions.php gets copied automatically to parent theme's functions.php. It is highly unexpected behaviour. and I guess, It is not your theme but something else causing this.
    Still, please ask the question I sent you 2 days ago to wpmudev(whether it is expected by theme or not), I can provide you better code in that case.

    A final recourse will be, I will pack these functions as plugin(well I am leaving right now, but the very first thing I will do tomorrow, and that will make it).

    Posted 2 years ago #
  12. IT WORKS IT WORKS IT WORKS!!!

    A theme update just came out and it fixed the problem!

    THANK YOU BRAJESH!

    Check it out:
    http://housingstorm.com/2010/05/powerful-new-search-so-visitors-can-find-you/

    Posted 2 years ago #
  13. Scratch the enthusiasm. It just happened again. I was thinking we were ok because about 6 hours had passed.

    In talking with wpmudev, no...this isn't supposed to happen.

    A plugin would rock, of course...

    Posted 2 years ago #
  14. hi Greg
    No problem, I will put a plugin and we can get rid of this unexpected issue. I will be putting it today(tomorrow for you :)) when I will back to work again.

    Posted 2 years ago #
  15. @Brajesh or @gregfielding

    I am using the same theme (latest version) and through this thread have managed to get the main search bar to do a unified search. However, I have the same problem with everything showing instead of filtering just what was searched for.

    I have put the functions.php in my child theme - haven't checked to see if other sites are affected yet.

    I don't see what the solution to this was. Was it ever resolved?

    Also how do I get rid of the search bar on the side once the main search bar is functional?

    Posted 1 year ago #
  16. @Brajesh

    Don't worry about the sidebar search I have found how to turn that off.

    The odd thing is that a search in that box produces the correct results, but the search in the header doesn't. I realise this is a theme issue, I just don't know how to resolve it.

    Posted 1 year ago #
  17. Hey Brajesh. I am having a similar problem to Gregs. It seems like all the Buddypress related stuff in the search results is coming up screwy.

    Take a look...

    http://www.friendesha.com/?s=Jim

    Instead of showing members/activity/etc from someone with Jim in their name/post, I am getting ALL members, activity, etc.

    I am using the WooTheme Continuum.

    I didn't see any kind of solution for Greg's problem, I know you went in and fixed it manually. I was wondering what you had to change though?

    Let me know what other info you need, I will post code to pastebin, just ask.

    Rob

    Posted 2 months ago #
  18. Hope you had a great weekend Brajesh. Hope we can get around to this sometime this week!

    Thanks in advance.

    Posted 2 months ago #
  19. Hey Brajesh, I actually figured it out! It was an issue with the theme search. I had to make a few changes, but nothing major.

    Take a look...

    Old Search...

    <div class="search_main fr">
    <form method="get" class="searchform" action="<?php echo home_url( '/' ); ?>" >
    <input type="text" class="field" name="s" id="s" value="<?php esc_attr_e( 'Search...', 'woothemes' ); ?>" onfocus="if (this.value == '<?php esc_attr_e( 'Search...', 'woothemes' ); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php esc_attr_e( 'Search...', 'woothemes' ); ?>';}" />
    <input type="image" src="<?php echo get_template_directory_uri(); ?>/images/search-btn.png" class="submit" name="submit" />
    </form>
    <div class="fix"></div>
    </div>

    New Search...

    <div class="search_main fr">
    <form action="<?php echo bp_search_form_action() ?>" method="post" id="search-form" class="searchform">
    <input type="text" id="search-terms" name="search-terms" value="<?php esc_attr_e( 'Search...', 'woothemes' ); ?>" onfocus="if (this.value == '<?php esc_attr_e( 'Search...', 'woothemes' ); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php esc_attr_e( 'Search...', 'woothemes' ); ?>';}"/>
    <?php echo bp_search_form_type_select() ?>
    <input type="image" src="<?php echo get_template_directory_uri(); ?>/images/search-btn.png" class="submit" name="submit" />
    <?php wp_nonce_field( 'bp_search_form' ) ?>
    </form>
    <div class="fix"></div>
    </div>

    It seems to me that the error was in the form, whether the action, method, id, I dont know. But after fooling around for the past couple days I was finally able to get something that worked.

    Thanks for the unified search, glad I got it working on my own! I feel accomplished. :) haha.

    Posted 2 months ago #

Reply

You must log in to post.