Profile: Added birthday

This commit is contained in:
0x7d5 2021-09-13 21:34:02 +05:00
parent af6849edcc
commit bbf113bfd5
6 changed files with 23 additions and 1 deletions

View file

@ -304,6 +304,11 @@ class User extends RowModel
return $this->getRecord()->notification_offset; return $this->getRecord()->notification_offset;
} }
function getBirthday(): int
{
return $this->getRecord()->birthday;
}
function updateNotificationOffset(): void function updateNotificationOffset(): void
{ {
$this->stateChanges("notification_offset", time()); $this->stateChanges("notification_offset", time());

View file

@ -102,6 +102,8 @@ final class UserPresenter extends OpenVKPresenter
$user->setLast_Name(empty($this->postParam("last_name")) ? "" : $this->postParam("last_name")); $user->setLast_Name(empty($this->postParam("last_name")) ? "" : $this->postParam("last_name"));
$user->setPseudo(empty($this->postParam("pseudo")) ? NULL : $this->postParam("pseudo")); $user->setPseudo(empty($this->postParam("pseudo")) ? NULL : $this->postParam("pseudo"));
$user->setStatus(empty($this->postParam("status")) ? NULL : $this->postParam("status")); $user->setStatus(empty($this->postParam("status")) ? NULL : $this->postParam("status"));
if (strtotime($this->postParam("birthday")) > 10)
$user->setBirthday(strtotime($this->postParam("birthday")));
if ($this->postParam("marialstatus") <= 8 && $this->postParam("marialstatus") >= 0) if ($this->postParam("marialstatus") <= 8 && $this->postParam("marialstatus") >= 0)
$user->setMarital_Status($this->postParam("marialstatus")); $user->setMarital_Status($this->postParam("marialstatus"));

View file

@ -130,6 +130,14 @@
</select> </select>
</td> </td>
</tr> </tr>
<tr>
<td width="120" valign="top">
<span class="nobold">День рождения: </span>
</td>
<td>
<input name="birthday" value={gmdate("Y-m-d", $user->getBirthday())} type="date"/>
</td>
</tr>
<tr> <tr>
<td> <td>

View file

@ -357,6 +357,10 @@
<td class="label"><span class="nobold">{_"politViews"}:</span></td> <td class="label"><span class="nobold">{_"politViews"}:</span></td>
<td class="data">{var $pviews = $user->getPoliticalViews()}{_"politViews_$pviews"}</td> <td class="data">{var $pviews = $user->getPoliticalViews()}{_"politViews_$pviews"}</td>
</tr> </tr>
<tr>
<td class="label"><span class="nobold">{_"birth_date"}:</span></td>
<td class="data">{date('d F Y',$user->getBirthday())}, {date('Y') - date('Y', $user->getBirthday())} {_"years"}</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

View file

@ -36,6 +36,8 @@
"online" = "Online"; "online" = "Online";
"was_online" = "was online"; "was_online" = "was online";
"was_online_m" = "was online"; "was_online_m" = "was online";
"years" = "y.o";
%{ For male and female %} %{ For male and female %}
"was_online_f" = "was online"; "was_online_f" = "was online";

View file

@ -43,6 +43,7 @@
"status" = "Статус"; "status" = "Статус";
"no_information_provided" = "Информация отсутствует."; "no_information_provided" = "Информация отсутствует.";
"deceased_person" = "Страница покойного человека"; "deceased_person" = "Страница покойного человека";
"years" = "лет";
"relationship" = "Семейное положение"; "relationship" = "Семейное положение";