![]() |
Birthday Condition?
Is there any easy way to check if today is a poster's birthday using a condition?
I'm thinking it might be nice to put a birthday cake icon next in the postbit if it's that person's birthday... |
That is possible, I don't know how simple though. I'm thinking of a very simple way to do it but I might be missing a step. Plus there may be no variable to call someone's birthdate data.
|
Hi Tony,
Thank you for your response. At least in the postbit template (where I'd be using the birthday cake icon), it looks like $post[birthday] will get you the poster's birthday information. I guess the toughest part then would be to somehow compare that date with today's date using only the month and day portions of the two variables (eg "02-11-1960" and "02-11-2004" needing to be "equal" to set off the condition). Now that I think of it, I don't know if this is possible just with templates as there'll most likely be a need to take the substring of the date(s) -- something that vBulletin doesn't allow without hacking as far as I know... |
Your right akiy, that would require hacking the /includes/functions_showthread.php if im not mistaking. Maybe you could get a respond at vb.org. Something i prolly would use.
|
I just went and created a hack and then went to post it onto vbulltin.org. I found out that someone had already posted a hack very much like it:
https://vborg.vbsupport.ru/showthread.php?t=52897 Although the hack in the thread above was released for vBulletin 2.3.x, it was easy enough to place the code into construct_postbit() in functions_showthread.php in 3.0.0 RC4. The hack also allows you to place a birthday cake icon up to a week before the person's birthday. It was easy enough to modify the code to only show the birthday icon on the day of the birthday... |
Glad you got it sorted out. :)
|
It doesn't work in our RC4 but it could very well be that the code is at the wrong spot. Can you show us where to put the and 'what' code?
|
[QUOTE=akiy] it was easy enough to place the code into construct_postbit() in includes/functions_showthread.php in 3.0.0 RC4.QUOTE]
My guess is to look for construct_postbit() |
Thanks for the corrected path to functions_showthread.php, Nemesis.
I don't want to get too deep into this hack since, after all, this is vBulletinTemplates.com, after all... But, I basically just edited includes/functions_showthread.php. After: Code:
// IM icons Code:
// Birthday cake in postbit HACK Hope that helps! |
Good deal :)
|
All times are GMT. The time now is 01:46 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|