vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Birthday Cake in postbits for all b-days for the week (https://vborg.vbsupport.ru/showthread.php?t=52897)

eoc_Jason 05-12-2003 10:00 PM

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.

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

Quote:

Yesterday at 11:22 PM Boofo said this in Post #9
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

Quote:

Today at 06:59 PM DPoole said this in Post #10
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

Quote:

Yesterday at 05:12 PM DPoole said this in Post #8
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

Quote:

Today at 08:40 PM calldaffer said this in Post #29
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?

Elly 10-21-2003 11:43 AM

I changed the code to this

Code:


// 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!


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
  • Page Generation 0.01223 seconds
  • Memory Usage 1,810KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete