Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 31 total)

  • David
    Participant

    @dlabbe

    yes thanks…I was looking at it earlier and starting to get a feel for it. I only wanted to ask as with everything there seems be more then one way to do everything and was hoping there might be a neat little trick BP had up its sleeve. Thanks for the reply.


    David
    Participant

    @dlabbe

    @boonebgorges thought I would rehash this old post as what I need applies. How do i validate custom fields that I added?


    David
    Participant

    @dlabbe

    @gerbilo ….I agree…you would think group id would be the easiest to deal. From what I am guessing and hearing it might get easier as new version of BP surface. No complaints however…BP rocks in many ways as social webbing has taken over.


    David
    Participant

    @dlabbe

    To extend on Travel-Junkie
    `$group = new BP_Groups_Group( $group_id );
    foreach ($group as $key => $value)
    {echo $key . ‘ = ‘ . $value. ‘‘;}`

    this will break down in list form all the information you need for the group.
    Here is another nice little trick that works hand in hand with information returned from the above script. Lets say you want to show an excerpt from the groups description .
    This passes the description in the bp_create_excerpt() function as well as set how many words you want returned…then echo out the results.
    `$description = $group -> description;
    $descibe_excerpt = bp_create_excerpt( $description, 20 );
    echo $descibe_excerpt;`


    David
    Participant

    @dlabbe

    thanks guys. As it stands I already have a custom page that I created that has a zip code search( by mile radius)….it loops and displays thru all the groups within that radius. I had to reconstruct the look and feel of the groups directory page into this custom search page. Works really well, but it would also be much better blended into the existing directory page…so at this time I guess I will have to wait till the new release comes.
    Any ideas when it will be released?


    David
    Participant

    @dlabbe

    thanks that worked great for a single group to show with the slug $arg. Is there a way to pass more then one group into it. Meaning I want more then one group to be returned?


    David
    Participant

    @dlabbe

    @boonebgorges sorry to bother you again…but do you have any ideas how this can be done or a direction to go in? thanks


    David
    Participant

    @dlabbe

    @boonebgorges I know this is a old thread, but it is exactly what I am looking for, but it is not working for me. I should say it is working, but I can’t get one parameter to work. I am using the bp_has_groups() to filter the groups loop and I need to only display certain groups either by id’s (which does not seem to be a option other the user_id) or by slug which will work, but it does not for what ever reason. I am building a search function that will search for groups within a radius of a zip code entered in by the user. My search code is not in play yet so that is not causing the issue…just trying to find a way to hook my search code into a query for the loops page and the slug option looks to be the only way unless I can use group_id’s somehow. This is how I used the slug as parameter.
    `$args = array(
    ‘slug’ => ‘group_slug’,
    ‘max’ => 3,
    ‘user_id’ => $user_id);
    if ( bp_has_groups ( $args ) ) { …’

    I looked in the data base for the slug name in the bp_groups table. Not sure if that is right, but it is not working. Like I said though…the other parameters seem to work.
    Thanks for any help you can give me.
    David


    David
    Participant

    @dlabbe

    is there anyone that might be able to at least lead me in the right direction?


    David
    Participant

    @dlabbe

    can anyone help with this? how does fugly default avatars randomly happen?


    David
    Participant

    @dlabbe

    Great…thanks. How would i go about making random avatars? say have half dozen images that are randomly used so the whole site does not have the same avatar. I am new to php but i am assuming it would use a script or function that would call a random event or something like that.


    David
    Participant

    @dlabbe

    I final got what I was looking for. Here is the code if anyone wants to try it or use it. Paste it in the functions.php of your child themes. What it does is removes the orginal function for the “My Blogs” link in the admin bar and I then made my own function that calls that original function only if the user has a blog. Thus anyone that is just a subscriber to the site will not see the “My Blogs” link in the admin bar (to confuse them).

    /* Removes the function from the buddypress/bp-core/bp-core-adminbar.php file in buddypress plugin*/
    remove_action(‘bp_adminbar_menus’, ‘bp_adminbar_blogs_menu’, 6);
    
    /*reset the “MY Blogs” link function so that it only shows for users that have blogs and not subscribers*/
    function bp_adminbar_mynew_blogs_menu() {
    global $bp;
    
    if ( !is_user_logged_in() || !function_exists(‘bp_blogs_install’) )
    return false;
    
    if ( !$blogs = wp_cache_get( ‘bp_blogs_of_user_’ . $bp->loggedin_user->id . ‘_inc_hidden’, ‘bp’ ) ) {
    $blogs = bp_blogs_get_blogs_for_user( $bp->loggedin_user->id, true );
    wp_cache_set( ‘bp_blogs_of_user_’ . $bp->loggedin_user->id . ‘_inc_hidden’, $blogs, ‘bp’ );
    }
    
    echo ‘
    loggedin_user->domain . $bp->blogs->slug . ‘/”>';
    
    _e( ‘My Blogs’, ‘buddypress’ );
    
    echo ‘‘;
    echo ‘
    
        ‘;
    
        if ( is_array( $blogs ) && (int)$blogs ) {
        $counter = 0;
        foreach ( (array)$blogs as $blog ) {
        $alt = ( 0 == $counter % 2 ) ? ‘ class=”alt”‘ : ”;
        $site_url = esc_attr( $blog->siteurl );
    
        echo ‘
        ‘;
        echo ‘‘ . esc_html( $blog->name ) . ‘‘;
    
        echo ‘
            ‘;
            echo ‘
            ‘ . __( ‘Dashboard’, ‘buddypress’ ) . ‘
    
            ‘;
            echo ‘
            ‘ . __( ‘New Post’, ‘buddypress’ ) . ‘
    
            ‘;
            echo ‘
            ‘ . __( ‘Manage Posts’, ‘buddypress’ ) . ‘
    
            ‘;
            echo ‘
            ‘ . __( ‘Manage Comments’, ‘buddypress’ ) . ‘
    
            ‘;
            echo ‘
    
        ‘;
    
        echo ‘
    
        ‘;
        $counter++;
        }
        }
    
        $alt = ( 0 == $counter % 2 ) ? ‘ class=”alt”‘ : ”;
    
        if ( bp_blog_signup_enabled() ) {
        echo ‘
        ‘;
        echo ‘root_domain . ‘/’ . $bp->blogs->slug . ‘/create/”>’ . __( ‘Create a Blog!’, ‘buddypress’ ) . ‘‘;
        echo ‘
    
        ‘;
        }
    
        echo ‘
    
    ‘;
    echo ‘
    
    ‘;
    
    }
    
    /*checks to see if the logged in user has any blogs. Saves the array values to $blogs and then saves the blog count to $blogcount. The IF statement then will be true if the value is 1 or more thus showing the link in the admin panel for the “My blogs”*/
    $blogs = bp_blogs_get_blogs_for_user( $bp->loggedin_user->id );
    $blogCount = ($blogs);
    
    if ( bp_core_is_multisite() && $blogCount >= 1){
    add_action( ‘bp_adminbar_menus’, ‘bp_adminbar_mynew_blogs_menu’, 6 );
    }
    

    If anyone has a better (cleaner) way to do this please I would love to see it. I am just in the early stage of learning php so any help would be great. Thanks


    David
    Participant

    @dlabbe

    @travel-junkie thanks for the reply. I will get it this week for sure. I tried getting the signup plugin, but every time i tried to log on in the processing checkout it did not recognize my username or password…any ideas?


    David
    Participant

    @dlabbe

    @travel-junkie I am in the united states and would love to purchase the plugin. I went to the site and tried but it kept asking for a domain license when I tried to add it to the cart. What is that? and do I need it? also what is the conversion rate for US dollars? thanks


    David
    Participant

    @dlabbe

    @boonebgorges I got it working….it was white space in the php. I did a search and others had the same issue. Something so small can turn into hours of hair pulling. I am for sure getting a crash course in php, but loving it. Thanks again and I think everything is the way I need it for now…but then again I still need much more testing under all possibilities.


    David
    Participant

    @dlabbe

    @boonebgorges works perfect! thanks. I have hopefully one last issue that completely has me stumped. It works on my testing machine, but when I put it live I get errors. It has to do with me including the above idea but using my own custom data table. I insert my own form and add it with the function like above and put my own processing in the save function like above using the standard insert/update sql pointing to the new table for the form. It works on my local machine, but when I upload it live and click on ” create group” i get the following error….sorry for all the code

    Warning: Cannot modify header information – headers already sent by (output started at /home/clubmash/public_html/wordpress/wp-content/themes/chatCaddie_theme/functions.php:141) in /home/clubmash/public_html/wordpress/wp-content/plugins/buddypress/bp-groups.php on line 1053

    Warning: Cannot modify header information – headers already sent by (output started at /home/clubmash/public_html/wordpress/wp-content/themes/chatCaddie_theme/functions.php:141) in /home/clubmash/public_html/wordpress/wp-content/plugins/buddypress/bp-groups.php on line 1054

    Warning: Cannot modify header information – headers already sent by (output started at /home/clubmash/public_html/wordpress/wp-content/themes/chatCaddie_theme/functions.php:141) in /home/clubmash/public_html/wordpress/wp-includes/pluggable.php on line 890

    I am working in a child theme and I am at my ends trying to fix this. I am so close to what I want to do I just would hate to give up now. thanks for any tips you can give me.


    David
    Participant

    @dlabbe

    @boonebgorges Once again thanks for the help. I used the code above but noticed that the database dose not take in the data when the group is created. It will only work if once the group is created and then I re-enter the information in the “country” form and the submit that the database updates with the new information. My only thought is that when the group is being created it yet has an ID so it causes an issue. Any thoughts?


    David
    Participant

    @dlabbe

    @boonebgorges My plan has hit a snag. I am having trouble using what you gave me above to include more then one set of form markups. Let me explain…if I include something like

    function bbg_extra_group_fields_markup() {
    ?>

    this form is for a new data table that I created
    }
    add_action( ‘groups_custom_group_fields_editable’, ‘bbg_extra_group_fields_markup’ );

    function bbg_save_extra_group_details() {

    // form 1 processing goes here with insert/update
    }
    add_action( ‘groups_group_details_edited’, ‘bbg_save_extra_group_details’ );
    add_action( ‘groups_create_group_step_save_group-details’, ‘bbg_save_extra_group_details’ );

    The above formula works great! I created a new table and I am able to populate it with no issues. Now..this is where things get messy and I am having trouble trying to figure a way around it. I want to duplicate the same code above with another table for separate settings. I am using jquery show/hide to show the form that is needed for the desired group settings. Another words Group A gets one type of settings and Group B gets another inputing the data to their own data table. So if i duplicate the code above twice the processing clashes…meaning if both groups have a table field with the same name things get a little messed up processing. Is there a way to group the code for Group A and Group B? meaning ” function bbg_save_extra_group_details()” for Group A belongs to “function bbg_extra_group_fields_markup()” of Group A. I am thinking “if” statements but then not sure. I know it sounds confusing but again any ides would be greatly appreciated. Also forgot to mention that when I duplicated the functions for Group B I did name it something new. Thanks


    David
    Participant

    @dlabbe

    sorry yes bp-custom.php. That was a bad on my part in the post. I used “bp” in the site. I think i will just keep things the way they are as they are working. Thanks again.


    David
    Participant

    @dlabbe

    @boonebgorges thanks for the help! My php skills have increased a notch from just playing with this….not to mention of having a better understanding of BP. I used the trick above, but put a major twist on it. I took it to a new level and created new tables within the database so I can organize all the extra setting I am adding to groups. Thanks again. Just wanted to ask however….I am including the functions in my child theme as the bg-custom.php in the plugins did not work for what ever reason. Is it ok to use the functions.php in the child theme? Do you know why the bg-custom.php would not work in the plugins folder?


    David
    Participant

    @dlabbe

    Just tested it. I made a functions.php in my child theme and it works….well not really. I have the extra form field showing, but it is not working. I added the extra field to the database, but it is not working. I will have to test it more, but at least I now have some what of a clue of how BP works. I will play with it more before asking anymore questions….thanks for your help!


    David
    Participant

    @dlabbe

    thanks so much for the reply. The code all makes sense…. just a question of where to insert it? I am working with a child theme so can I create a custom function.php file within my child theme? Also…is that all it will take is to insert the functions into the functions.php file(if that is where to insert them)?


    David
    Participant

    @dlabbe

    any help would be greatly appreciated…thanks


    David
    Participant

    @dlabbe

    not sure that helps. I will try to explain. I want to build a directory of the groups as such. Country—->State—>County—>store location. I would like each to be its own group as well…meaning I want people to be able to join the State, County, and store location as groups they can join. Is there anyone that can lead my in the right path to make this work?


    David
    Participant

    @dlabbe

    can someone please spend a few moments to explain this? I am in much need for any assistance…thanks.

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