(01-22-2019, 01:11 PM)mudmin Wrote: Nope. That's fine.
if($user->data()->membership == '5cc'){
$length = 6;
}elseif($user->data()->membership =='10cc'){
$length = 6;
}
if(isset($length)){
echo date('Y-m-d', strtotime("+".$length." months", strtotime($user->data()->validity)));
}
I think that will do it.
I'm afraid it doesn't display anything now. I have done it like this now:
<p><strong>Valid until:</strong>
<?php if($user->data()->membership == '5cc'){
$length = 6;
}elseif($user->data()->membership =='10cc'){
$length = 12;
}
if(isset($length)){
echo date('Y-m-d', strtotime("+".$length." months", strtotime($user->data()->validity)));
}?></p>