Skip to:
Content
Pages
Categories
Search
Top
Bottom

show search form or link to search.php on home page

  • Where is the documentation on implementing a search from the first page of bbpress? Or could someone tell me how to do it? Thank you.

Viewing 12 replies - 1 through 12 (of 12 total)

  • ardentfrost
    Member

    @ardentfrost

    Like on my forums? http://www.rayd.org/forums/

    If so, I just searched through the code for the search form and found the function “search_form()” so I did this:

    <div>

    <h2><?php _e('Search'); ?></h2>

    <?php search_form(); ?>

    </div>

    Then you just take “search_form.php” out of your bb-templates folder, drop it in the my-templates folder and change the sizes to whatever you want.

    Yes- like on your forums. I found the “search_form.php” but I don’t know where I am looking for the function “search_form()” or exactly where I am to put the <div> code.

    Sorry to be so dense on this.

    What I did on my own install was open up the front-page.php and place it over the tag code. My code looks like the following:

    <div id="hottags">

    <?php search_form( $q ); ?>

    <h2><?php _e('Hot Tags'); ?></h2>

    <p class="frontpageheatmap"><?php tag_heat_map(); ?></p>

    </div>

    Hope this helps,

    -drmike


    ardentfrost
    Member

    @ardentfrost

    search_form() is in template-functions.php which is a core file. I just use windows search function to look inside files (you have to make a change in windows to do it) and just looked for probably something like “function search” and it found the code.

    Anyhow, copying the code I pasted and putting it wherever you want the search bar to show up should work. Once you get it showing up, it’ll take up most of the screen, so open search_form.php and change the sizes.

    Thank You!! got the results I wanted.

    so how come search isn’t enabled when you first install bb? It’s obviously there – but you have to add it in? What about some css for the style sheet?

    so how come search isn't enabled when you first install bb? It's obviously there - but you have to add it in? What about some css for the style sheet?

    ardentfrost’s way is good enough, though you can’t use search-form.php anymore for normal use any more. They implemented search at this forum as well, so how did they do it?


    mattpeckham
    Member

    @mattpeckham

    How do you make the search box itself smaller?


    mattpeckham
    Member

    @mattpeckham

    Duh, found it – search-form.php!

    how do I get the search button to line up with the search box and still have a working search function?

    never mind – got it.

    the old write out the problem to solve it trick!

    this is my coustom code in search-form:

    <form action="<?php bb_option('uri'); ?>search.php" method="get">
    <p><?php _e('Search:'); ?>
    <input type="text" size="70" maxlength="200" name="q" value="<?php echo attribute_escape( $q ); ?>" />
    <?php if( empty($q) ) : ?>
    <input type="submit" value="<?php echo attribute_escape( __('Search &raquo;') ); ?>" class="inputButton" />
    <?php else : ?>
    <input type="submit" value="<?php echo attribute_escape( __('Search again &raquo;') ); ?>" class="inputButton" />
    <?php endif; ?>
    </p>
    </form>

Viewing 12 replies - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.