mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 10:37:30 -07:00
Added user birthday icon in profile
Добавляет иконку тортика в профиль. До этого иконка выводилась только в viewtopic, теперь же она добавляется в viewprofile Для универсальности написал отдельную функцию которая принимает в себя $user_birthday и $user_id.
This commit is contained in:
parent
ba643cf5c9
commit
e4e337942d
4 changed files with 21 additions and 5 deletions
|
@ -2092,3 +2092,21 @@ function clean_tor_dirname($dirname)
|
|||
{
|
||||
return str_replace(array('[', ']', '<', '>', "'"), array('[', ']', '<', '>', '''), $dirname);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get birthday icon
|
||||
*
|
||||
* @param $user_birthday
|
||||
* @param $user_id
|
||||
* @return string
|
||||
*/
|
||||
function user_birthday_icon($user_birthday, $user_id): string
|
||||
{
|
||||
global $bb_cfg, $images, $lang;
|
||||
|
||||
$current_date = bb_date(TIMENOW, 'md', false);
|
||||
$user_birthday = ($user_id != GUEST_UID && !empty($user_birthday) && $user_birthday != '1900-01-01')
|
||||
? date('md', strtotime($user_birthday)) : false;
|
||||
|
||||
return ($bb_cfg['birthday_enabled'] && $current_date == $user_birthday) ? '<img src="' . $images['icon_birthday'] . '" alt="" title="' . $lang['HAPPY_BIRTHDAY'] . '" border="0" />' : '';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue