git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@168 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
pherum83 2011-07-27 15:59:01 +00:00
commit 5ad1692e5e
2 changed files with 12 additions and 6 deletions

View file

@ -14,7 +14,7 @@ if (!$field = (string) $this->request['field'])
} }
$table = BB_USERS; $table = BB_USERS;
$value = (string) $this->request['value']; $value = $this->request['value'] = (string) (isset($this->request['value'])) ? $this->request['value'] : 0;
switch ($field) switch ($field)
{ {
@ -52,7 +52,9 @@ switch ($field)
$this->ajax_die('error'); $this->ajax_die('error');
} }
else else
{ $this->response['new_value'] = $lang['GENDER_SELECT'][$value]; } {
$this->response['new_value'] = $lang['GENDER_SELECT'][$value];
}
break; break;
case 'user_birthday': case 'user_birthday':
@ -65,7 +67,9 @@ switch ($field)
if($b_day || $b_md || $b_year) if($b_day || $b_md || $b_year)
{ {
if((bb_date(TIMENOW, 'Y') - $b_year) > $bb_cfg['birthday']['max_user_age']) if((bb_date(TIMENOW, 'Y') - $b_year) > $bb_cfg['birthday']['max_user_age'])
{ $this->ajax_die(sprintf($lang['BIRTHDAY_TO_HIGH'], $bb_cfg['birthday']['max_user_age'])); } {
$this->ajax_die(sprintf($lang['BIRTHDAY_TO_HIGH'], $bb_cfg['birthday']['max_user_age']));
}
else if((bb_date(TIMENOW, 'Y') - $b_year) < $bb_cfg['birthday']['min_user_age']) else if((bb_date(TIMENOW, 'Y') - $b_year) < $bb_cfg['birthday']['min_user_age'])
{ {
$this->ajax_die(sprintf($lang['BIRTHDAY_TO_LOW'], $bb_cfg['birthday']['min_user_age'])); $this->ajax_die(sprintf($lang['BIRTHDAY_TO_LOW'], $bb_cfg['birthday']['min_user_age']));
@ -78,11 +82,13 @@ switch ($field)
{ {
$value = mkrealdate($b_day, $b_md, $b_year); $value = 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; $next_birthday_greeting = (date('md') < $b_md . (($b_day <= 9) ? '0' : '') . $b_day) ? date('Y') : date('Y')+1;
} } }
}
else else
{ {
$value = 0; $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'];

View file

@ -57,7 +57,7 @@ $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 r167'; $bb_cfg['tp_release_state'] = 'TP II r168';
$bb_cfg['tp_release_date'] = '27-07-2011'; $bb_cfg['tp_release_date'] = '27-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