[su_chatlio]
$snapshot = $_SESSION[‘snapshot’];
$user = wp_get_current_user();
$customer_id = $user->user_login;
$firstname = $snapshot[‘name’];
$firstname = (strtolower($firstname) == ‘null’ ? ” : $firstname);
$lastname = $snapshot[‘surname’];
$lastname = (strtolower($lastname) == ‘null’ ? ” : $lastname);
$title = $snapshot[‘title’];
$user_registered= $snapshot[‘timestamp’];
$language = $snapshot[‘language_code’];
$points_balance = $_SESSION[‘points_balance’];
$protected_msn = ”;
if(isset($snapshot[‘date_of_birth’])) {
$dob = $snapshot[‘date_of_birth’];
} else {
$dob = “”;
}
$email = $snapshot[’email’];
$email = (strtolower($email) == ‘null’ ? ” : $email);
$phone = “+”.$snapshot[‘msn’];
if($phone!=””) {
for($digits=0;$digits
diff($second_date);
if($interval->y<2)
$year = 'year ';
else
$year = 'years ';
if($interval->m<2)
$month = 'month ';
else
$month = 'months ';
if($interval->d<2)
$day = 'day ';
else
$day = 'days ';
if($interval->h<2)
$hour = 'hour ';
else
$hour = 'hours ';
if($interval->i<2)
$minute = 'minute ';
else
$minute = 'minutes ';
if ($interval->y) { $result .= $interval->format(“%y “.$year); }
if ($interval->m) { $result .= $interval->format(“%m “.$month); }
if ($interval->d) { $result .= $interval->format(“%d “.$day); }
if(!($interval->y) && !($interval->m) && !($interval->d)){
if ($interval->h) { $result .= $interval->format(“%h “.$hour); }
if ($interval->i) { $result .= $interval->format(“%i “.$minute); }
}
if (!($interval->i)) { $result .= $interval->format(“%s seconds “); }
$ago = $result.’ago’;
} else {
$ago = ”;
}
$device=’Mobile’;
if($firstname!=”” && $lastname!=””)
$name = $firstname.’ ‘.$lastname;
elseif($firstname!=””)
$name = $firstname;
elseif($lastname!=””)
$name = $lastname;
$traits = array(
‘username’ => $user->user_login,
‘name’ => $name,
‘firstName’ => $firstname,
‘lastName’ => $lastname,
‘url’ => $user->user_url,
‘title’ => $title,
‘Registered_Since’ => $ago,
’email’ => $email,
‘phone’ => $protected_msn,
‘device’ => $device,
‘language’ => $language
);
if(isset($_GET[‘debug’]) && $_GET[‘debug’]==’cb’){
print_r($traits);
}
if ( $traits ) {
$traits = array_filter( $traits );
}
$params = “”;
foreach($traits as $key=>$trait) {
$params .= $key.’:”‘.$trait.'”,’;
}
$params = rtrim($params,’,’);
if($language!=”) {
$chatlio_configure_json = file_get_contents(‘https://firebasestorage.googleapis.com/v0/b/lottosocial-9f7a2.appspot.com/o/chatlio%2F’.strtolower($language).’.json?alt=media’);
if(!$chatlio_configure_json){
$chatlio_configure_json = file_get_contents(‘https://firebasestorage.googleapis.com/v0/b/lottosocial-9f7a2.appspot.com/o/chatlio%2F’.strtolower($language).’.json?alt=media’);
}
} else {
$chatlio_configure_json = file_get_contents(‘https://firebasestorage.googleapis.com/v0/b/lottosocial-9f7a2.appspot.com/o/chatlio%2Fen.json?alt=media’);
}
echo ‘
‘;
if(!isset($_GET[‘dev’])) {
echo ‘';
echo "";
}