Forum Replies Created
-
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
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.
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;`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.
Running WP 3.1 BP 1.2.8
Have installed a search plugin where the drop downs are working.@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@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.
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?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?Tanks ray. That sets a default across the board. There is no way to point to individually sourced external images.