function get_profile_data($users_data)
 {
     $facewall_trunkwords = 7;
     $facewall_maxlength = 8;
     $out_data = array();
     $viewer_uid = 0;
     if (!empty(PA::$login_uid)) {
         $viewer_uid = PA::$login_uid;
     }
     $i = 0;
     foreach ($users_data as $user) {
         $u = new User();
         $u->load((int) $user['user_id']);
         $profile_data = User::load_user_profile($user['user_id'], $viewer_uid);
         $profile_data = sanitize_user_data($profile_data);
         $out_data[$i]['display_name'] = $u->display_name;
         $out_data[$i]['user_url'] = url_for('user_blog', array('login' => urlencode($user['login_name'])));
         $out_data[$i]['nickname'] = strlen($user['login_name']) > $facewall_maxlength ? substr($user['login_name'], 0, $facewall_trunkwords) . ' ...' : $user['login_name'];
         $city = ' ';
         if (!empty($profile_data['city'])) {
             $city = $profile_data['city'];
         }
         $out_data[$i]['location'] = $city;
         $age = ' ';
         if (!empty($profile_data['dob'])) {
             $age = convert_birthDate2Age($profile_data['dob']);
         }
         $out_data[$i]['age'] = $age;
         $sex = ' ';
         if (!empty($profile_data['sex'])) {
             $sex = $profile_data['sex'];
         }
         $out_data[$i]['gender'] = $sex;
         $physical_info_body_height = ' ';
         if (!empty($profile_data['physical_info_body_height'])) {
             $physical_info_body_height = $profile_data['physical_info_body_height'];
         }
         $out_data[$i]['height'] = $physical_info_body_height;
         $physical_info_body_weight = ' ';
         if (!empty($profile_data['physical_info_body_weight'])) {
             $physical_info_body_weight = $profile_data['physical_info_body_weight'];
         }
         $out_data[$i]['weight'] = $physical_info_body_weight;
         $physical_info_body_measurements = ' ';
         if (!empty($profile_data['physical_info_body_measurements'])) {
             $physical_info_body_measurements = $profile_data['physical_info_body_measurements'];
         }
         $out_data[$i]['measurements'] = $physical_info_body_measurements;
         $birthplace = ' ';
         if (!empty($profile_data['birthplace'])) {
             $birthplace = $profile_data['birthplace'];
         }
         $out_data[$i]['birthplace'] = $birthplace;
         $facebook = ' ';
         if (!empty($profile_data['facebook'])) {
             $facebook = $profile_data['facebook'];
         }
         $out_data[$i]['facebook'] = $facebook;
         $out_data[$i]['effect']['event'] = 'baloon.say';
         if (empty($profile_data['sub_caption'])) {
             $profile_data['sub_caption'] = 'Hi.';
         }
         $out_data[$i]['effect']['shoutout'] = $profile_data['sub_caption'];
         $i++;
     }
     return $out_data;
 }
 function get_profile_data($users_data)
 {
     $facewall_trunkwords = 7;
     $facewall_maxlength = 8;
     $out_data = array();
     $viewer_uid = 0;
     if (!empty(PA::$login_uid)) {
         $viewer_uid = PA::$login_uid;
     }
     $i = 0;
     foreach ($users_data as $user) {
         $u = new User();
         $u->load((int) $user['user_id']);
         $profile_data = User::load_user_profile($user['user_id'], $viewer_uid);
         $profile_data = sanitize_user_data($profile_data);
         $out_data[$i]['display_name'] = $u->display_name;
         $out_data[$i]['user_url'] = url_for('user_blog', array('login' => urlencode($user['login_name'])));
         $out_data[$i]['nickname'] = strlen($user['login_name']) > $facewall_maxlength ? substr($user['login_name'], 0, $facewall_trunkwords) . ' ...' : $user['login_name'];
         $out_data[$i]['location'] = field_value(@$profile_data['city'], ' ');
         $age = ' ';
         if (!empty($profile_data['dob'])) {
             $age = convert_birthDate2Age($profile_data['dob']);
         }
         $out_data[$i]['age'] = $age;
         $out_data[$i]['gender'] = field_value(@$profile_data['sex'], ' ');
         $out_data[$i]['effect']['event'] = 'baloon.say';
         if (empty($profile_data['sub_caption'])) {
             $profile_data['sub_caption'] = 'Hi.';
         }
         $out_data[$i]['effect']['shoutout'] = $profile_data['sub_caption'];
         $i++;
     }
     return $out_data;
 }
Example #3
0
 $presence->appendChild($xml_obj->createTextNode($presence_image));
 $buddy->appendChild($presence);
 //adding username to the xml
 $username = $xml_obj->createElement("username");
 $username->appendChild($xml_obj->createTextNode($user['login_name']));
 $buddy->appendChild($username);
 //adding location to the xml
 $location = $xml_obj->createElement("location");
 $location->appendChild($xml_obj->createTextNode(field_value(@$profile_data['city'], ' ')));
 $buddy->appendChild($location);
 //adding age to the xml
 $age = $xml_obj->createElement("age");
 //$gender->appendChild($xml_obj->createTextNode(field_value($profile_data['sex'], 'Not Specified')));
 $Age = ' ';
 if (!empty($profile_data['dob'])) {
     $Age = convert_birthDate2Age($profile_data['dob']);
 }
 $age->appendChild($xml_obj->createTextNode($Age));
 $buddy->appendChild($age);
 //adding gender to the xml
 $gender = $xml_obj->createElement("sex");
 $gender->appendChild($xml_obj->createTextNode(field_value(@$profile_data['sex'], ' ')));
 //$gender->appendChild($xml_obj->createTextNode('M'));
 $buddy->appendChild($gender);
 //adding effect to the xml
 $effect = $xml_obj->createElement("effect");
 $event = $xml_obj->createElement("event");
 $event->appendChild($xml_obj->createTextNode('baloon.say'));
 $effect->appendChild($event);
 $shoutout = $xml_obj->createElement("shoutout");
 if (empty($profile_data['sub_caption'])) {