Solved: 1 Year, 3 Months, 2 Weeks ago Show Age in Postbit
#1
Solved: 1 Year, 3 Months, 2 Weeks ago
Hello!

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!
[Image: HaLp2lk.png]

[Image: LQwJ7VV.png]
Reply
#2
Solved: 1 Year, 3 Months, 2 Weeks ago
$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
get_age($post['birthday'])

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!


Attached Files
.zip   postbitage.zip (Size: 662 bytes / Downloads: 21)
[Image: modmybb-banner-0.png]
If you think I've helped you; a + rep would be appreciated.
Reply
#3
Solved: 1 Year, 3 Months, 2 Weeks ago
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
[Image: HaLp2lk.png]

[Image: LQwJ7VV.png]
Reply
#4
Solved: 1 Year, 3 Months, 2 Weeks ago
Welcome! Maybe I should have mentioned as well, you need to upload the file to /Inc/plugins/. Smile
[Image: modmybb-banner-0.png]
If you think I've helped you; a + rep would be appreciated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)