Re: Purely Genius Way to Add Custom Profile Fields
I’ll try to set a little plugin or something later, but for the moment you can follow this method, it’s the Fishbowl81’s code adapted for ebay editor kit:
Edit your bp-xprofile-filters.php by placing the following code after the custom buddypress filters:
/* Display ebay listings field */
function bp_profile_ebay_display( $field_value "", $field_type = "", $field_id = "" ) {
{ // clean up input
return "<script language='JavaScript' src='http://lapi.ebay.com/ws/eBayISAPI.dll?EKServer&ai=lwa%7Bfwvw%7Esa%7Cwsyw%60&bdrcolor=CCCCCC&cid=0&eksize=1&encode=UTF-8&endcolor=FF0000&endtime=n&fbgcolor=FFFFFF&fntcolor=000000&fs=0&hdrcolor=FFFFFF&hdrimage=1&hdrsrch=n&img=y&lnkcolor=75179C&logo=3&num=5&numbid=n&paypal=n&popup=n&prvd=9&r0=4&shipcost=n&si=".addslashes($field_value)."&sid=BP&siteid=0&sort=MetaEndSort&sortby=endtime&sortdir=asc&srchdesc=n&tbgcolor=FFFFFF&tlecolor=FFFFFF&tlefs=0&tlfcolor=000000&toolid=10004&track=5336248810&watchcat=63850&width=350'></script>";
}
}
function bp_profile_ebay_groups( $group_name "") {
if($group_name == "My Ebay listings"){
remove_filter( 'bp_the_profile_field_value', 'xprofile_filter_link_profile_data', 2);
add_filter( 'bp_the_profile_field_value', 'bp_profile_ebay_display', 2, 3);
}else{
add_filter( 'bp_the_profile_field_value', 'xprofile_filter_link_profile_data', 2, 3);
remove_filter( 'bp_the_profile_field_value', 'bp_profile_ebay_display', 2);
}
return $group_name;
}
add_filter( 'bp_the_profile_group_name', 'bp_profile_ebay_groups', 10, 1 );
Also it depend of your css code but it can be useful to put this in your member theme’s stylesheet (base or your custom stylesheet).
td.data table td{
margin:0px;padding:0px;
Then create a profile field group named “My Ebay listings” and a profile field like ebay username and you’re done!