I picked up an old project again and I don't really see how I can exclude birthdays of banned users from showing up.
The function file content I'm looking at is this part:
/* 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 . "
WHERE 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;
}
*/
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 . "
WHERE 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;
}
I did manage to exclude them from showing in my portals but the code used there is quite different
If anyone has any idea it would make me very happy because this calendar mod has been abandoned a long time ago.