streams/Code/Lib/Xprof.php

35 lines
2.2 KiB
PHP
Raw Normal View History

2022-02-14 19:55:01 +00:00
<?php
2022-03-02 22:22:01 +00:00
namespace Code\Lib;
2022-02-14 19:55:01 +00:00
class Xprof {
function xprof_store_lowlevel($profile)
{
if (! $profile['xprof_hash']) {
return false;
}
$store = [
2022-08-21 00:15:14 +00:00
'xprof_hash' => $profile['xprof_hash'],
'xprof_dob' => (($profile['birthday'] === '0000-00-00') ? $profile['birthday'] : datetime_convert('', '', $profile['birthday'], 'Y-m-d')),
'xprof_age' => (($profile['age']) ? intval($profile['age']) : 0),
'xprof_desc' => (($profile['description']) ? htmlspecialchars($profile['description'], ENT_COMPAT, 'UTF-8', false) : ''),
'xprof_gender' => (($profile['gender']) ? htmlspecialchars($profile['gender'], ENT_COMPAT, 'UTF-8', false) : ''),
'xprof_marital' => (($profile['marital']) ? htmlspecialchars($profile['marital'], ENT_COMPAT, 'UTF-8', false) : ''),
'xprof_sexual' => (($profile['sexual']) ? htmlspecialchars($profile['sexual'], ENT_COMPAT, 'UTF-8', false) : ''),
'xprof_locale' => (($profile['locale']) ? htmlspecialchars($profile['locale'], ENT_COMPAT, 'UTF-8', false) : ''),
'xprof_region' => (($profile['region']) ? htmlspecialchars($profile['region'], ENT_COMPAT, 'UTF-8', false) : ''),
'xprof_postcode' => (($profile['postcode']) ? htmlspecialchars($profile['postcode'], ENT_COMPAT, 'UTF-8', false) : ''),
'xprof_country' => (($profile['country']) ? htmlspecialchars($profile['country'], ENT_COMPAT, 'UTF-8', false) : ''),
'xprof_about' => (($profile['about']) ? htmlspecialchars($profile['about'], ENT_COMPAT, 'UTF-8', false) : ''),
'xprof_homepage' => (($profile['homepage']) ? htmlspecialchars($profile['homepage'], ENT_COMPAT, 'UTF-8', false) : ''),
'xprof_hometown' => (($profile['hometown']) ? htmlspecialchars($profile['hometown'], ENT_COMPAT, 'UTF-8', false) : ''),
'xprof_keywords' => (($profile['keywords']) ? htmlspecialchars($profile['keywords'], ENT_COMPAT, 'UTF-8', false) : ''),
2022-02-14 19:55:01 +00:00
];
return create_table_from_array('xprof', $store);
}
}