mirror of
https://github.com/WerySkok/nativegallery.git
synced 2024-12-22 16:41:17 +03:00
extended profile edit
This commit is contained in:
parent
bc57f6b97c
commit
ac7deee234
3 changed files with 162 additions and 20 deletions
BIN
static/img/star.png
Normal file
BIN
static/img/star.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 133 KiB |
|
@ -21,16 +21,22 @@ $userprofile = new User(explode('/', $_SERVER['REQUEST_URI'])[2]);
|
|||
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Navbar.php'); ?>
|
||||
<tr>
|
||||
<td class="main">
|
||||
<h1><?= $userprofile->i('username') ?></h1>
|
||||
<h1><?= $userprofile->i('username') ?><?php if ($userprofile->i('admin') === 1) { echo '<img width="32" src="/static/img/star.png">'; } ?></h1>
|
||||
|
||||
<?php
|
||||
if ($userprofile->i('id') === Auth::userid()) { ?>
|
||||
<p><b><a href="/lk/profile">Редактировать мой профиль</a></b></p>
|
||||
<?php } ?>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<?php if ($userprofile->content('badge') !== null) { ?>
|
||||
<div style="float:left; border:solid 1px #3b7dc1; padding:6px 10px 7px; margin-bottom:13px; background-color:#0199ff44"><b><?=nl2br($userprofile->content('badge'))?></div><br>
|
||||
<?php } ?>
|
||||
<td valign="top" width="100%">
|
||||
<div class="p20" style="padding-right:12px">
|
||||
<table>
|
||||
<table style="margin-bottom: 15px;">
|
||||
<colgroup><col width="170px">
|
||||
</colgroup>
|
||||
<col width="170px">
|
||||
<?php
|
||||
if ($userprofile->content('location') !== null) { ?>
|
||||
|
@ -46,6 +52,109 @@ $userprofile = new User(explode('/', $_SERVER['REQUEST_URI'])[2]);
|
|||
<td><?= json_decode($userprofile->i('content'), true)['aboutlive']['value'] ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (json_decode($userprofile->i('content'), true)['aboutbirthday']['value'] != null) { ?>
|
||||
<tr>
|
||||
<td class="sm" style="padding:3px 10px 3px 0">День рождения:</td>
|
||||
<td><?= json_decode($userprofile->i('content'), true)['aboutbirthday']['value'] ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</col></table>
|
||||
<table style="margin-bottom: 15px;">
|
||||
<colgroup><col width="170px">
|
||||
</colgroup>
|
||||
<?php
|
||||
if (json_decode($userprofile->i('content'), true)['aboutlangs']['value'] != null) { ?>
|
||||
<tr>
|
||||
<td class="sm" style="padding:3px 10px 3px 0">Владение языками:</td>
|
||||
<td><?= json_decode($userprofile->i('content'), true)['aboutlangs']['value'] ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (json_decode($userprofile->i('content'), true)['abouttelegram']['value'] != null) { ?>
|
||||
<tr>
|
||||
<td class="sm" style="padding:3px 10px 3px 0">Telegram:</td>
|
||||
<td><?= json_decode($userprofile->i('content'), true)['abouttelegram']['value'] ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (json_decode($userprofile->i('content'), true)['aboutvk']['value'] != null) { ?>
|
||||
<tr>
|
||||
<td class="sm" style="padding:3px 10px 3px 0">ВКонтакте:</td>
|
||||
<td><?= json_decode($userprofile->i('content'), true)['aboutvk']['value'] ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (json_decode($userprofile->i('content'), true)['abouttwitter']['value'] != null) { ?>
|
||||
<tr>
|
||||
<td class="sm" style="padding:3px 10px 3px 0">Twitter/X:</td>
|
||||
<td><?= json_decode($userprofile->i('content'), true)['abouttwitter']['value'] ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (json_decode($userprofile->i('content'), true)['aboutyoutube']['value'] != null) { ?>
|
||||
<tr>
|
||||
<td class="sm" style="padding:3px 10px 3px 0">Twitter/X:</td>
|
||||
<td><?= json_decode($userprofile->i('content'), true)['aboutyoutube']['value'] ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (json_decode($userprofile->i('content'), true)['aboutemail']['value'] != null) { ?>
|
||||
<tr>
|
||||
<td class="sm" style="padding:3px 10px 3px 0">Почта:</td>
|
||||
<td><?= json_decode($userprofile->i('content'), true)['aboutemail']['value'] ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (json_decode($userprofile->i('content'), true)['aboutinstagram']['value'] != null) { ?>
|
||||
<tr>
|
||||
<td class="sm" style="padding:3px 10px 3px 0">Instagram:</td>
|
||||
<td><?= json_decode($userprofile->i('content'), true)['aboutinstagram']['value'] ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (json_decode($userprofile->i('content'), true)['abouttransphoto']['value'] != null) { ?>
|
||||
<tr>
|
||||
<td class="sm" style="padding:3px 10px 3px 0">TransPhoto:</td>
|
||||
<td><?= json_decode($userprofile->i('content'), true)['abouttransphoto']['value'] ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (json_decode($userprofile->i('content'), true)['aboutwebsite']['value'] != null) { ?>
|
||||
<tr>
|
||||
<td class="sm" style="padding:3px 10px 3px 0">Личный сайт:</td>
|
||||
<td><?= json_decode($userprofile->i('content'), true)['aboutwebsite']['value'] ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<table style="margin-bottom: 15px;">
|
||||
<colgroup><col width="170px">
|
||||
</colgroup>
|
||||
<?php
|
||||
if (json_decode($userprofile->i('content'), true)['aboutfavs_trains']['value'] != null) { ?>
|
||||
<tr>
|
||||
<td class="sm" style="padding:3px 10px 3px 0">Любимые модели поездов:</td>
|
||||
<td><?= json_decode($userprofile->i('content'), true)['aboutfavs_trains']['value'] ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (json_decode($userprofile->i('content'), true)['aboutfavs_countries']['value'] != null) { ?>
|
||||
<tr>
|
||||
<td class="sm" style="padding:3px 10px 3px 0">Любимые страны:</td>
|
||||
<td><?= json_decode($userprofile->i('content'), true)['aboutfavs_countries']['value'] ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (json_decode($userprofile->i('content'), true)['aboutfavs_cities']['value'] != null) { ?>
|
||||
<tr>
|
||||
<td class="sm" style="padding:3px 10px 3px 0">Любимые города:</td>
|
||||
<td><?= json_decode($userprofile->i('content'), true)['aboutfavs_cities']['value'] ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<table>
|
||||
<colgroup><col width="170px">
|
||||
</colgroup>
|
||||
<tr>
|
||||
<td class="sm" style="padding:3px 10px 3px 0">Дата регистрации:</td>
|
||||
<td><span class="sm"><?= Date::zmdate($userprofile->content('regdate')) ?></span></td>
|
||||
|
|
|
@ -96,7 +96,7 @@ $user = new User(Auth::userid());
|
|||
|
||||
<div id="userphoto_big_div" style="position:absolute; display:none; padding:10px; background-color:white; margin:auto; text-align:center; left:10px" class="p5 shadow"><a href="#" onclick="hideUserPhoto(); return false"><img alt="" src="" id="userphoto_big_img" border="0"></a><br><br><a href="#" onclick="hideUserPhoto(); return false">закрыть</a></div>
|
||||
|
||||
<p>Ссылка на публичный профиль: <b><a href="/author/<?=Auth::userid()?>/" class="nw"><?=$user->i('username')?></a></b></p>
|
||||
<p>Ссылка на публичный профиль: <b><a href="/author/<?= Auth::userid() ?>/" class="nw"><?= $user->i('username') ?></a></b></p>
|
||||
<form method="post" name="form" id="form" enctype="multipart/form-data" style="display:inline-block">
|
||||
<input type="hidden" name="MAX_FILE_SIZE" value="215040">
|
||||
|
||||
|
@ -114,7 +114,8 @@ $user = new User(Auth::userid());
|
|||
|
||||
|
||||
<?php
|
||||
function getSelectedCountryId() {
|
||||
function getSelectedCountryId()
|
||||
{
|
||||
$user = new User(Auth::userid());
|
||||
$result = json_decode($user->i('content'), true)['aboutrid']['value'];
|
||||
return $result;
|
||||
|
@ -224,10 +225,11 @@ $user = new User(Auth::userid());
|
|||
<option value="48">Япония</option>
|
||||
<option value="26">Прочее</option>
|
||||
';
|
||||
function addSelectedAttribute($optionsHtml, $selectedValue) {
|
||||
function addSelectedAttribute($optionsHtml, $selectedValue)
|
||||
{
|
||||
return preg_replace_callback(
|
||||
'/<option value="(\d+)"(.*?)>(.*?)<\/option>/',
|
||||
function($matches) use ($selectedValue) {
|
||||
function ($matches) use ($selectedValue) {
|
||||
$selected = ($matches[1] == $selectedValue) ? ' selected' : '';
|
||||
return '<option value="' . $matches[1] . '"' . $selected . $matches[2] . '>' . $matches[3] . '</option>';
|
||||
},
|
||||
|
@ -243,11 +245,20 @@ $user = new User(Auth::userid());
|
|||
|
||||
<div style="margin-bottom:3px; margin-top:5px">Страна:</div>
|
||||
<select name="aboutrid" style="width:100%">
|
||||
<?=addSelectedAttribute($optionsHtml, $selectedCountryId)?>
|
||||
<?= addSelectedAttribute($optionsHtml, $selectedCountryId) ?>
|
||||
</select>
|
||||
<div style="margin-bottom:3px; margin-top:5px">Откуда:</div>
|
||||
<input type="text" name="aboutlive" id="live" style="width:100%" maxlength="50" value="<?=json_decode($user->i('content'), true)['aboutlive']['value']?>">
|
||||
|
||||
<input type="text" name="aboutlive" id="live" style="width:100%" maxlength="50" value="<?= json_decode($user->i('content'), true)['aboutlive']['value'] ?>">
|
||||
<div style="margin-bottom:3px; margin-top:5px">Дата рождения</div>
|
||||
<input type="text" name="aboutbirthday" id="live" style="width:100%" maxlength="50" value="<?= json_decode($user->i('content'), true)['aboutbirthday']['value'] ?>">
|
||||
<div style="margin-bottom:3px; margin-top:5px">Владение языками</div>
|
||||
<input type="text" name="aboutlangs" id="live" style="width:100%" maxlength="50" value="<?= json_decode($user->i('content'), true)['aboutlangs']['value'] ?>">
|
||||
<div style="margin-bottom:3px; margin-top:5px">Пол</div>
|
||||
<select name="sex" style="width:100%">
|
||||
<option value="0">(не указан)</option>
|
||||
<option value="1" selected="">мужской</option>
|
||||
<option value="2">женский</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -258,9 +269,31 @@ $user = new User(Auth::userid());
|
|||
<h4>О себе</h4>
|
||||
|
||||
<div style="margin-bottom:15px">
|
||||
<textarea name="aboutmemo" style="width:100%; height:200px"><?=json_decode($user->i('content'), true)['aboutmemo']['value']?></textarea>
|
||||
<textarea name="aboutmemo" style="width:100%; height:200px"><?= json_decode($user->i('content'), true)['aboutmemo']['value'] ?></textarea>
|
||||
|
||||
</div>
|
||||
<div style="margin-bottom:3px; margin-top:5px">Telegram</div>
|
||||
<input type="text" name="abouttelegram" id="live" style="width:100%" maxlength="50" value="<?= json_decode($user->i('content'), true)['abouttelegram']['value'] ?>">
|
||||
<div style="margin-bottom:3px; margin-top:5px">ВКонтакте</div>
|
||||
<input type="text" name="aboutvk" id="live" style="width:100%" maxlength="50" value="<?= json_decode($user->i('content'), true)['aboutvk']['value'] ?>">
|
||||
<div style="margin-bottom:3px; margin-top:5px">Twitter/X</div>
|
||||
<input type="text" name="abouttwitter" id="live" style="width:100%" maxlength="50" value="<?= json_decode($user->i('content'), true)['abouttwitter']['value'] ?>">
|
||||
<div style="margin-bottom:3px; margin-top:5px">YouTube</div>
|
||||
<input type="text" name="aboutyoutube" id="live" style="width:100%" maxlength="50" value="<?= json_decode($user->i('content'), true)['aboutyoutube']['value'] ?>">
|
||||
<div style="margin-bottom:3px; margin-top:5px">Почта</div>
|
||||
<input type="text" name="aboutemail" id="live" style="width:100%" maxlength="50" value="<?= json_decode($user->i('content'), true)['aboutemail']['value'] ?>">
|
||||
<div style="margin-bottom:3px; margin-top:5px">Instagram</div>
|
||||
<input type="text" name="aboutinstagram" id="live" style="width:100%" maxlength="50" value="<?= json_decode($user->i('content'), true)['aboutinstagram']['value'] ?>">
|
||||
<div style="margin-bottom:3px; margin-top:5px">TransPhoto</div>
|
||||
<input type="text" name="abouttransphoto" id="live" style="width:100%" maxlength="50" value="<?= json_decode($user->i('content'), true)['abouttransphoto']['value'] ?>">
|
||||
<div style="margin-bottom:3px; margin-top:5px">Личный сайт</div>
|
||||
<input type="text" name="aboutwebsite" id="live" style="width:100%; margin-bottom: 35px;" maxlength="50" value="<?= json_decode($user->i('content'), true)['aboutwebsite']['value'] ?>">
|
||||
<div style="margin-bottom:3px; margin-top:5px">Любимые модели поездов</div>
|
||||
<input type="text" name="aboutfavs_trains" id="live" style="width:100%" maxlength="50" value="<?= json_decode($user->i('content'), true)['aboutfavs_trains']['value'] ?>">
|
||||
<div style="margin-bottom:3px; margin-top:5px">Любимые страны</div>
|
||||
<input type="text" name="aboutfavs_countries" id="live" style="width:100%" maxlength="50" value="<?= json_decode($user->i('content'), true)['aboutfavs_countries']['value'] ?>">
|
||||
<div style="margin-bottom:3px; margin-top:5px">Любимые города</div>
|
||||
<input type="text" name="aboutfavs_cities" id="live" style="width:100%" maxlength="50" value="<?= json_decode($user->i('content'), true)['aboutfavs_cities']['value'] ?>">
|
||||
|
||||
<div style="margin-bottom:7px"><b>Фотография</b></div>
|
||||
<div style="margin-bottom:15px">
|
||||
|
@ -284,7 +317,7 @@ $user = new User(Auth::userid());
|
|||
</tr>
|
||||
<tr>
|
||||
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Footer.php'); ?>
|
||||
</tr>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue