mirror of
https://github.com/claradex/nativegallery.git
synced 2024-11-14 19:19:08 +03:00
photoindex implementation
This commit is contained in:
parent
83c344ee80
commit
6f725d0d70
8 changed files with 92 additions and 4 deletions
|
@ -17,6 +17,11 @@ class ProfileController
|
|||
{
|
||||
Page::set('Profile/Index');
|
||||
}
|
||||
public static function photoindexhistory()
|
||||
{
|
||||
Page::set('Profile/LK/PhotoIndexHistory');
|
||||
|
||||
}
|
||||
public static function upload()
|
||||
{
|
||||
Page::set('Profile/UploadPhoto');
|
||||
|
|
|
@ -42,7 +42,8 @@ class Routes
|
|||
Router::get('/lk/upload', 'ProfileController@upload');
|
||||
Router::get('/lk/history', 'ProfileController@lkhistory');
|
||||
Router::get('/lk/profile', 'ProfileController@lkprofile');
|
||||
|
||||
Router::get('/lk/pday', 'ProfileController@photoindexhistory');
|
||||
|
||||
Router::get('/fav_authors', 'MainController@favauthors');
|
||||
|
||||
Router::get('/search', 'SearchController@i');
|
||||
|
|
|
@ -47,6 +47,11 @@ ngallery:
|
|||
upload:
|
||||
allow: true
|
||||
photo:
|
||||
uploadindex:
|
||||
enabled: false
|
||||
default: 5
|
||||
acceptvalue: 1
|
||||
declinevalue: 2
|
||||
upload:
|
||||
allow: true
|
||||
premoderation: true
|
||||
|
|
BIN
static/img/scale1.png
Normal file
BIN
static/img/scale1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
|
@ -6,7 +6,8 @@ function createModal(id, type, value) {
|
|||
<span data-modal-id="`+id+`" class="close">×</span>
|
||||
<h3><b>Отредактировать комментарий</b></h3>
|
||||
<div style="padding:0 11px 11px">
|
||||
<textarea name="wtext" id="bodypost__commedit`+id+`">`+value+`</textarea><br>
|
||||
<textarea style=" width: 100%;
|
||||
height: 200px;" name="wtext" id="bodypost__commedit`+id+`">`+value+`</textarea><br>
|
||||
<p id="statusSend" style="display: none;">Ошибка</p>
|
||||
<div class="cmt-submit">
|
||||
<button type="submit" onclick="editComment('` + id + `', document.getElementById('bodypost__commedit` + id + `').value)" id="sbmt">Отредактировать</button>  Ctrl + Enter
|
||||
|
|
|
@ -94,7 +94,7 @@ use \App\Models\User;
|
|||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-check">
|
||||
<input name="decline" value="1" class="form-check-input" type="radio" name="flexRadioDefault" id="declineReason1">
|
||||
<input name="decline'.$p['id'].'" value="1" class="form-check-input" type="radio" name="flexRadioDefault" id="declineReason1">
|
||||
<label class="form-check-label" for="declineReason1">
|
||||
Малоинформативный бред
|
||||
</label>
|
||||
|
|
|
@ -24,8 +24,21 @@ $user = new User(Auth::userid());
|
|||
<p>
|
||||
Количество ваших фотографий на сайте: <b><?=DB::query('SELECT COUNT(*) FROM photos WHERE user_id=:uid AND moderated=1', array(':uid'=>Auth::userid()))[0]['COUNT(*)']?></b></p>
|
||||
<p>
|
||||
<?php
|
||||
|
||||
if (NGALLERY['root']['photo']['uploadindex']['enabled'] === true) {
|
||||
$strokewidth = 4 * $user->i('uploadindex');
|
||||
?>
|
||||
<h4>Индекс загрузки</h4>
|
||||
<p>Текущее значение <a href="/page/111" class="und">индекса загрузки</a>: <b><?=$user->i('uploadindex')?></b></p>
|
||||
<p>Текущее значение <a href="/page/111" class="und">индекса загрузки</a>: <b><?=$user->i('uploadindex')?></b></p>
|
||||
<div class="p20" style="float:left; padding:15px 15px 20px; width:240px">
|
||||
<div style="background-color:#fff; width:240px; height:16px"></div>
|
||||
<div style="background-color:#599fe7; width:<?=$strokewidth?>px; height:14px; position:relative; top:-15px; margin-bottom:-19px"></div>
|
||||
<img src="/static/img/scale1.png" style="position:relative; top:-12px; margin-left:-5px; margin-bottom:-22px">
|
||||
</div><br clear="all" />
|
||||
<p><a href="/lk/pday" class="und">История изменения индекса загрузки</a></p>
|
||||
|
||||
<?php } ?>
|
||||
<br clear="all" />
|
||||
|
||||
|
||||
|
|
63
views/pages/Profile/LK/PhotoIndexHistory.php
Normal file
63
views/pages/Profile/LK/PhotoIndexHistory.php
Normal file
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
|
||||
use \App\Services\{Auth, DB, Date};
|
||||
use \App\Models\User;
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
|
||||
<head>
|
||||
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/LoadHead.php'); ?>
|
||||
|
||||
<body>
|
||||
<div id="backgr"></div>
|
||||
<table class="tmain">
|
||||
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Navbar.php'); ?>
|
||||
<tr>
|
||||
<td class="main">
|
||||
<center>
|
||||
<h1>История изменения индекса загрузки</h1>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Дата и время</th>
|
||||
<th class="r">Индекс</th>
|
||||
<th class="r">Изменение</th>
|
||||
<th>Действие</th>
|
||||
<th>Фотография</th>
|
||||
</tr>
|
||||
<?php
|
||||
$indexhistory = DB::query('SELECT * FROM uploadindex_history WHERE user_id=:uid ORDER BY id DESC', array(':uid'=>Auth::userid()));
|
||||
foreach ($indexhistory as $ih) {
|
||||
if ($ih['type'] === 1) {
|
||||
$type = 'Публикация';
|
||||
$class = 's12';
|
||||
} else if ($ih['type'] === 2) {
|
||||
$type = 'Отклонение';
|
||||
$class = 's15';
|
||||
}
|
||||
echo '<tr class="'.$class.'">
|
||||
<td class="ds">09.07.2024 15:39:10</td>
|
||||
<td class="r"><b>2.5</b></td>
|
||||
<td class="r">+0.5</td>
|
||||
<td class="ds">'.$type.'</td>
|
||||
<td class="d"><a href="/photo/'.$ih['photo_id'].'" target="_blank">/photo/'.$ih['photo_id'].'</a></td>
|
||||
</tr>';
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</table><br>
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Footer.php'); ?>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in a new issue