TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 06:22:10 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 190
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 83
  • Total: 83

Looking for Birthday Code

Started by qwe3, March 17, 2006, 05:59:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

qwe3

Would it be possible to get birthdays from user data and post Happy Birthday to that user(s) in a block

Example:

Happy Birthday:

(User Names)


alan s

Contact technodragon73 he mentioned today that he had a mod installed that displayed a message on a users birthday

qwe3

I got it working using ssi, but what I want is only to display "todays birthdays"

BCB

can you let us all know what you did in the ssi as I would like to see what it does

qwe3

In a phpbox I added -- ssi_todaysBirthdays(); 

This seems to display all birthdays for the month,  I would like to display birthdays only for that day.


gerrymo

I think the time period displayed is related to the calendar settings for the front page of the forum. Try setting it at 1 day, and see if that will only show birthdays for that day.

qwe3

gerrymo,

Perfect, that is all I needed to do.  Now it is displaying only todays birthdays. 

Thanks a million

ontap

Heres a way.. (allways make backups  ;))

Open Sources/Load.php
Find:
$user_info['groups'] = array_unique($user_info['groups']);

Add After:

if (isset($user_settings['birthdate']))
{
$cur_date = getdate(forum_time());
$user_info['today_is_birthday'] = $cur_date['mon'] == substr($user_settings['birthdate'], 5, 2) && $cur_date['mday'] == substr($user_settings['birthdate'], 8);
}


Search For:
'email' => &$user_info['email']

Replace With:
'email' => &$user_info['email'],
'today_is_birthday' => &$user_info['today_is_birthday'],


Open Themes/Default/TPortalBlocks.template.php
Find:
echo '<span class="normaltext">
                                                        ', $txt['hello_member'], ' <b>', $context['user']['name'], '</b></span>';


Replace With
if ($context['user']['today_is_birthday'])
echo '
<span class="normaltext"><b>Happy Birthday ', $context['user']['name'], '</b></span>';
else
echo '
<span class="normaltext">', $txt['hello_member'], ' <b>', $context['user']['name'], '</b></span>';


it will show on the user block.

alan s