* @link http://wp-dreams.com, http://codecanyon.net/user/anago/portfolio
* @copyright Copyright (c) 2014, Ernest Marcinko
*/
class wpdreamsBP_XProfileFields extends wpdreamsType {
private $selected;
private $types;
function getType() {
$profile_fields = $this->getProfileFields();
$pf_array = array();
foreach ($profile_fields as $pf)
$pf_array[$pf->id] = $pf;
parent::getType();
$this->processData();
$this->types = $profile_fields;
echo "
";
}
function getProfileFields() {
global $wpdb;
$table_name = $wpdb->base_prefix . "bp_xprofile_fields";
if( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name )
return $wpdb->get_results(
"SELECT * FROM $table_name LIMIT 200"
);
else
return array();
}
function processData() {
$this->data = str_replace("\n", "", $this->data);
if ($this->data != "")
$this->selected = explode("|", $this->data);
else
$this->selected = null;
}
final function getData() {
return $this->data;
}
final function getSelected() {
return $this->selected;
}
}
}