https://www.icyphoenix.com/viewtopic.php?f=26&t=8358&p=55129#p55129
-----------------------------------
Joshua203
Fri 03 Feb, 2012 18:40

Re: Exclude banned Calendar Bdays?
-----------------------------------
Thanks for the suggestion Steffen, however after looking at your suggestion I took another look at what I did to the portal in the past and maybe I got it fixed now ... the calendar looks a lot cleaner now but not completely missing birthdays.

I still have to test and investigate but I was so excited that I wanted to reply  :lol: 

It would be great if anyone could tell me "yeah correct" or "no stupid!" so below is what I the changed code....

[code linenumbers=true]/* Generates the list of birthdays for the given date
*/
function generate_birthday_list( $day, $month, $year )
{
	global $db, $user, $config;

	$birthday_list = "";
	if ($config['load_birthdays'] && $config['allow_birthdays'])
	{
		$sql = 'SELECT user_id, username, user_colour, user_birthday
				FROM ' . USERS_TABLE . '
				LEFT JOIN ' . BANLIST_TABLE . " b ON (user_id = b.ban_userid)
				WHERE (b.ban_id IS NULL
				OR b.ban_exclude = 1)
				AND user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $day, $month)) . "%'
				AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
		$result = $db->sql_query($sql);
		while ($row = $db->sql_fetchrow($result))
		{
			// TBD TRANSLATION ISSUE HERE!!!
			$birthday_list .= (($birthday_list != '') ? ', ' : '') . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
			if ($age = (int) substr($row['user_birthday'], -4))
			{
				// TBD TRANSLATION ISSUE HERE!!!
				$birthday_list .= ' (' . ($year - $age) . ')';
			}
		}
		if( $birthday_list != "" )
		{
			// TBD TRANSLATION ISSUE HERE!!!
			$birthday_list = $user->lang['BIRTHDAYS'].": ". $birthday_list;
		}
		$db->sql_freeresult($result);
	}

	return $birthday_list;
}[/code]

changes:
- in line [color=#00ff00]5[/color] I replaced the [color=red]"[/color] by a [color=red]'[/color]
- line [color=#00ff00]6, 7 and 8[/color] are newly added
- in line [color=#00ff00]9[/color] I replaced the [color=red]WHERE[/color] into an [color=red]AND[/color]

I truly can't believe I didn't goof anything up so please anyone judge it  :lol:


