исправление ошибок git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@224 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
nanosimbiot 2011-08-17 01:42:24 +00:00
commit a46d1b5176
3 changed files with 79 additions and 39 deletions

View file

@ -65,12 +65,24 @@ if($bb_cfg['birthday']['check_day'] && $bb_cfg['birthday']['enabled'])
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 . $row['user_id'] .'">'. wbr($row['username']) .'</a> <span class="small">('. birthday_age($row['user_birthday'], 1) .')</span>'; $birthday_week_list[] = array(
'user_id' => $row['user_id'],
'username' => $row['username'],
'level' => $row['user_level'],
'rank' => $row['user_rank'],
'age' => $row['user_birthday'],
);
} }
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 . $row['user_id'] .'">'. wbr($row['username']) .'</a> <span class="small">('. birthday_age($row['user_birthday'], 1) .')</span>'; $birthday_today_list[] = array(
'user_id' => $row['user_id'],
'username' => $row['username'],
'level' => $row['user_level'],
'rank' => $row['user_rank'],
'age' => $row['user_birthday'],
);
} }
} }

View file

@ -1572,6 +1572,11 @@ function bb_date ($gmepoch, $format = false, $tz = null, $replace = true)
} }
$date = gmdate($format, $gmepoch + (3600 * $tz)); $date = gmdate($format, $gmepoch + (3600 * $tz));
if (empty($lang))
{
require_once($bb_cfg['default_lang_dir'] .'lang_main.php');
}
$thetime = ($bb_cfg['translate_dates']) ? strtr(strtoupper($date), $lang['DATETIME']) : $date; $thetime = ($bb_cfg['translate_dates']) ? strtr(strtoupper($date), $lang['DATETIME']) : $date;
if($replace) if($replace)

View file

@ -339,9 +339,32 @@ if ($bb_cfg['show_latest_news'])
if ($bb_cfg['birthday']['check_day'] && $bb_cfg['birthday']['enabled']) if ($bb_cfg['birthday']['check_day'] && $bb_cfg['birthday']['enabled'])
{ {
$week_list = $today_list = array();
if ($stats['birthday_week_list'])
{
foreach($stats['birthday_week_list'] as $week)
{
$week_list[] = '<a href="'. PROFILE_URL . $week['user_id'] .'">'. $week['username'] .'</a> <span class="small">('. birthday_age($week['age'], 1) .')</span>';
}
$week_list = join(', ', $week_list);
$week_list = sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday']['check_day'], $week_list);
}
else $week_list = sprintf($lang['NOBIRTHDAY_WEEK'], $bb_cfg['birthday']['check_day']);
if ($stats['birthday_today_list'])
{
foreach($stats['birthday_today_list'] as $today)
{
$today_list[] = '<a href="'. PROFILE_URL . $today['user_id'] .'">'. $today['username'] .'</a> <span class="small">('. birthday_age($today['age'], 1) .')</span>';
}
$today_list = join(', ', $today_list);
$today_list = $lang['BIRTHDAY_TODAY'] . $today_list;
}
else $today_list = $lang['NOBIRTHDAY_TODAY'];
$template->assign_vars(array( $template->assign_vars(array(
'WHOSBIRTHDAY_WEEK' => ($stats['birthday_week_list']) ? sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday']['check_day'], join(', ', $stats['birthday_week_list'])) : sprintf($lang['NOBIRTHDAY_WEEK'], $bb_cfg['birthday']['check_day']), 'WHOSBIRTHDAY_WEEK' => $week_list,
'WHOSBIRTHDAY_TODAY' => ($stats['birthday_today_list']) ? $lang['BIRTHDAY_TODAY'] . join(', ', $stats['birthday_today_list']) : $lang['NOBIRTHDAY_TODAY'], 'WHOSBIRTHDAY_TODAY' => $today_list,
)); ));
} }