![]() |
Birthday Cake in postbits for all b-days for the week
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 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. |
Screenshot:
(note, I use the variable on both sides of their username, so it displays 2 cakes) |
You need to place your instructions in a txt file so unregistered users/unlicenced users cant view it.
Good hack btw:) |
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... |
Nice idea. Good work. ;)
|
excellent hack :D
|
Great idea! :D
|
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? |
Just use Logician's Dynamic Template hack to do it right in the template with a conditional. ;)
|
Quote:
is that only way to do it ? as means installing another hack for something which is minor |
i like it :D
|
Quote:
|
awesome!!!
|
Works perfectly, thanks so much!
|
thank
|
Working good on 2.2.9
|
Quote:
|
very nice hack :)
my members really apreciate it :) Tnx |
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. :) |
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... |
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? :) |
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. |
i have install, but i need al little cake.gif
....have everbody a little gif for me. |
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. ;)
|
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.
|
Awesome!!!
Thank you so much. Great hack! /me clicks install |
This will be a great hack to my board thanks! will be trying it out soon!
|
LOVE it!
|
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.
|
Quote:
same here, I would like the registered users to see it to before I install this hack |
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?
|
seeing that calldaffer has a problem I dont want to isntall it unless it works correctly
|
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 =) |
it appears to be working fine for me on 2.3.0...joy!
thank you.... : ) |
Where does $bdaycake go?
|
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
Code:
|
Does show birthdays need to be enabled for this to work?
|
How i can show the cake only on the birthday?
If i delete this code: for ($i = 0; $i <= 6; $i++) { ? |
nice!
|
All times are GMT. The time now is 04:26 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:
|