I am trying to achieve showing the age inside the popbox. This works fine but not all the time. Some profiles show "unable to load tooltip" but most profiles are working. I am trying to find out what causes this problems. Maybe someone can help?

What I did so far:

I have edited "components/com_easysocial/themes/wireframe/profile/popbox/user.php" and added the following code:


<?php
$id = JRequest::getInt( 'id' , null );
// current user profile id
$user = Foundry::user($id);
// Get your current birthday custom field unique key e.g. BIRTHDAY
$birthdayDate = $user->getFieldValue('BIRTHDAY');
// Pass birthday date into this section
$birthDate = new DateTime($birthdayDate);
$now = new DateTime();
// Use this formula generate to age
$age = floor(($now->format('U') - $birthDate->format('U')) / (60*60*24*365));
echo "($age)";
// Result
?>


From line 9 on there seems to be a problem but due to my nearly non-existent programming skills I am not able to find it...

This section can only be seen by users with a valid subscription.
If you have a valid subscription, please login now

Support is
Offline

It is currently a weekend from where we are at. Some answers may already be available on our documentation

Rest assured that we will get back to your posts as soon as the week starts!

Your time
Stack Ideas time