mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
r109
git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@109 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
30029cff21
commit
7d23779f34
6 changed files with 30 additions and 23 deletions
|
@ -81,10 +81,11 @@ switch ($field)
|
||||||
}
}
|
}
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$value = 0;
|
||||||
$next_birthday_greeting = 0;
}
|
$next_birthday_greeting = 0;
}
|
||||||
DB()->query("UPDATE $table SET user_next_birthday_greeting = $next_birthday_greeting WHERE user_id = $user_id LIMIT 1");
|
DB()->query("UPDATE $table SET user_next_birthday_greeting = $next_birthday_greeting WHERE user_id = $user_id LIMIT 1");
|
||||||
|
|
||||||
$this->response['new_value'] = $this->request['value'];
|
$this->response['new_value'] = $this->request['value'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'user_from':
|
case 'user_from':
|
||||||
|
|
|
@ -57,8 +57,8 @@ $bb_cfg['css_ver'] = 1;
|
||||||
|
|
||||||
// Increase number of revision after update
|
// Increase number of revision after update
|
||||||
$bb_cfg['tp_version'] = '2.0.2';
|
$bb_cfg['tp_version'] = '2.0.2';
|
||||||
$bb_cfg['tp_release_state'] = 'TP II r107';
|
$bb_cfg['tp_release_state'] = 'TP II r109';
|
||||||
$bb_cfg['tp_release_date'] = '14-07-2011';
|
$bb_cfg['tp_release_date'] = '15-07-2011';
|
||||||
|
|
||||||
$bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger
|
$bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger
|
||||||
$bb_cfg['srv_overloaded_msg'] = "Извините, в данный момент сервер перегружен\nПопробуйте повторить запрос через несколько минут";
|
$bb_cfg['srv_overloaded_msg'] = "Извините, в данный момент сервер перегружен\nПопробуйте повторить запрос через несколько минут";
|
||||||
|
|
|
@ -2059,8 +2059,16 @@ function mkrealdate($day, $month, $birth_year)
|
||||||
|
|
||||||
function realdate($date, $format = "Ymd")
|
function realdate($date, $format = "Ymd")
|
||||||
{
|
{
|
||||||
|
if(!$date) return;
|
||||||
return bb_date($date*86400+1, $format, 0);
|
return bb_date($date*86400+1, $format, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function birthday_age($date)
|
||||||
|
{
|
||||||
|
if(!$date) return;
|
||||||
|
return delta_time(mktime(0, 0, 0, 0, 0, realdate($date, 'Y')));
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Pagination routine, generates
|
// Pagination routine, generates
|
||||||
// page number sequence
|
// page number sequence
|
||||||
|
|
|
@ -338,29 +338,28 @@ foreach ($profile_fields as $field => $can_edit)
|
||||||
* Возраст (edit, reg)
|
* Возраст (edit, reg)
|
||||||
*/
|
*/
|
||||||
case 'user_birthday':
|
case 'user_birthday':
|
||||||
if($birthday = $pr_data['user_birthday'])
|
$b_day = (isset($_POST['b_day'])) ? (int) $_POST['b_day'] : realdate($pr_data['user_birthday'], 'j');
|
||||||
|
$b_md = (isset($_POST['b_md'])) ? (int) $_POST['b_md'] : realdate($pr_data['user_birthday'], 'n');
|
||||||
|
$b_year = (isset($_POST['b_year'])) ? (int) $_POST['b_year'] : realdate($pr_data['user_birthday'], 'Y');
|
||||||
|
|
||||||
|
if ($b_day || $b_md || $b_year)
|
||||||
{
|
{
|
||||||
$b_day = (isset($_POST['b_day'])) ? (int) $_POST['b_day'] : realdate($pr_data['user_birthday'], 'j');
|
if (!checkdate($b_md, $b_day, $b_year))
|
||||||
$b_md = (isset($_POST['b_md'])) ? (int) $_POST['b_md'] : realdate($pr_data['user_birthday'], 'n');
|
|
||||||
$b_year = (isset($_POST['b_year'])) ? (int) $_POST['b_year'] : realdate($pr_data['user_birthday'], 'Y');
|
|
||||||
if ($b_day || $b_md || $b_year)
|
|
||||||
{
|
{
|
||||||
if (!checkdate($b_md, $b_day, $b_year))
|
$errors[] = $lang['WRONG_BIRTHDAY_FORMAT'];
|
||||||
{
|
$birthday = $next_birthday_greeting = 0;
|
||||||
$errors[] = $lang['WRONG_BIRTHDAY_FORMAT'];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$birthday = mkrealdate($b_day, $b_md, $b_year);
|
|
||||||
$next_birthday_greeting = (date('md') < $b_md . (($b_day <= 9) ? '0' : '') . $b_day) ? date('Y') : date('Y')+1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$birthday = 0;
|
$birthday = mkrealdate($b_day, $b_md, $b_year);
|
||||||
$next_birthday_greeting = 0;
|
$next_birthday_greeting = (date('md') < $b_md . (($b_day <= 9) ? '0' : '') . $b_day) ? date('Y') : date('Y')+1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$birthday = $next_birthday_greeting = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ($submit && $birthday != $pr_data['user_birthday'])
|
if ($submit && $birthday != $pr_data['user_birthday'])
|
||||||
{
|
{
|
||||||
$pr_data['user_birthday'] = $birthday;
|
$pr_data['user_birthday'] = $birthday;
|
||||||
|
|
|
@ -200,7 +200,7 @@ $template->assign_vars(array(
|
||||||
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : '',
|
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : '',
|
||||||
'GENDER' => ( $profiledata['user_gender'] ) ? $lang['GENDER_SELECT'][$profiledata['user_gender']] : '',
|
'GENDER' => ( $profiledata['user_gender'] ) ? $lang['GENDER_SELECT'][$profiledata['user_gender']] : '',
|
||||||
'BIRTHDAY' => ( $profiledata['user_birthday'] ) ? realdate($profiledata['user_birthday'], 'Y-m-d') : '',
|
'BIRTHDAY' => ( $profiledata['user_birthday'] ) ? realdate($profiledata['user_birthday'], 'Y-m-d') : '',
|
||||||
'AGE' => ( $profiledata['user_birthday'] ) ? bb_date(TIMENOW, 'Y') - realdate($profiledata['user_birthday'], 'Y') : '',
|
'AGE' => ( $profiledata['user_birthday'] ) ? birthday_age($profiledata['user_birthday']) : '',
|
||||||
'AVATAR_IMG' => $avatar_img,
|
'AVATAR_IMG' => $avatar_img,
|
||||||
|
|
||||||
'L_VIEWING_PROFILE' => sprintf($lang['VIEWING_USER_PROFILE'], $profiledata['username']),
|
'L_VIEWING_PROFILE' => sprintf($lang['VIEWING_USER_PROFILE'], $profiledata['username']),
|
||||||
|
|
|
@ -247,9 +247,8 @@ $(document).ready(function(){
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{L_AGE}:</th>
|
<th>{L_AGE}:</th>
|
||||||
<td id="user_birthday"><b class="editable">{AGE}</b></td>
|
<td><b>{AGE}</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- BEGIN switch_upload_limits -->
|
<!-- BEGIN switch_upload_limits -->
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue