[buddypress-dev] modifications to bp-xprofile-templatetags.php
David J. Bisset
dbisset at dimensionmedia.com
Tue May 27 17:15:43 GMT 2008
Want some feedback on this. I needed to do some logic via php on my
homepage/profile page of each blog/account. The functions in
bp-xprofile-templatetags simply didn't give an option to return a
value, only output it. So i made the following changes:
function the_profile_field_name($inline = false) {
global $field;
//modified by David
if ($inline) {
return $field->name;
} else {
echo $field->name;
}
}
function the_profile_field_value($inline = false) {
global $field;
if ( bp_is_serialized($field->data->value) ) {
$field_value = unserialize($field->data->value);
$field_value = implode( ", ", $field_value );
$field->data->value = $field_value;
}
if ( $field->type == "datebox" ) {
$field->data->value = bp_format_time( $field->data->value, true );
}
//modified by David
if ($inline) {
return $field->data->value;
} else {
echo $field->data->value;
}
}
Area modified below the comments.
Thoughts? Better ways? Should we built this option into these functions?
--
David Bisset
Director of Web Development
Dimension Media, Inc.
www.dimensionmedia.com
http://www.linkedin.com/in/davidbisset
More information about the buddypress-dev
mailing list