Hi,
i want to display a custom field (Format: DATE) at an other place in the Profile-template so in insert something like this:
$cuser = CFactory::getUser();
$data = $cuser->getInfo('FIELD_hochzeit');
echo $data;
Hi Marco,
You can try use this code :
$data = date('Y-m-d',strtotime($data'))
Hi Marco,
sorry my code was wrong it should be like this :
$cuser = CFactory::getUser();
$data = $cuser->getInfo('FIELD_hochzeit');
$data = date('Y-m-d',strtotime($data))
echo $data;
Thanks, this code generates the correct format:
$cuser = CFactory::getUser();
$data = $cuser->getInfo('FIELD_hochzeit');
$data = date('Y-m-d',strtotime($data))[b][u][color=#ff0000];[/color][/u][/b]
echo $data;
can you try this :
echo $cuser->getInfo('FIELD_hochzeit')
Hi Marco,
when you create new Cuser Object, please make sure you already login to jomsocial page, or you pass the userId manually like this :
$cuser = CFactory::getUser($userId);
Hi,
it is a little bit strange with this date-field, because all other fields can display much easier. But with the code in the post above it shows a date (but not the correct).
I´m still logged in and used this code with the user id, so i think that issn´t the issue.
Thanks
Marco
Please make sure the field type is correct or not "FIELD_hochzeit"
:-) ups ... my mistake ...
This code work fine!
<?php
$cuser = CFactory::getUser();
$data = $cuser->getInfo('hochzeit');
$data = date('Y-m-d',strtotime($data));
echo $data;
?>
great!! glad to know that