View Full Version : Birthday Cake in postbits for all b-days for the week
eoc_Jason
05-12-2003, 10:00 PM
I searched high and low for something that would display a little birthday cake (or even text) in the postbits when it was someones birthday and came up empty, so I wrote my own with a twist. I decided to have it display a cake for anyones birthday for the entire week (week being Sun-Sat). That way they get a little more recognition that just on their actual b-day.
This should work with all versions of vB...
All you have to do is add a couple lines of code to your admin/functions.php and add the variable to your postbits. :) Simple!
I just used the bday cake from MSN Messenger Page (http://help.msn.com/EN_US/HelpWindow_msg.asp?INI=Messengerv50.ini&H_VER=1.7&Topic=emoticons.htm&H_APP=MSN%20Messenger&Filter=!WinXP) I'm not posting it here for legal reasons. If you want it to display just text you can change the line accordingly...
Like I said, I don't know if this has been done before, but my searches came up with nothing when searching for "birthday".
Enjoy.
eoc_Jason
05-13-2003, 05:03 PM
Screenshot:
(note, I use the variable on both sides of their username, so it displays 2 cakes)
assassingod
05-13-2003, 05:10 PM
You need to place your instructions in a txt file so unregistered users/unlicenced users cant view it.
Good hack btw:)
eoc_Jason
05-13-2003, 06:00 PM
Okay, I moved it to a text file. I'm pretty sure if you aren't registered then the PHP code blocks say "You need to be licenced to see this code" or something like that...
Yeah, this came out of need to try and reduce the "Happy B-Day" threads... I have about 10 b-days every day, so it can get a little out of hand sometimes. Now I tell them just to PM the person if they want to wish them happy b-day, it's a little more personal and doesn't cause so much clutter...
Boofo
05-13-2003, 06:04 PM
Nice idea. Good work. ;)
msimplay
05-13-2003, 06:43 PM
excellent hack :D
Mike Gaidin
05-13-2003, 07:39 PM
Great idea! :D
DPoole
05-13-2003, 09:12 PM
i like the hack but would it be possible to swap the users avator for a pre determined one if it was their birthday ?
then when the time runs out its auto switches back to their normal one as i got an idea but need avator switching for it to work?
Boofo
05-13-2003, 09:22 PM
Just use Logician's Dynamic Template hack to do it right in the template with a conditional. ;)
DPoole
05-13-2003, 10:59 PM
Yesterday at 11:22 PM Boofo said this in Post #9 (https://vborg.vbsupport.ru/showthread.php?postid=394740#post394740)
Just use Logician's Dynamic Template hack to do it right in the template with a conditional. ;)
is that only way to do it ?
as means installing another hack for something which is minor
monstergamer
05-13-2003, 11:03 PM
i like it :D
Boofo
05-13-2003, 11:28 PM
Today at 06:59 PM DPoole said this in Post #10 (https://vborg.vbsupport.ru/showthread.php?postid=394781#post394781)
is that only way to do it ?
as means installing another hack for something which is minor
Logician's hack is probably smaller than what it would take to do it another way. And with his hack, you can use conditionals for a lot of things.Ttrust me when I say that once you try it, you won't ever want to be without it. ;)
alkatraz
05-14-2003, 02:00 AM
awesome!!!
Alien
05-14-2003, 02:09 AM
Works perfectly, thanks so much!
week9
05-14-2003, 03:09 AM
thank
yxboom
05-14-2003, 02:56 PM
Working good on 2.2.9
eoc_Jason
05-14-2003, 10:51 PM
Yesterday at 05:12 PM DPoole said this in Post #8 (https://vborg.vbsupport.ru/showthread.php?postid=394733#post394733)
i like the hack but would it be possible to swap the users avator for a pre determined one if it was their birthday ?
then when the time runs out its auto switches back to their normal one as i got an idea but need avator switching for it to work?
I suppose you could have it change the $post[avatar] variable, but remember that this actually pulls from a template if you have some custom formatting... Look above like a page or two where you implemented this hack, and you will see all the avatar code. You can just overwrite the avatar var while it is their birthday, but it might confuse some people...
Freezerator
05-16-2003, 05:06 PM
very nice hack :)
my members really apreciate it :)
Tnx
Cyricx
05-22-2003, 03:24 AM
Here's a question for ya :)
I'm certain I can get one of my graphics artist to do something up and making it available for you to distribute with this hack :)
Basically what I'm thinking is making it countdown.
Like 7 days before their birthday, it shows a cake with 7 candles.
6 days before a cake with 6 candles
5 days before a cake with 5 candles etc
til the day of it would display a lil gif that said happy birthday
Something along those lines. :)
Possible? If so I'll sit down with a few of my artists and work on something, if you think you could do the coding. :)
eoc_Jason
05-23-2003, 05:53 PM
Sure you can do something like that... originally I had the dates pushed into an array and just a "in_array" function, but I chose the loop method just so there was one less variable floating around... But instead of just checking if it is in the array, you can find where in the array and set the count-down date accordingly...
However, I think something like that might just cause confusion among people...
Something a little simpler was if it was the actual birthday then the cake would look different than if it was just a day during the week...
Cyricx
05-25-2003, 05:14 AM
Aye, your prolly right about the confusion.
And that would be kewl, to have a different IMG for the day of :)
Do you know what mods I would need to make to the hack to do that? :)
eoc_Jason
05-26-2003, 03:35 AM
I'll work on it tomorrow Cyricx, it should take about 5-10min for me to write & test and I'll update the .txt file with that option.
I've been really sick these past couple days so I've just been in bed most of the time (it seems like I have been getting sick a lot lately). But hopefully tomorrow I'll be up for doing a little work.
subu1
05-26-2003, 06:49 AM
i have install, but i need al little cake.gif
....have everbody a little gif for me.
eoc_Jason
05-27-2003, 02:18 AM
I stated in my first post that I just nabbed the one from the MSN messenger page (link was provided). You can just google for some birthday cake image, or use text, it's up to you. ;)
eoc_Jason
05-27-2003, 02:25 AM
Cyrx, okay I updated the code, it was actually easier than I thought, I just combined to two code bits using and if/else statement... lol... :) So now you can have one display during the week, and one on their actual birthday.
Cyricx
05-30-2003, 09:46 PM
Awesome!!!
Thank you so much. Great hack!
/me clicks install
jagperk
06-01-2003, 11:30 PM
This will be a great hack to my board thanks! will be trying it out soon!
LadyBeth
06-23-2003, 12:10 AM
LOVE it!
calldaffer
07-16-2003, 11:40 PM
I love the concept of this and have installed it on my boards but my problem is that only admins and mods can see it. Regular members don't even know its there. What do I need to do so that everyone can see it. I used the option where it only displays on the day of their birthday.
Xelation
07-16-2003, 11:54 PM
Today at 08:40 PM calldaffer said this in Post #29 (https://vborg.vbsupport.ru/showthread.php?postid=418309#post418309)
I love the concept of this and have installed it on my boards but my problem is that only admins and mods can see it. Regular members don't even know its there. What do I need to do so that everyone can see it. I used the option where it only displays on the day of their birthday.
same here, I would like the registered users to see it to before I install this hack
calldaffer
07-18-2003, 10:14 AM
I'm all out of ideas here guys, can someone please give me a hand here. The code (hack) is working great except my registered members can't see it. Only mods and admins can. What do I need to change to make it to where everyone can see it?
Xelation
07-20-2003, 11:15 PM
seeing that calldaffer has a problem I dont want to isntall it unless it works correctly
kristiesks
07-21-2003, 03:35 AM
I installed it and it works like a charm. I installed the version where you see one image the week before the birthday, and then on the day of the actual birthday, you see a different image.
All of my members can see the week of image, but only moderators and admins can see the day of image.
I would love for this to be corrected too so that everyone can see the day of image =)
father max
09-01-2003, 08:52 PM
it appears to be working fine for me on 2.3.0...joy!
thank you....
: )
patriciafrankie
09-26-2003, 03:10 AM
Where does $bdaycake go?
LadyBeth
09-28-2003, 09:22 PM
Can teh cake be added to more than just the user as they appear in the thread? Can the cake be added on the forum home where the birthday is announced? And can it show up in the calendar on the birthday of the person who is celebrating?
I changed the code to this
// Birthday cake in postbit
for ($i = 0; $i <= 6; $i++) {
if ( substr($post[birthday],5) == vbdate('m-d',time()) ) {
$bdaycake = " <img src='http://www.ultimaforce.net/asuka/kao/chirolp_cake.gif' border='0' align='absmiddle' alt='Its My Birhtday!!!'> ";
}
}
// END Birthday cake in postbit
and it seems to display the cake to all members on the day of their birthday ;)
Rezin
10-25-2003, 02:45 AM
Does show birthdays need to be enabled for this to work?
The Matrix 7
11-23-2003, 06:52 AM
How i can show the cake only on the birthday?
If i delete this code: for ($i = 0; $i <= 6; $i++) { ?
jjj0923
11-29-2003, 10:09 AM
nice!
jjj0923
11-29-2003, 10:12 AM
I changed the code to this
// Birthday cake in postbit
for ($i = 0; $i <= 6; $i++) {
if ( substr($post[birthday],5) == vbdate('m-d',time()) ) {
$bdaycake = " <img src='http://www.ultimaforce.net/asuka/kao/chirolp_cake.gif' border='0' align='absmiddle' alt='Its My Birhtday!!!'> ";
}
}
// END Birthday cake in postbit
and it seems to display the cake to all members on the day of their birthday ;)
why are you hardcoding the path to your images?
it's not necessary, considered poor programming and just one more thing you have to change if your ever change directory structures...
firas
12-10-2003, 02:08 AM
i liked it..i'll give it a try
Coordinator Inc
12-22-2003, 10:50 AM
I'm sorry, I can't understand what this script does.
Where does it places the images?
And what is 'postbits' ???
Thanks a lot.
SRozhon
01-23-2004, 04:58 PM
Will this work with vb3 RC? I like it!
ashley53680
04-21-2004, 01:51 AM
Is there anyway to get this to work on vb3 gold?
Maybe a little tip;
If user is having his birthday show b-day cake in;
- Postbit
- Userlist
- Who's Online
- Usergroup page
- Friendslist in userCP
Just some tips :)
ashley53680
04-21-2004, 02:43 PM
I guess I should clarify... in the vb2 instructions it says under admin/functions.php to make some changes. Well I don't have an admin/functions.php so what file would I edit?
eoc_Jason
05-05-2004, 04:03 AM
I'm sure for vB3 you can just use conditionals to display an icon....
ashley53680
05-05-2004, 04:05 AM
Hmmm, I have no idea how to do that!!!! haha
Baptizer
06-18-2004, 03:23 PM
Any idea how to get this to work for vb3? My users have fallen in love with this feature!
eoc_Jason
06-18-2004, 08:19 PM
*sigh*... if I have some spare time I'll work up a hack for vB3...
Do you want it just to show on their birthday, or all days for the week?
ashley53680
06-18-2004, 09:23 PM
I would prefer just their bday! :) Thanks for taking the time!!! (hugs)
dan35
12-14-2005, 08:19 PM
Please port it to 3.5! TIA!
Smiry Kin's
12-20-2005, 02:22 AM
Hi jason please code this for vB 3.5.2!
Dollah
12-28-2005, 06:03 PM
hey clicks install thanx
kellyandmike
04-09-2006, 03:04 AM
Was this ever done?
apdcanari
08-23-2006, 11:57 AM
Hi jason please code this for vB 3.5.2!
yes, please :rolleyes:
pcoskat
11-04-2006, 02:04 PM
Any chance of getting this for 3.6.x?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.