diff --git a/root/portal/modules/portal_birthday_list.php b/root/portal/modules/portal_birthday_list.php index 75f54789..c7c1d235 100644 --- a/root/portal/modules/portal_birthday_list.php +++ b/root/portal/modules/portal_birthday_list.php @@ -63,7 +63,8 @@ class portal_birthday_list_module while ($cache_days > 0) { $day = phpbb_gmgetdate($time->getTimestamp() + 86400 * $cache_days + $time->getOffset()); - $sql_days .= " OR u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $day['mday'], $day['mon'])) . "%'"; + $like_expression = $db->sql_like_expression($db->any_char . (sprintf('%2d-%2d-', $day['mday'], $day['mon'])) . $db->any_char); + $sql_days .= " OR u.user_birthday " . $like_expression . ""; $cache_days--; } @@ -94,21 +95,19 @@ class portal_birthday_list_module { if (substr($row['user_birthday'], 0, 6) == $today) { - $birthday_list .= '' . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) . ''; - if ($age = (int) substr($row['user_birthday'], -4)) - { - $birthday_list .= ' (' . ($now['year'] - $age) . ')'; - } - $birthday_list .= '
'; + $birthday_list = true; + $template->assign_block_vars('board3_birthday_list', array( + 'USER' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'AGE' => ($age = (int) substr($row['user_birthday'], -4)) ? ' (' . ($now['year'] - $age) . ')' : '', + )); } elseif ($config['board3_birthdays_ahead_' . $module_id] > 0) { - $birthday_ahead_list .= '' . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) . ''; - if ($age = (int) substr($row['user_birthday'], -4)) - { - $birthday_ahead_list .= ' (' . ($now['year'] - $age) . ')'; - } - $birthday_ahead_list .= '
'; + $birthday_ahead_list = true; + $template->assign_block_vars('board3_birthday_ahead_list', array( + 'USER' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'AGE' => ($age = (int) substr($row['user_birthday'], -4)) ? ' (' . ($now['year'] - $age) . ')' : '', + )); } } $db->sql_freeresult($result); diff --git a/root/styles/prosilver/template/portal/modules/birthdays_side.html b/root/styles/prosilver/template/portal/modules/birthdays_side.html index 60eca421..5f81104d 100644 --- a/root/styles/prosilver/template/portal/modules/birthdays_side.html +++ b/root/styles/prosilver/template/portal/modules/birthdays_side.html @@ -1,6 +1,17 @@ {$LR_BLOCK_H_L} {$TITLE}{$LR_BLOCK_H_R} - {L_CONGRATULATIONS}:
{BIRTHDAY_LIST} + {L_CONGRATULATIONS}:
+ + + + + + {board3_birthday_list.USER} + + + {board3_birthday_list.AGE} +
+ {L_NO_BIRTHDAYS} @@ -9,7 +20,17 @@ {L_BIRTHDAYS_AHEAD}
- {BIRTHDAYS_AHEAD_LIST} + + + + + + {board3_birthday_ahead_list.USER} + + + {board3_birthday_ahead_list.AGE} +
+ {L_NO_BIRTHDAYS_AHEAD} diff --git a/root/styles/subsilver2/template/portal/modules/birthdays_side.html b/root/styles/subsilver2/template/portal/modules/birthdays_side.html index a8c516f4..8426fcc0 100644 --- a/root/styles/subsilver2/template/portal/modules/birthdays_side.html +++ b/root/styles/subsilver2/template/portal/modules/birthdays_side.html @@ -3,7 +3,18 @@ - {L_CONGRATULATIONS}:
{BIRTHDAY_LIST} + {L_CONGRATULATIONS}:
+ + + + + + {board3_birthday_list.USER} + + + {board3_birthday_list.AGE} +
+ {L_NO_BIRTHDAYS} @@ -15,7 +26,17 @@ {L_BIRTHDAYS_AHEAD}:
- {BIRTHDAYS_AHEAD_LIST} + + + + + + {board3_birthday_ahead_list.USER} + + + {board3_birthday_ahead_list.AGE} +
+ {L_NO_BIRTHDAYS_AHEAD}