[MODDB] Upcoming Birthday list 1.0.0a

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Ideas Centre
Locked
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

[MODDB] Upcoming Birthday list 1.0.0a

Post by lefty74 »

MOD Title: Upcoming Birthday list
MOD Description: Shows upcoming birthdays on index page, number of days can be modified via ACP.
MOD Version: 1.0.0a

MOD Download: Upcoming Birthday list 1.0.0a
phpbb3 version: Gold

Demo Board: Demoboard
Demo Username: test
Demo Password: testtest

Screenshots:
Image
Last edited by lefty74 on Tue Jul 15, 2008 5:00 pm, edited 8 times in total.
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
johnnyvang
Registered User
Posts: 10
Joined: Thu May 31, 2007 9:19 pm

Re: [BETA] Upcoming Birthday list

Post by johnnyvang »

Bedankt lefty74

Thanks lefty74
saaiberke
Registered User
Posts: 1126
Joined: Wed Jul 20, 2005 8:13 am
Location: Gent/Belgium
Contact:

Re: [BETA] Upcoming Birthday list

Post by saaiberke »

Thank you so much Lefty74!!!! ;)

Nic
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: [BETA] Upcoming Birthday list

Post by lefty74 »

:) i would be interested to hear if there are any issues with servers being in different timezones etc. worked for me so hope i managed to get it right.
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
johnnyvang
Registered User
Posts: 10
Joined: Thu May 31, 2007 9:19 pm

Re: [BETA] Upcoming Birthday list

Post by johnnyvang »

lefty74 wrote::) i would be interested to hear if there are any issues with servers being in different timezones etc. worked for me so hope i managed to get it right.
If i remember it correct then my server is in the USA and is a linux server.
just installed this mod and tested it, and runs great.
Only 1 thing.
In the installation file you say installation time: ~10minutes
But you can do it within 3 minutes.
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: [BETA] Upcoming Birthday list

Post by lefty74 »

johnnyvang wrote:
lefty74 wrote::) i would be interested to hear if there are any issues with servers being in different timezones etc. worked for me so hope i managed to get it right.
If i remember it correct then my server is in the USA and is a linux server.
just installed this mod and tested it, and runs great.
Only 1 thing.
In the installation file you say installation time: ~10minutes
But you can do it within 3 minutes.
even better :) cheers
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
TIM3PORT
Registered User
Posts: 221
Joined: Fri May 25, 2007 5:35 pm
Location: New Jersey
Contact:

Re: [BETA] Upcoming Birthday list

Post by TIM3PORT »

lefty keeps coming up with simple things that can be so beneficial thanks once again
RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Re: [BETA] Upcoming Birthday list

Post by RedTrinity »

Awesome!!! My eyes lit up when I saw this MOD listed just now, thanks so much Lefty!!

Off to install now :)
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: [BETA] Upcoming Birthday list

Post by lefty74 »

thanks for your comments :)
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
Highway311
Registered User
Posts: 75
Joined: Fri May 25, 2007 2:42 am
Location: Thailand
Contact:

Re: [BETA] Upcoming Birthday list

Post by Highway311 »

Thanks to lefty74

German Language:
language/de/common.php

Code: Select all

'BIRTHDAYS_AHEAD'		=> 'Geburtstage in den nächsten %s Tagen',
language/de/acp/board.php

Code: Select all

'ALLOW_BIRTHDAYS_AHEAD'		=> 'Wieviele Tage vor dem Geburtstage sollen angezeigt werden?',
	'ALLOW_BIRTHDAYS_AHEAD_EXPLAIN'	=> 'Zeigt die kommenden Geburtstage auf der Startseite an. Ein 0 schaltet diese Anzeige aus.',
Last edited by Highway311 on Thu Sep 13, 2007 11:48 pm, edited 1 time in total.
Sorry for my bad English.

Live every day so as if it were your last day with the dear female students in this lovely world
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: [BETA] Upcoming Birthday list

Post by lefty74 »

Highway311 wrote:Thanks to lefty74

German Language:
language/de/common.php

Code: Select all

'BIRTHDAYS_AHEAD' => 'Geburtstage in den nächsten %s Tagen',
language/de/acp/board.php

Code: Select all

'ALLOW_BIRTHDAYS_AHEAD' => 'Wieviele Tage der Geburtstage sollen angezeigt werden?',
'ALLOW_BIRTHDAYS_AHEAD_EXPLAIN' => 'Zeigt die kommenden Geburtstage auf der Startseite an. Ein 0 schaltet diese Anzeige aus.',
Thanks very much.

I noticed on my testboard (server is GMT-5) that there are some issues with the time at midnight. i think i fixed this issue though and will post the code changes later tonight (am at work at the moment).
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: [BETA] Upcoming Birthday list

Post by lefty74 »

updated to 0.0.1a
fixed a small error calculating the right time

to upgrade from 0.0.1 to 0.0.1a

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
// Generate birthday ahead list if required ...
$birthday_ahead_list = '';
if ($config['load_birthdays'] && $config['allow_birthdays'] && ( $config['allow_birthdays_ahead'] > 0 ) )
{
	$sql = 'SELECT user_id, username, user_colour, user_birthday
		FROM ' . USERS_TABLE . "
		WHERE user_birthday <> ''
			AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
	$result = $db->sql_query($sql);

	$now = getdate();
    $today = (mktime(0, 0, 0, $now[mon], $now[mday], $now[year])) + $user->timezone + $user->dst + date('Z');

	while ($row = $db->sql_fetchrow($result))
	{
       $birthdaydate = (gmdate('Y') . '-' . trim(substr($row['user_birthday'],3,-5)) . '-' . trim(substr($row['user_birthday'],0,-8) ));
       $user_birthday = strtotime($birthdaydate) + $user->timezone + $user->dst + date('Z');

	   if ( $user_birthday >= ($today + 86400) && $user_birthday <= ($today + ($config['allow_birthdays_ahead'] * 86400) ) )
	   {
		if ($row['user_colour'])
			{
				$user_colour = ' style="color:#' . $row['user_colour'] . '"';
				$row['username'] = '<strong>' . $row['username'] . '</strong>';
			}
		else
			{
				$user_colour = '';
			}

	   $birthday_ahead_list .= (($birthday_ahead_list != '') ? ', ' : '') . '<a' . $user_colour . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']) . '" title="' . date('d M', $user_birthday) . '">' . $row['username'] . '</a>';

		if ( $age = (int) substr($row['user_birthday'], -4) )
		{
			$birthday_ahead_list .= ' (' . ($now['year'] - $age) . ')';
		}
		}
	}
	
	$db->sql_freeresult($result);
}

#
#-----[ REPLACE WITH ]------------------------------------------
#

// Generate birthday ahead list if required ...// Generate birthday ahead list if required ...
$birthday_ahead_list = '';
if ($config['load_birthdays'] && $config['allow_birthdays'] && ( $config['allow_birthdays_ahead'] > 0 ) )
{
	$sql = 'SELECT user_id, username, user_colour, user_birthday
		FROM ' . USERS_TABLE . "
		WHERE user_birthday <> ''
			AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
	$result = $db->sql_query($sql);

	$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
    $today = (mktime(0, 0, 0, $now[mon], $now[mday], $now[year]));

	while ($row = $db->sql_fetchrow($result))
	{
       $birthdaydate = (gmdate('Y') . '-' . trim(substr($row['user_birthday'],3,-5)) . '-' . trim(substr($row['user_birthday'],0,-8) ));
       $user_birthday = strtotime($birthdaydate);
	   if ( $user_birthday >= ($today + 86400) && $user_birthday <= ($today + ($config['allow_birthdays_ahead'] * 86400) ) )
	   {
		if ($row['user_colour'])
			{
				$user_colour = ' style="color:#' . $row['user_colour'] . '"';
				$row['username'] = '<strong>' . $row['username'] . '</strong>';
			}
		else
			{
				$user_colour = '';
			}

	   $birthday_ahead_list .= (($birthday_ahead_list != '') ? ', ' : '') . '<a' . $user_colour . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']) . '" title="' . date('d M', $user_birthday) . '">' . $row['username'] . '</a>';

		if ( $age = (int) substr($row['user_birthday'], -4) )
		{
			$birthday_ahead_list .= ' (' . ($now['year'] - $age) . ')';
		}
		}
	}
	
	$db->sql_freeresult($result);
}
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
joebart72
Registered User
Posts: 743
Joined: Thu Feb 01, 2007 5:54 am

Re: [BETA] Upcoming Birthday list

Post by joebart72 »

Code: Select all

[phpBB Debug] PHP Notice: in file /index.php on line 272: Use of undefined constant mon - assumed 'mon'
[phpBB Debug] PHP Notice: in file /index.php on line 272: Use of undefined constant mday - assumed 'mday'
[phpBB Debug] PHP Notice: in file /index.php on line 272: Use of undefined constant year - assumed 'year'
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4267: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3766)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4269: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3766)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4270: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3766)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4271: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3766)
Any idea of the problem ? :shock: Thanks ;)
I learn English with phpbb.com :)
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: [BETA] Upcoming Birthday list

Post by lefty74 »

can you send me ur index.php pse?

i would like to see whether i get the same error message when i put this on my board.
joebart72 wrote:

Code: Select all

[phpBB Debug] PHP Notice: in file /index.php on line 272: Use of undefined constant mon - assumed 'mon'
[phpBB Debug] PHP Notice: in file /index.php on line 272: Use of undefined constant mday - assumed 'mday'
[phpBB Debug] PHP Notice: in file /index.php on line 272: Use of undefined constant year - assumed 'year'
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4267: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3766)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4269: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3766)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4270: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3766)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4271: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3766)
Any idea of the problem ? :shock: Thanks ;)
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
joebart72
Registered User
Posts: 743
Joined: Thu Feb 01, 2007 5:54 am

Re: [BETA] Upcoming Birthday list

Post by joebart72 »

Here it is : ;)

INDEX.PHP
I learn English with phpbb.com :)
Locked

Return to “[3.0.x] MODs in Development”