mirror of
https://github.com/claradex/nativegallery.git
synced 2025-02-23 03:59:50 +03:00
update pages
This commit is contained in:
parent
be2963117a
commit
1dab03afe8
2 changed files with 80 additions and 71 deletions
|
@ -31,6 +31,13 @@ use \App\Models\User;
|
||||||
<div class="p20p">
|
<div class="p20p">
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if (DB::query('SELECT status FROM contests WHERE status=1')[0]['status'] === 1) {
|
||||||
|
} else {
|
||||||
|
echo '<h2><b>Следующего конкурса нет. Пожалуйста, заходите сюда позже.</b></h2>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="pb_pre vote" style="padding-left:15px; padding-right:10px; display:table-cell" pid="2068639">
|
<td class="pb_pre vote" style="padding-left:15px; padding-right:10px; display:table-cell" pid="2068639">
|
||||||
<a href="#" vote="1" class="konk_btn"><span>Красиво, на конкурс!</span></a>
|
<a href="#" vote="1" class="konk_btn"><span>Красиво, на конкурс!</span></a>
|
||||||
|
|
|
@ -79,10 +79,10 @@ LIMIT 10;');
|
||||||
<div class="hpshade">
|
<div class="hpshade">
|
||||||
<div class="eye-icon">+' . $pd['view_count'] . '</div>
|
<div class="eye-icon">+' . $pd['view_count'] . '</div>
|
||||||
</div>';
|
</div>';
|
||||||
if ((int)$p['priority'] === 1) {
|
if ((int)$p['priority'] === 1) {
|
||||||
echo '<div class="temp" style="background-image:url(/static/img/cond.png)"></div>';
|
echo '<div class="temp" style="background-image:url(/static/img/cond.png)"></div>';
|
||||||
}
|
}
|
||||||
echo '
|
echo '
|
||||||
</a>';
|
</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,74 +126,76 @@ LIMIT 10;');
|
||||||
#contestNotify {
|
#contestNotify {
|
||||||
background-size: 550px 211.2px;
|
background-size: 550px 211.2px;
|
||||||
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 550 211.2" width="550" height="211.2" style="opacity: 0.3; filter: grayscale(0);"><text x="0em" y="1em" font-size="88" transform="rotate(17 55 52.8)">🎁</text><text x="1.25em" y="2em" font-size="88" transform="rotate(17 165 140.8)">🎈</text><text x="2.5em" y="1em" font-size="88" transform="rotate(17 275 52.8)">🎀</text><text x="3.75em" y="2em" font-size="88" transform="rotate(17 385 140.8)">🎊</text><text x="5em" y="1em" font-size="88" transform="rotate(17 495 52.8)">🎉</text></svg>');
|
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 550 211.2" width="550" height="211.2" style="opacity: 0.3; filter: grayscale(0);"><text x="0em" y="1em" font-size="88" transform="rotate(17 55 52.8)">🎁</text><text x="1.25em" y="2em" font-size="88" transform="rotate(17 165 140.8)">🎈</text><text x="2.5em" y="1em" font-size="88" transform="rotate(17 275 52.8)">🎀</text><text x="3.75em" y="2em" font-size="88" transform="rotate(17 385 140.8)">🎊</text><text x="5em" y="1em" font-size="88" transform="rotate(17 495 52.8)">🎉</text></svg>');
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<script>
|
||||||
|
function startCountdown(unixTimestamp) {
|
||||||
|
function padZero(num) {
|
||||||
|
return num < 10 ? '0' + num : num;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getWord(num, words) {
|
||||||
|
if (num % 10 === 1 && num % 100 !== 11) return words[0];
|
||||||
|
if (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)) return words[1];
|
||||||
|
return words[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateTimer() {
|
||||||
|
const now = Math.floor(Date.now() / 1000);
|
||||||
|
const diff = unixTimestamp - now;
|
||||||
|
|
||||||
|
if (diff <= 0) {
|
||||||
|
clearInterval(interval);
|
||||||
|
document.getElementById('countdown').textContent = "00 дней 00 часов 00 минут 00 секунд";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const days = Math.floor(diff / 86400);
|
||||||
|
const hours = Math.floor((diff % 86400) / 3600);
|
||||||
|
const minutes = Math.floor((diff % 3600) / 60);
|
||||||
|
const seconds = diff % 60;
|
||||||
|
|
||||||
|
document.getElementById('countdown').textContent =
|
||||||
|
`${padZero(days)} ${getWord(days, ['день', 'дня', 'дней'])} ` +
|
||||||
|
`${padZero(hours)} ${getWord(hours, ['час', 'часа', 'часов'])} ` +
|
||||||
|
`${padZero(minutes)} ${getWord(minutes, ['минута', 'минуты', 'минут'])} ` +
|
||||||
|
`${padZero(seconds)} ${getWord(seconds, ['секунда', 'секунды', 'секунд'])}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
updateTimer(); // сразу обновляем отображение
|
||||||
|
const interval = setInterval(updateTimer, 1000);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<?php
|
<?php
|
||||||
if (DB::query('SELECT status FROM contests WHERE status=2')[0]['status'] === 2) {
|
if (DB::query('SELECT status FROM contests WHERE status=2')[0]['status'] === 2) {
|
||||||
$contest = DB::query('SELECT * FROM contests WHERE status=2')[0];
|
$contest = DB::query('SELECT * FROM contests WHERE status=2')[0];
|
||||||
$theme = DB::query('SELECT * FROM contests_themes WHERE id=:id', array(':id'=>$contest['themeid']))[0];
|
$theme = DB::query('SELECT * FROM contests_themes WHERE id=:id', array(':id' => $contest['themeid']))[0];
|
||||||
echo ' <div id="contestNotify" style="float:left; border:solid 1px #171022; padding:6px 10px 7px; margin-bottom:13px; background-color:#E5D6FF"><h4>Фотоконкурс!</h4>
|
echo ' <div id="contestNotify" style="float:left; border:solid 1px #171022; padding:6px 10px 7px; margin-bottom:13px; background-color:#E5D6FF"><h4>Фотоконкурс!</h4>
|
||||||
Закончится через: <b id="countdown"></b><br>
|
Закончится через: <b id="countdown"></b><br>
|
||||||
Тематика: <b>'.$theme['title'].'</b><br>
|
Тематика: <b>' . $theme['title'] . '</b><br>
|
||||||
<b style="color: #412378;">Голосуйте за лучшие фотографии, которые должны стать победителями сегодняшнего конкурса!</b><br><br>
|
<b style="color: #412378;">Голосуйте за лучшие фотографии, которые должны стать победителями сегодняшнего конкурса!</b><br><br>
|
||||||
<a href="/voting" style="background-color: #37009D; color: #fff;" type="button">Голосовать!</a>';
|
<a href="/voting" style="background-color: #37009D; color: #fff;" type="button">Голосовать!</a>
|
||||||
|
<script>startCountdown(' . $contest['closedate'] . ');</script>';
|
||||||
} else if (DB::query('SELECT status FROM contests WHERE status=1')[0]['status'] === 1) {
|
} else if (DB::query('SELECT status FROM contests WHERE status=1')[0]['status'] === 1) {
|
||||||
$contest = DB::query('SELECT * FROM contests WHERE status=1')[0];
|
$contest = DB::query('SELECT * FROM contests WHERE status=1')[0];
|
||||||
$theme = DB::query('SELECT * FROM contests_themes WHERE id=:id', array(':id'=>$contest['themeid']))[0];
|
$theme = DB::query('SELECT * FROM contests_themes WHERE id=:id', array(':id' => $contest['themeid']))[0];
|
||||||
echo ' <div id="contestNotify" style="float:left; border:solid 1px #171022; padding:6px 10px 7px; margin-bottom:13px; background-color:#E5D6FF"><h4>Фотоконкурс!</h4>
|
echo ' <div id="contestNotify" style="float:left; border:solid 1px #171022; padding:6px 10px 7px; margin-bottom:13px; background-color:#E5D6FF"><h4>Фотоконкурс!</h4>
|
||||||
Начнётся через: <b id="countdown"></b><br>
|
Начнётся через: <b id="countdown"></b><br>
|
||||||
Тематика: <b>'.$theme.'</b><br>
|
Тематика: <b>' . $theme['title'] . '</b><br>
|
||||||
<b style="color: #412378;">Лучшие фотографии по мнению сообщества '.NGALLERY['root']['title'].' будут отмечены</b><br><br>
|
<b style="color: #412378;">Лучшие фотографии по мнению сообщества ' . NGALLERY['root']['title'] . ' будут отмечены</b><br><br>
|
||||||
<a href="/voting/sendpretend" style="background-color: #37009D; color: #fff;" type="button">Участвовать!</a>';
|
<a href="/voting/sendpretend" style="background-color: #37009D; color: #fff;" type="button">Участвовать!</a>
|
||||||
|
<script>startCountdown(' . $contest['closepretendsdate'] . ');</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
function startCountdown(unixTimestamp) {
|
|
||||||
function padZero(num) {
|
|
||||||
return num < 10 ? '0' + num : num;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getWord(num, words) {
|
|
||||||
if (num % 10 === 1 && num % 100 !== 11) return words[0];
|
|
||||||
if (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)) return words[1];
|
|
||||||
return words[2];
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateTimer() {
|
|
||||||
const now = Math.floor(Date.now() / 1000);
|
|
||||||
const diff = unixTimestamp - now;
|
|
||||||
|
|
||||||
if (diff <= 0) {
|
|
||||||
clearInterval(interval);
|
|
||||||
document.getElementById('countdown').textContent = "00 дней 00 часов 00 минут 00 секунд";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const days = Math.floor(diff / 86400);
|
|
||||||
const hours = Math.floor((diff % 86400) / 3600);
|
|
||||||
const minutes = Math.floor((diff % 3600) / 60);
|
|
||||||
const seconds = diff % 60;
|
|
||||||
|
|
||||||
document.getElementById('countdown').textContent =
|
</div>
|
||||||
`${padZero(days)} ${getWord(days, ['день', 'дня', 'дней'])} ` +
|
|
||||||
`${padZero(hours)} ${getWord(hours, ['час', 'часа', 'часов'])} ` +
|
|
||||||
`${padZero(minutes)} ${getWord(minutes, ['минута', 'минуты', 'минут'])} ` +
|
|
||||||
`${padZero(seconds)} ${getWord(seconds, ['секунда', 'секунды', 'секунд'])}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
updateTimer(); // сразу обновляем отображение
|
</div>
|
||||||
const interval = setInterval(updateTimer, 1000);
|
|
||||||
}
|
|
||||||
startCountdown(1740607200);
|
|
||||||
</script>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -207,26 +209,26 @@ startCountdown(1740607200);
|
||||||
$first_id = $photos[0]['id'];
|
$first_id = $photos[0]['id'];
|
||||||
$last_id = end($photos)['id'];
|
$last_id = end($photos)['id'];
|
||||||
?>
|
?>
|
||||||
<div id="recent-photos" class="ix-photos ix-photos-multiline" lastpid="<?=$first_id+1?>" firstpid="<?=$last_id?>">
|
<div id="recent-photos" class="ix-photos ix-photos-multiline" lastpid="<?= $first_id + 1 ?>" firstpid="<?= $last_id ?>">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="text-align:center; margin:10px 0"><input type="button" name="button" id="loadmore" class="" value="Загрузить ещё"></div>
|
<div style="text-align:center; margin:10px 0"><input type="button" name="button" id="loadmore" class="" value="Загрузить ещё"></div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4>Сейчас на сайте (<?= DB::query('SELECT COUNT(*) FROM users WHERE online>=:time-300 ORDER BY online DESC', array(':time' => time()))[0]['COUNT(*)'] ?>)</h4>
|
<h4>Сейчас на сайте (<?= DB::query('SELECT COUNT(*) FROM users WHERE online>=:time-300 ORDER BY online DESC', array(':time' => time()))[0]['COUNT(*)'] ?>)</h4>
|
||||||
<div>
|
<div>
|
||||||
<?php
|
<?php
|
||||||
$online = DB::query('SELECT * FROM users WHERE online>=:time-300 ORDER BY online DESC', array(':time' => time()));
|
$online = DB::query('SELECT * FROM users WHERE online>=:time-300 ORDER BY online DESC', array(':time' => time()));
|
||||||
foreach ($online as $o) {
|
foreach ($online as $o) {
|
||||||
echo '<a href="/author/' . $o['id'] . '/">' . htmlspecialchars($o['username']) . '</a>, ';
|
echo '<a href="/author/' . $o['id'] . '/">' . htmlspecialchars($o['username']) . '</a>, ';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td style="padding-left:20px; width:254px; vertical-align:top">
|
<td style="padding-left:20px; width:254px; vertical-align:top">
|
||||||
|
|
||||||
|
@ -235,8 +237,8 @@ startCountdown(1740607200);
|
||||||
<?php
|
<?php
|
||||||
$news = DB::query('SELECT * FROM news ORDER BY id DESC LIMIT 10');
|
$news = DB::query('SELECT * FROM news ORDER BY id DESC LIMIT 10');
|
||||||
foreach ($news as $n) {
|
foreach ($news as $n) {
|
||||||
echo '<div class="ix-news-item"><b>'.Date::zmdate($n['time']).'</b>
|
echo '<div class="ix-news-item"><b>' . Date::zmdate($n['time']) . '</b>
|
||||||
<div class="break-links" style="padding-top:3px">'.$n['body'].'</div>
|
<div class="break-links" style="padding-top:3px">' . $n['body'] . '</div>
|
||||||
</div>';
|
</div>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in a new issue