vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Birthday Condition? (https://vborg.vbsupport.ru/showthread.php?t=88447)

akiy 02-10-2004 10:54 PM

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...

Tony G 02-11-2004 03:31 AM

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.

akiy 02-11-2004 03:09 PM

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...

Logikos 02-11-2004 03:33 PM

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.

akiy 02-11-2004 04:26 PM

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...

Tony G 02-12-2004 08:05 AM

Glad you got it sorted out. :)

NuclioN 02-12-2004 09:14 AM

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?

Logikos 02-12-2004 12:21 PM

[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()

akiy 02-12-2004 04:00 PM

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);

I added:

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

I then used $bdaycake in the postbit and postbit_legacy templates where I wanted the cake icon to show.

Hope that helps!

Logikos 02-12-2004 07:54 PM

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
  • Page Generation 0.01066 seconds
  • Memory Usage 1,737KB
  • 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
  • (2)bbcode_code_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
  • (10)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