mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
r217
git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@217 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
258847f87e
commit
9305dfd25b
2 changed files with 9 additions and 7 deletions
|
@ -1692,10 +1692,10 @@ function realdate($date, $format = "Ymd")
|
||||||
return bb_date($date*86400+1, $format, 0);
|
return bb_date($date*86400+1, $format, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function birthday_age($date)
|
function birthday_age($date, $list = 0)
|
||||||
{
|
{
|
||||||
if(!$date) return;
|
if(!$date) return;
|
||||||
return delta_time(mktime(11, 0, 0, realdate($date, 'm'), realdate($date, 'd'), realdate($date, 'Y')));
|
return delta_time(mktime(11, 0, 0, realdate($date, 'm'), realdate($date, 'd'), (realdate($date, 'Y') - $list)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -347,21 +347,23 @@ if($bb_cfg['birthday']['check_day'] && $bb_cfg['birthday']['enabled'])
|
||||||
|
|
||||||
foreach ($stats['birthday'] as $birthdayrow)
|
foreach ($stats['birthday'] as $birthdayrow)
|
||||||
{
|
{
|
||||||
$user_birthday2 = $this_year . ($user_birthday = realdate("md", $birthdayrow['user_birthday']));
|
$user_birthday = realdate($birthdayrow['user_birthday'], 'md');
|
||||||
|
$user_birthday2 = $this_year . $user_birthday;
|
||||||
|
|
||||||
if ($user_birthday2 < $date_today) $user_birthday2 += 10000;
|
if ($user_birthday2 < $date_today) $user_birthday2 += 10000;
|
||||||
|
|
||||||
if ($user_birthday2 > $date_today && $user_birthday2 <= $date_forward)
|
if ($user_birthday2 > $date_today && $user_birthday2 <= $date_forward)
|
||||||
{
|
{
|
||||||
// user are having birthday within the next days
|
// user are having birthday within the next days
|
||||||
$birthday_week_list[] = '<a href="'. PROFILE_URL . $birthdayrow['user_id'] .'">'. wbr($birthdayrow['username']) .'</a> <span class="small">('. birthday_age($birthdayrow['user_birthday']) .')</span>';
|
$birthday_week_list[] = '<a href="'. PROFILE_URL . $birthdayrow['user_id'] .'">'. wbr($birthdayrow['username']) .'</a> <span class="small">('. birthday_age($birthdayrow['user_birthday'], 1) .')</span>';
|
||||||
}
|
}
|
||||||
elseif ($user_birthday2 == $date_today)
|
elseif ($user_birthday2 == $date_today)
|
||||||
{
|
{
|
||||||
//user have birthday today
|
//user have birthday today
|
||||||
$birthday_today_list[] = '<a href="'. PROFILE_URL . $birthdayrow['user_id'] .'">'. wbr($birthdayrow['username']) .'</a> <span class="small">('. birthday_age($birthdayrow['user_birthday']) .')</span>';
|
$birthday_today_list[] = '<a href="'. PROFILE_URL . $birthdayrow['user_id'] .'">'. wbr($birthdayrow['username']) .'</a> <span class="small">('. birthday_age($birthdayrow['user_birthday'], 1) .')</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$birthday_today_list = ($birthday_today_list) ? $lang['BIRTHDAY_TODAY'] . join(', ', $birthday_today_list) : $lang['NOBIRTHDAY_TODAY'];
|
$birthday_today_list = ($birthday_today_list) ? $lang['BIRTHDAY_TODAY'] . join(', ', $birthday_today_list) : $lang['NOBIRTHDAY_TODAY'];
|
||||||
$birthday_week_list = ($birthday_week_list) ? sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday']['check_day'], join(', ', $birthday_week_list)) : sprintf($lang['NOBIRTHDAY_WEEK'], $bb_cfg['birthday']['check_day']);
|
$birthday_week_list = ($birthday_week_list) ? sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday']['check_day'], join(', ', $birthday_week_list)) : sprintf($lang['NOBIRTHDAY_WEEK'], $bb_cfg['birthday']['check_day']);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue