Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • GRAQ
    Participant

    @graq

    It has indeed worked a treat. Seems very possible for someone to extend this into a csv-style upload (as there once was, by the looks of my searching).

    I am vaguely interested in how ‘uploading a spreadsheet into a database’ works :)


    GRAQ
    Participant

    @graq

    This does mean, however, that (as the search is in a side bar widget), those values a preselected in the search on the profile page.


    GRAQ
    Participant

    @graq

    Just for now, I have edited bp-profile-search bps_field_options filter function, adding:
    `if( is_user_logged_in() )
    if( bp_is_home() )
    return $html;`


    GRAQ
    Participant

    @graq

    Looking through the code it appears to be the bp-profile-search plugin that causes a conflict.

    profile/edit.php – `$html .= apply_filters( ‘bp_get_the_profile_field_options_select’, ‘name ) ) . ‘”>’ . stripslashes( esc_attr( $options[$k]->name ) ) . ”, $options[$k] );`

    bps-functions.php
    `
    add_filter (‘bp_get_the_profile_field_options_select’, ‘bps_field_options’, 99, 2);
    ….
    case ‘selectbox’:
    if ($option->name == $_POST[“field_$field->id”])
    $selected = ‘ selected=”selected”‘;
    else
    $selected = ”;

    $html = ‘name). ‘”>’.
    esc_attr ($option->name). ”;
    break;

    `

    Because no search parameters exist, the profile edit screen doesn’t show the selected drop down values.


    GRAQ
    Participant

    @graq

    Running WP 3.1 BP 1.2.8
    Have installed a search plugin where the drop downs are working.


    GRAQ
    Participant

    @graq

    @r-a-y I decided to munge in the external image file (continued in another topic)
    https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/load-external-file-as-avatar


    GRAQ
    Participant

    @graq

    @ultimateuser Do you mean write values directly into bp_xprofile_fields ?
    I wrote some dirty SQL to do just that.
    ` $insertsql = $wpdb->prepare(“INSERT INTO {$tablename} (group_id, parent_id, type, name, description, is_required, order_by, field_order, is_default_option, option_order ) VALUES (%d, %d, %s, %s, %s, %d, %s, %d, %d, %d )”, $group_id, $parent_id, $type, $region, ”, 0, ”, 0, 0, $option_order );`

    To be honest, I was hoping there would be a better way.


    GRAQ
    Participant

    @graq

    Super, so I’m now pulling it in with imagecreatefromjpeg(‘http://…’); and saving it with imagejpeg().
    Anyway to auto crop to get the images into a nice square shape?


    GRAQ
    Participant

    @graq

    The files are not loaded into the media library, but stored in wp-content/uploads/avatars/USER_ID/-
    I can do that. Is there a way I can make BP create the various sizes?


    GRAQ
    Participant

    @graq

    Tanks ray. That sets a default across the board. There is no way to point to individually sourced external images.

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