mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
r213
Изменение даты - сегодня/вчера git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@213 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
fdfdd7bd97
commit
172b6cc269
4 changed files with 42 additions and 2 deletions
|
@ -1572,7 +1572,41 @@ function bb_date ($gmepoch, $format = false, $tz = null)
|
||||||
}
|
}
|
||||||
$date = gmdate($format, $gmepoch + (3600 * $tz));
|
$date = gmdate($format, $gmepoch + (3600 * $tz));
|
||||||
|
|
||||||
return ($bb_cfg['translate_dates']) ? strtr(strtoupper($date), $lang['DATETIME']) : $date;
|
$thetime = ($bb_cfg['translate_dates']) ? strtr(strtoupper($date), $lang['DATETIME']) : $date;
|
||||||
|
|
||||||
|
$time_format = " H:i";
|
||||||
|
|
||||||
|
$date = getdate();
|
||||||
|
$today = $date['mday'];
|
||||||
|
$month = $date['mon'];
|
||||||
|
$year = $date['year'];
|
||||||
|
|
||||||
|
$forum_date_today = @gmdate ("d", $gmepoch + (3600 * $tz));
|
||||||
|
$forum_date_month = @gmdate ("m", $gmepoch + (3600 * $tz));
|
||||||
|
$forum_date_year = @gmdate ("Y", $gmepoch + (3600 * $tz));
|
||||||
|
|
||||||
|
if ($forum_date_today == $today && $forum_date_month == $month && $forum_date_year == $year)
|
||||||
|
{
|
||||||
|
$thetime = $lang['TODAY'] . @gmdate($time_format, $gmepoch + (3600 * $tz));
|
||||||
|
}
|
||||||
|
elseif ($today != 1 && $forum_date_today == ($today-1) && $forum_date_month == $month && $forum_date_year == $year)
|
||||||
|
{
|
||||||
|
$thetime = $lang['YESTERDAY'] . @gmdate($time_format, $gmepoch + (3600 * $tz));
|
||||||
|
}
|
||||||
|
elseif ($today == 1 && $month != 1)
|
||||||
|
{
|
||||||
|
$yesterday = date ("t", mktime(0, 0, 0, ($month-1), 1, $year));
|
||||||
|
if ($forum_date_today == $yesterday && $forum_date_month == ($month-1) && $forum_date_year == $year)
|
||||||
|
$thetime = $lang['YESTERDAY'] . @gmdate($time_format, $gmepoch + (3600 * $tz));
|
||||||
|
}
|
||||||
|
elseif ($today == 1 && $month == 1)
|
||||||
|
{
|
||||||
|
$yesterday = date ("t", mktime(0, 0, 0, 12, 1, ($year -1)));
|
||||||
|
if ($forum_date_today == $yesterday && $forum_date_month == 12 && $forum_date_year == ($year-1))
|
||||||
|
$thetime = $lang['YESTERDAY'] . @gmdate($time_format, $gmepoch + (3600 * $tz));
|
||||||
|
}
|
||||||
|
|
||||||
|
return ($thetime);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Birthday
|
// Birthday
|
||||||
|
|
|
@ -726,7 +726,7 @@ if($bb_cfg['birthday']['enabled'] && $mode != 'register')
|
||||||
}
|
}
|
||||||
$s_birthday .= build_select('b_md', $months, $b_md);
|
$s_birthday .= build_select('b_md', $months, $b_md);
|
||||||
|
|
||||||
$year = bb_date(TIMENOW, 'Y');
|
$year = date('Y');
|
||||||
$years = array($lang['DELTA_TIME']['INTERVALS']['year'][0] => 0);
|
$years = array($lang['DELTA_TIME']['INTERVALS']['year'][0] => 0);
|
||||||
for($i=$year-$bb_cfg['birthday']['max_user_age']; $i<=$year-$bb_cfg['birthday']['min_user_age']; $i++)
|
for($i=$year-$bb_cfg['birthday']['max_user_age']; $i<=$year-$bb_cfg['birthday']['min_user_age']; $i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -992,6 +992,9 @@ $lang['TZ']['11'] = 'GMT + 11 Hours';
|
||||||
$lang['TZ']['12'] = 'GMT + 12 Hours';
|
$lang['TZ']['12'] = 'GMT + 12 Hours';
|
||||||
$lang['TZ']['13'] = 'GMT + 13 Hours';
|
$lang['TZ']['13'] = 'GMT + 13 Hours';
|
||||||
|
|
||||||
|
$lang['TODAY'] = 'Today';
|
||||||
|
$lang['YESTERDAY'] = 'Yesterday';
|
||||||
|
|
||||||
$lang['DATETIME']['SUNDAY'] = 'Sunday';
|
$lang['DATETIME']['SUNDAY'] = 'Sunday';
|
||||||
$lang['DATETIME']['MONDAY'] = 'Monday';
|
$lang['DATETIME']['MONDAY'] = 'Monday';
|
||||||
$lang['DATETIME']['TUESDAY'] = 'Tuesday';
|
$lang['DATETIME']['TUESDAY'] = 'Tuesday';
|
||||||
|
|
|
@ -999,6 +999,9 @@ $lang['TZ']['11'] = 'GMT + 11';
|
||||||
$lang['TZ']['12'] = 'GMT + 12';
|
$lang['TZ']['12'] = 'GMT + 12';
|
||||||
$lang['TZ']['13'] = 'GMT + 13';
|
$lang['TZ']['13'] = 'GMT + 13';
|
||||||
|
|
||||||
|
$lang['TODAY'] = 'Сегодня';
|
||||||
|
$lang['YESTERDAY'] = 'Вчера';
|
||||||
|
|
||||||
$lang['DATETIME']['SUNDAY'] = 'Воскресенье';
|
$lang['DATETIME']['SUNDAY'] = 'Воскресенье';
|
||||||
$lang['DATETIME']['MONDAY'] = 'Понедельник';
|
$lang['DATETIME']['MONDAY'] = 'Понедельник';
|
||||||
$lang['DATETIME']['TUESDAY'] = 'Вторник';
|
$lang['DATETIME']['TUESDAY'] = 'Вторник';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue