mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
r224
исправление ошибок git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@224 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
48b3a229d8
commit
a46d1b5176
3 changed files with 79 additions and 39 deletions
|
@ -46,7 +46,7 @@ if ($bb_cfg['gender'])
|
|||
}
|
||||
|
||||
// birthday stat
|
||||
if($bb_cfg['birthday']['check_day'] && $bb_cfg['birthday']['enabled'])
|
||||
if ($bb_cfg['birthday']['check_day'] && $bb_cfg['birthday']['enabled'])
|
||||
{
|
||||
$sql = DB()->fetch_rowset("SELECT user_id, username, user_birthday, user_birthday, user_level, user_rank FROM ". BB_USERS ." WHERE user_id NOT IN(". EXCLUDED_USERS_CSV .") ORDER BY user_level DESC, username");
|
||||
$this_year = bb_date(TIMENOW, 'Y', '', false);
|
||||
|
@ -65,12 +65,24 @@ if($bb_cfg['birthday']['check_day'] && $bb_cfg['birthday']['enabled'])
|
|||
if ($user_birthday2 > $date_today && $user_birthday2 <= $date_forward)
|
||||
{
|
||||
// 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)
|
||||
{
|
||||
//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'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1572,6 +1572,11 @@ function bb_date ($gmepoch, $format = false, $tz = null, $replace = true)
|
|||
}
|
||||
$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;
|
||||
|
||||
if($replace)
|
||||
|
|
|
@ -337,11 +337,34 @@ 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(
|
||||
'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_TODAY' => ($stats['birthday_today_list']) ? $lang['BIRTHDAY_TODAY'] . join(', ', $stats['birthday_today_list']) : $lang['NOBIRTHDAY_TODAY'],
|
||||
'WHOSBIRTHDAY_WEEK' => $week_list,
|
||||
'WHOSBIRTHDAY_TODAY' => $today_list,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue