2012-11-12, 03:55 PM
Sweet, thanks a lot, this project is already balancing on it's budget, so any time savers are greatly appreciated. If I manage to come up with an answer, I'll post it here in case anyone else needs to do this in future.
Sudo Wrote:<?php echo date("jS F, Y", ($mybb->user['lastactive'])); ?>
<?php echo date("jS F, Y", $post['lastactive']); ?>
<?=my_date('jS F, Y', $post['lastactive'])?>
<if intval($post['lastactive']) > 0 then><?=my_date('jS F, Y', $post['lastactive'])?></if>
(2012-11-12, 06:45 PM)Omar G. Wrote: [ -> ]Sudo Wrote:<?php echo date("jS F, Y", ($mybb->user['lastactive'])); ?>
That is correct for the current connected user (yes, if it is a guest it wouldn't work). For posts you need:
<?php echo date("jS F, Y", $post['lastactive']); ?>
IMO you should use a plugin for anything that requires you to use the PHP In Templates plugin, here is the Templates Conditional plugin code:
<?=my_date('jS F, Y', $post['lastactive'])?>
You should probably do a check to know if the lastactive array key exists in case the user doesn't exists (i.e: the post is made by a guest).
<if intval($post['lastactive']) > 0 then><?=my_date('jS F, Y', $post['lastactive'])?></if>