Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • Biswadip
    Participant

    @biswadip

    Thanks for your help it all works fine on Chrome and Firefox now – I was testing on IE8 as that is what our clients are using.


    Biswadip
    Participant

    @biswadip

    In the above the line
    bp_has_members(array('search_terms' => $search_term))

    is actually
    bp_has_members(array('search_terms' => $search_value))


    Biswadip
    Participant

    @biswadip

    Thank you that was very helpful.

    How do I submit a query from the members search form to bring up the appropriate listing in the manner mentioned above? At the moment I can only search for members when the search form submits to the members directory. What I want to do is that when a user submits a search query from a search form on this page:

    http://website/custom-page/

    the results from the query:

    http://website/members/?s=term-searched-for

    are displayed on the same custom page hosting the search form:

    http://website/custom-page/

    I have tried setting the search form action attribute like so:

    form action = ""

    but this creates the query:

    http://website/custom-page/?s=term-searched-for&members_search_submit=Search

    and the result is a 404 page not found.

    I have been reading in some places eg:
    here and here that buddypress redirects search queries so I need to override that redirection and I have attempted doing so without much success.

    My search form looks like this:

    	<div id="members-dir-search" class="dir-search bp-index-search" role="search">
                <?php //bp_custom_directory_members_search_form(); 
                $default_search_value = bp_get_search_default_text( 'members' );
                $search_value = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; ?>
    
                    <form action="" method="get" id="search-members-form">
                        <label><input type="text" name="s" id="members_search" placeholder="<?php echo esc_attr( $search_value ) ?>" /></label>
                        <input type="submit" id="members_search_submit" name="members_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
                    </form>
    
    	</div>

    I check to see if the form has been submitted:

    <?php if(isset($_REQUEST ['members_search_submit'])){ ?>

    and then, following @Slave UA’s suggestion, I have copied and pasted the code from the “members-loop.php” file to my page template and I then changed

    bp_has_members( bp_ajax_querystring( 'members' )

    to

    bp_has_members(array('search_terms' => $search_term))

    If I hardcode the search term then it works but it does not seem to accept the search term submitted through the search form.

    Any help greatly appreciated.


    Biswadip
    Participant

    @biswadip

    Sorry I put my customised members search function above instead of the groups search but essentially I have the same problem with both the members and the groups search.


    Biswadip
    Participant

    @biswadip

    I put the bp_custom_directory_groups_search_form() function suggested by @meginfo into my functions file.

    But when I call it from a template it only works if I submit it to the members directory like this

    function bp_custom_directory_members_search_form() {
    
    	$default_search_value = bp_get_search_default_text( 'members' );
    	$search_value         = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; ?>
    
           <form action="<?php echo site_url() ?>/members/" method="get" id="search-members-form">
    		<label><input type="text" name="s" id="members_search" placeholder="<?php echo esc_attr( $search_value ) ?>" /></label>
    		<input type="submit" id="members_search_submit" name="members_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
    	</form>
    <?php
    }

    If I try to submit to the same page like this:

    form action=""

    of if I try and submit it to the full path of the file I get a 404 not found message.

    How should I submit the function in order to have it give me the search results on the page I want?

    Thanks


    Biswadip
    Participant

    @biswadip

    We can then use a BBpress topic loop to loop with the forum id’s and save the data into arrays for further use like this:

       
    $forum_ids = bbp_get_user_subscribed_forum_ids( bp_loggedin_user_id() ) ;
    $topic_ids = bbp_get_user_subscribed_topic_ids( bp_loggedin_user_id() ) ;
    
    for ($n=0;$n < count($forum_ids); $n++) { 
    	if ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC',        'post_parent' => $forum_ids[$n], 'posts_per_page' => 10 ) ) ) :
    
                while ( bbp_topics() ) : bbp_the_topic();
                    array_push ($forums2array['title'], bbp_get_topic_title());
                endwhile; 
    
            endif;  
        }

    Biswadip
    Participant

    @biswadip

    OK I have got as far as you, identifying the bbpress object as the one for forum topics and replies.

    Now say that I have a list of forum and/or topic id’s. How do I get the topics for the forum id’s or the replies for the topic id’s?

    Best

    Bis


    Biswadip
    Participant

    @biswadip

    Good point @shanebp and thanks for the pointer! 🙂


    Biswadip
    Participant

    @biswadip

    The filter in the link posted by @mercime writes the forum data from the wp_posts table to the bp_activity table.

    So I suppose legacy posts could be transferred from one table to the other by writing the values from the columns of one table to the columns of the other.

    But the id of the same entry in the two tables are different so you would need to get the id of the last item in the bp_activity table and then increment the id’s for each new row added from the wp_posts table. I am not experienced enough to be able to estimate the difficulty of this task – does anyone else have any idea?


    Biswadip
    Participant

    @biswadip

    Thanks a lot @r-a-y and @mercime – I have the same issue as @jhave2 – any way of adding older topics and replies to the stream?

    Thanks


    Biswadip
    Participant

    @biswadip

    While I am sorry that @polokina never got an answer I would like to resurrect this thread as I have pretty much got stuck at the same dead end – bp_get_activity_action().

    I am trying, in my child theme, to i) store the activity feed (i.e. avatar, date, content, action, content body, comment/favourite/delete buttons) for a group in an array, in order to then ii) merge the array with another feed from a forum and iii) display the merged feed sorted by date. I think I should be able to do ii) and iii) but I don’t seem to be able to manage i).

    I believe what I should be doing in order to accomplish i) is to filter bp_get_activity_action() but I am not sure what the filter function to hook in should look like. Ideally I would like the function to take the activity feed as input and save that input in an array which I can then manipulate along the lines of ii) and iii).

    So what I would like (in pseudo-code) to insert into my functions.php file is something like:

    ‘add_filter( ‘bp_get_activity_action’, ‘new_activity_array’ );
    function new_activity_array(){
    // i) save the activity feed in an array
    // ii) manipulate the array
    // iii) output the modified array
    }

    As I said I think I can accomplish ii) and iii) so any kind pointers as how to go about accomplishing i) would be gratefully accepted.

    Thank you


    Biswadip
    Participant

    @biswadip

    Same happens to me.

    wp3.6.1, bp1.8.1.

    It only seems to happen when you are requesting membership for the private group from the page for the private group (http://www.example.com/groups/group-name/) but not if you are making the same request from the page for all the groups (http://www.example.com/groups/).

    The trac ticket mentioned above has a suggestion for changing bp-groups-screens.php but that did not work in my case.


    Biswadip
    Participant

    @biswadip

    You need something like this:

    <div id="tab2_login" class="tab_content_login">
    <div width = "300px"><h3 class="topline">Register for this site!</h3>
    </div>
    <!--<div id="tab1_login" class="tab_content_login" style="margin-left: 560px;width: 130px;margin-top: -20px;">Back to login</div>-->
    <p>Sign up now for the good stuff.</p>
    <form method="post" action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" class="wp-user-form">
    <div class="username">
    <label for="user_login">Username: </label>
    <input type="text" name="user_login" value="" size="20" id="user_login" tabindex="101" />
    </div>
    
    <div class="email">
    <label for="user_email">Your Email: </label>
    <input type="text" name="user_email" value="" size="25" id="user_email" tabindex="102" />
    </div>
    
    	<div class="login_fields">
    
    	<?php do_action('register_form'); ?>
    <p class="login-submit">
    <input type="submit" name="user-submit" id="wp-submit" value="Sign up" class="user-submit" tabindex="103" />
    </p>
    <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>?register=true" />
    <input type="hidden" name="user-cookie" value="1" />
    		</div>
    	</form>
    </div>

    Biswadip
    Participant

    @biswadip

    Hi Loueze it should work:

    <?php if ( bp_has_activities( ‘max=10’ ) ) : ?>

    Maybe you got confused by the quote marks in danbpfr’s otherwise helpful contribution? 🙂


    Biswadip
    Participant

    @biswadip

    Yes – is there a way of displaying a tally of the number of friends requests one has rather than having to click the “Requests” tab to find this out?

    Best

    Bis


    Biswadip
    Participant

    @biswadip

    Thank you thank you @cpagan200 and @halo-diehard – you have saved me hours of perplexment and bemusement with your germane intervention.

Viewing 16 replies - 1 through 16 (of 16 total)
Skip to toolbar