View';
}
}
}
/**
* Show user profile data.
*
*/
public static function show_data( $array, $subTable = false ) {
$html = '';
if ( $subTable ) {
$html .= '
';
$count = 1;
foreach ($array as $temp) {
$html .= ' $val) {
if ($key == 'id') {
continue;
} elseif ( $key == 'wp_users_id' ) {
continue;
} else {
$html .= '| ' . $val . ' | ';
}
}
$html .= '
';
$count++;
}
$html .= '';
} else {
$html .= '';
$count = 1;
if (isset($array[0])) {
foreach ($array[0] as $key => $value) {
if ($value != '') {
if ($key == 'id') {
continue;
}
if ($key == 'wp_users_id') {
continue;
}
if($key == 'hirable'){
$key = 'hireable';
}elseif($key=='number_of_recommenders'){
$key = 'NumRecommenders';
}
$html .= ' 1 ? implode(' ', $keyParts) : ucfirst( $key ) ) . '| ' . $value . ' |
';
$count++;
}
}
}
$html .= '
';
}
return $html;
}
/**
* Prepare profile data html to print
*/
public static function prepare_profile_data( $userId ) {
global $wpdb, $lr_social_profile_data_settings;
$noProfileData = true;
$html = '
';
return $html;
}
// get user profile data
public function get_profile_data() {
global $pagenow;
if ( isset( $_GET['user_id'] ) ) {
$userId = trim( $_GET['user_id'] );
} else {
global $user_ID;
$userId = $user_ID;
if ( $userId < 1 ) {
return 'Please login to see your profile data';
}
}
if ( isset( $_GET['user_id'] ) || $pagenow == 'admin.php' ) {
echo self::prepare_profile_data( $userId );
if(isset( $_GET['user_id'] )){
die;
}
} else {
wp_enqueue_style( 'lr_profile_data_front_style', LR_ROOT_URL . 'lr-social-profile-data/assets/css/lr_profile_data_front_style.css' );
return self::prepare_profile_data( $userId );
}
}
/**
* Add the LoginRadius menu in the left sidebar in the admin
*/
public function user_admin_menu() {
global $lr_social_profile_data_settings;
if ( isset( $lr_social_profile_data_settings['display_UserProfileData'] ) && $lr_social_profile_data_settings['display_UserProfileData'] == 1 && ! is_super_admin() ) {
add_menu_page( 'LoginRadiusProfile', 'Social Profile Data', 'read', 'loginradius-profile', array( $this, 'get_profile_data' ), LR_ROOT_URL . 'lr-core/assets/images/favicon.ico' );
}
}
}
}