Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • sdls
    Member

    @simon_said

    Thanks for the help here’s a little snippet that checks for full name, and if none exists displays the username

    `
    /* Display Nice Name in Directory */
    function my_member_username() {
    global $members_template, $bp;
    $display_name = $members_template->member->display_name;
    if ($display_name) {
    return $display_name;
    } else {
    return $members_template->member->user_login;
    }
    }
    add_filter(‘bp_member_name’,’my_member_username’);

    `


    sdls
    Member

    @simon_said

    how bout these little dudes?… no idea what they do

    `

    `

    Really you could just resize the original thumbnails to 100px X 100px and allow BP to resize them, however you don’t also get the crispness you need when designing nice little icons.


    sdls
    Member

    @simon_said

    I’m coming across the same barrier… Pulling the group image at different sizes is fine, however when you try and modify the group avatar size from the group admin perspective, it get’s a bit tricky. Try and upload and small icon for a group and you will notice it puts the little logo on a black background and resizes it akwardly.

    Looking for something to hook onto to modify this setting and I can’t see anything pertaining to size in the BP template set

    `

    <input type="submit" name="upload" id="upload" value="” />

    ‘delete_group_avatar’, ‘component’ => ‘groups’, ‘wrapper_id’ => ‘delete-group-avatar-button’, ‘link_class’ => ‘edit’, ‘link_href’ => bp_get_group_avatar_delete_link(), ‘link_title’ => __( ‘Delete Avatar’, ‘buddypress’ ), ‘link_text’ => __( ‘Delete Avatar’, ‘buddypress’ ) ) ); ?>

    <img src="” id=”avatar-to-crop” class=”avatar” alt=”” />

    <img src="” id=”avatar-crop-preview” class=”avatar” alt=”” />

    <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="” />

    <input type="hidden" name="image_src" id="image_src" value="” />

    `

    Any thoughts on how to modify size, right from the upload process?


    sdls
    Member

    @simon_said

    Been looking for this everywhere and still cannot find an answer…. will post back if I find something concise.


    sdls
    Member

    @simon_said

    wow it really was the dots!


    sdls
    Member

    @simon_said

    Must have been a database caching problem…. damn internet gremlins!
    That first snippet worked as is with no changes…. just took 30 minutes to refresh
    Thanks for your feedback both.


    sdls
    Member

    @simon_said

    answer me this one oh BP gurus and I promise never to but you about xprofile_get_field_data() again! ;-)


    sdls
    Member

    @simon_said

    understood.. thanks again Boone!


    sdls
    Member

    @simon_said

    thanks @boonebgorges !

    WOW searching through all these new functions will be time consuming at first, but I’m sure will make things better over the long term. are these new to BP 1.5?

    I’m so used to just using SQL to solve my problems these seems way complicated… (above my head and slightly to the left) So let’s say I just want to check for the whether a record exists, is it suggested that these BP functions should be used for all database communication?

    for example… this checks for the existence of the field in the first place

    `
    $sql4 = “SELECT *
    FROM wp_bp_xprofile_data XP
    WHERE XP.user_id = $iUserID”;
    $acheck_for_user_xprofile = $wpdb->get_col( $wpdb->prepare($sql4));
    if ($acheck_for_user_xprofile) {
    $check_for_user_xprofile_answer = “yes“;
    } else {
    $check_for_user_xprofile_answer = “no”;
    }
    `


    sdls
    Member

    @simon_said

    Thanks both for the feedback!… looking into xprofile_insert_field() in bp-xprofile/bp-xprofile-functions.php. This appears to be the function for adding a new profile field to the BP system.

    `function xprofile_insert_field( $args = ” ) {
    global $bp;

    extract( $args );

    /**
    * Possible parameters (pass as assoc array):
    * ‘field_id’
    * ‘field_group_id’
    * ‘parent_id’
    * ‘type’
    * ‘name’
    * ‘description’
    * ‘is_required’
    * ‘can_delete’
    * ‘field_order’
    * ‘order_by’
    * ‘is_default_option’
    * ‘option_order’
    */

    // Check we have the minimum details
    if ( !$field_group_id )
    return false;

    // Check this is a valid field type
    if ( !in_array( $type, (array) $bp->profile->field_types ) )
    return false;

    // Instantiate a new field object
    if ( $field_id )
    $field = new BP_XProfile_Field( $field_id );
    else
    $field = new BP_XProfile_Field;

    $field->group_id = $field_group_id;

    if ( !empty( $parent_id ) )
    $field->parent_id = $parent_id;

    if ( !empty( $type ) )
    $field->type = $type;

    if ( !empty( $name ) )
    $field->name = $name;

    if ( !empty( $description ) )
    $field->description = $description;

    if ( !empty( $is_required ) )
    $field->is_required = $is_required;

    if ( !empty( $can_delete ) )
    $field->can_delete = $can_delete;

    if ( !empty( $field_order ) )
    $field->field_order = $field_order;

    if ( !empty( $order_by ) )
    $field->order_by = $order_by;

    if ( !empty( $is_default_option ) )
    $field->is_default_option = $is_default_option;

    if ( !empty( $option_order ) )
    $field->option_order = $option_order;

    return $field->save();
    }
    `
    All I really need to do is add a little record into the existing “wp_bp_xprofile_data” table

    This below code works however it’s definately not Open source friendly or BP friendly

    `

    // grab this users nicename

    $user = get_userdata( $iallusersUserID );
    $nicename = $user->user_nicename;
    $last_udpated = date(‘Y-m-d H:i:s’);

    // create a new record in bp_xprofile_data and add the nicename

    $wpdb->insert(
    ‘wp_bp_xprofile_data’,
    array(
    ‘field_id’ => 1,
    ‘user_id’ => $iallusersUserID,
    ‘value’ => $nicename,
    ‘last_updated’ => $last_udpated
    ),
    array(
    ‘%d’,
    ‘%d’,
    ‘%s’,
    ‘%s’
    )
    );
    `

    Any thoughts? Thanks again!


    sdls
    Member

    @simon_said

    Something like this

    `
    $sql = “SELECT *
    FROM wp_bp_xprofile_data XP
    WHERE XP.user_id = $iallusersUserID”;
    $xprofile = $wpdb->get_col( $wpdb->prepare($sql));
    `

    should probably more like this

    `
    $sql = “SELECT *
    FROM $wpdb->x_profile XP
    WHERE XP.user_id = $iallusersUserID”;
    $xprofile = $wpdb->get_col( $wpdb->prepare($sql));
    `

    Maybe this whole style of calling a custom SQL query is way of track? any suggestions?


    sdls
    Member

    @simon_said

    That’s seems to be it… regardless of BP activity or “last activity” the table wp_bp_xprofile_data is the lowest common denominator of who is displayed in the members directory.

    `
    $sql4 = “SELECT *
    FROM wp_bp_xprofile_data XP
    WHERE XP.user_id = $iUserID”;
    `


    sdls
    Member

    @simon_said

    Altough User A (ID:21) does show up in the table “wp_bp_xprofile_data”
    It would be great if there was some help in bp_has_members
    https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-members-loop/
    To reference these orphaned users with a state…. like “inactive”


    sdls
    Member

    @simon_said

    On this same topic…..In the members directory in BP 1.5 user are displayed based on more criteria then mentioned by the discussion above.

    User A (ID: 21) is showing up in the members directory but does NOT appear in the buddypress activity tables

    `
    $sql2 = “SELECT *
    FROM wp_bp_activity activity
    WHERE activity.user_id = $iUserID”;
    `

    OR the user_meta table

    `
    $sql3 = “SELECT *
    FROM wp_usermeta UM
    WHERE UM.user_id = $iUserID
    AND UM.meta_key LIKE ‘last_activity'”;

    `

    Any thoughts on what’s making these members appear in the directory?


    sdls
    Member

    @simon_said

    @boonebgorges – Correctamundo. The text field for “To” is blank rather then being populated with the username.

    @DJPaul – to get back to you on usernames see below

    User A – archon2112
    User B – Simon.delaSalle
    User C – Tim.Powell

    THANKS BOTH!


    sdls
    Member

    @simon_said

    SWEET youutube.com integration in the forumns!


    sdls
    Member

    @simon_said

    as @boone mentions have way through this:
    http://www.youtube.com/watch?v=PN7g0h8DPbE&feature=related
    for posertity’s sake


    sdls
    Member

    @simon_said

    cheers !!!! @johnjamesjacoby and @mercime


    sdls
    Member

    @simon_said

    aaaa….. IC what’s going on here…. previously on child themes you would include the BP default theme as an @import at the top of your child theme style.css this is no longer neccesary with the way BP 1.5 loads the style. Just removed the reference and everything works great….


    sdls
    Member

    @simon_said

    Appreciate the response John, so just to clarify.

    All child themes for Buddypress should reference their “style.css” using wp_enqueue_style() rather then the traditional WP style of including the style reference in the header.php file?


    sdls
    Member

    @simon_said

    that totally helped me @boonebgorges thanks!.

    I’m trying to do something quite similar to Von. My goal is to create a new page, just like the
    buddypress forumns / groups / achievements setup where you have a table of contents with “view all” and “my ____”.

    Trying to integrate post content with this same setup…. sort of a “Browse all Posts” … “Browse My Posts”…. in the same format. This is both to take advantage of those nice little ajax togglers that modify the loop based on the ajax query…. but also to maintain visual consistency across the site.

    Using page templates a new table of contents has been created for these posts “post/index.php” and “post/post-loop.php” using the exact same HTML and CSS as the BP template…. so it looks good… same format..

    So…. you can toggle between “All Posts” and “My Posts”… but of course, the HTML and

    id’s are hooked into the original ajax loop mods for forumn/index.php, so when you click on it it loads the original loop for “All Forumns” and “My Forumns”.

    So first off…. trying to understand the Ajax call FROM the page… and I need to create a NEW one that triggers “All Posts” and “My Posts” correctly when the links are clicked on… Looking through bp_dtheme_ajax_querystring() in bp-themes/bp-default/_inc/ajax.php… wow this looks complicated.

    creating another action?
    add_action( ‘wp_ajax_posts_filter’, ‘bp_dtheme_object_template_loader’ );

    ANy help would be greatly appreciated!


    sdls
    Member

    @simon_said

    This worked perfectly thanks @dennissmolek
    one suggestion for those following this path….
    in ovcbar.php you can’t copy and paste the whole bp-core-adminbar.php
    you have too manually go in and copy paste the code from within the functions.

    Don’t forget to wrap it in:

    echo ‘

    ‘;
    echo ‘

    ‘;
    echo “

    nn”;

    so it format’s right.. …..thanks again


    sdls
    Member

    @simon_said

    hey there @anointed… I guess the key reason why “group blog plugin” won’t work is that “group blog’s” are created and manage by site owners and groups admins and the control and creation of this content takes place in the wp-admin/ backend.


    sdls
    Member

    @simon_said

    Heres an example of what I’m trying to achieve:

    URL: http://emergineers.com.s26200.gridserver.com/groups/builders/forum/

    Conversation takes 2 forms….a quick discussion or a more in depth post called a “nugget” (just a placeholder name ;-)) with meta, taxonomy, commenting, and media associated.

    Thoughts?


    sdls
    Member

    @simon_said

    right on…. @anointed and @4ella… this does provide some more possibilities… and definately some useful code snippets looking into these plug-ins.

    Regarding the group blog plugin……..Implementing MU, P2 theme, and setting up “networks” might be a little overkill for this purpose…. as it looks like creation and editing of posts by group members is still limited in terms of being able to include meta fields and custom taxonomies, and would have to built from scratch regardless. As well the media manager and other WP publishing tools are not part of this plug-in / theme setup.

    my feeling that IF this extended functionality needs to be built ON TOP of MU / buddypress plug-in such as “groupblog” (which is an awesome plug-in by the way) things can get complicated quickly….. (and unnecessarily)…..

    So the cleanest solution so far seems to be matching posts to groups using taxonomy…. which Im sure we could agree could be improved upon greatly…..

    Thanks again for the feedback!

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