MyBB Community Forums

Full Version: Show Age in Postbit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I'm trying to figure out how to show one's age on the postbit.

I've got the Birthdate, but would also like to show the age. Unfortunately, I can't figure out the code!

What I do have:

Postbit Birthdate: {$post['birthday']}

In the Member Profile, I have this showing both birthdate and age;
{$membday} & {$membdayage}

Any assistance would be greatly appreciated :)

Thank you!
$membdayage is only available on member.php (basically, member profile and so on).
This variable doesn't exist for the postbit.

You'll need a plugin which adds the following variable with a hook

I can write up something in a while if you want.

Created and attached a small plugin which creates a variable $post['postbitage'] you can use in the postbit templates.

Just be aware that this does not take the user's settings into account, whether to display the age or not. It's something I could add if you want.

Also, for some users this value could be empty.

Let me know how it goes!
Oh! Thank you! I’ll give it a go shortly!

Permissions I’m not worried about; the age will only be displayed in the postbit of character accounts, not the players (creating another rp site) so it won’t be an issue Smile

Thank you SO much! I’ll let you know how it goes Smile
Welcome! Maybe I should have mentioned as well, you need to upload the file to /Inc/plugins/. Smile