Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-10-2004, 10:54 PM
akiy's Avatar
akiy akiy is offline
 
Join Date: Dec 2001
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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...
Reply With Quote
  #2  
Old 02-11-2004, 03:31 AM
Tony G's Avatar
Tony G Tony G is offline
 
Join Date: Nov 2001
Location: Melbourne, Australia
Posts: 8,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 02-11-2004, 03:09 PM
akiy's Avatar
akiy akiy is offline
 
Join Date: Dec 2001
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #4  
Old 02-11-2004, 03:33 PM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 02-11-2004, 04:26 PM
akiy's Avatar
akiy akiy is offline
 
Join Date: Dec 2001
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #6  
Old 02-12-2004, 08:05 AM
Tony G's Avatar
Tony G Tony G is offline
 
Join Date: Nov 2001
Location: Melbourne, Australia
Posts: 8,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad you got it sorted out.
Reply With Quote
  #7  
Old 02-12-2004, 09:14 AM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 02-12-2004, 12:21 PM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[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()
Reply With Quote
  #9  
Old 02-12-2004, 04:00 PM
akiy's Avatar
akiy akiy is offline
 
Join Date: Dec 2001
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #10  
Old 02-12-2004, 07:54 PM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good deal
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:47 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07388 seconds
  • Memory Usage 2,251KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete