The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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... |
#2
|
||||
|
||||
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.
|
#3
|
||||
|
||||
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... |
#4
|
|||
|
|||
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.
|
#5
|
||||
|
||||
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... |
#6
|
||||
|
||||
Glad you got it sorted out.
|
#7
|
||||
|
||||
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?
|
#8
|
|||
|
|||
[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() |
#9
|
||||
|
||||
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 construct_im_icons($post); Code:
// Birthday cake in postbit HACK if (substr($post['birthday'], 0, 5) == vbdate("m-d")) { $bdaycake = " <img src='/graphics/birthdaycake.gif' width='18' height='19' border='0' align='absmiddle' alt='Today is my birthday!'> "; } // END Birthday cake in postbit HACK Hope that helps! |
#10
|
|||
|
|||
Good deal
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|