wikipoints/ground/views/point.php

125 lines
5.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div style="z-index: -100; width: 100%; height: 100%; position: fixed; top: 0; left: 0; background-image: url(<?= $point->getImg('middle') ?>); background-size: cover; -webkit-filter: blur(10px);"></div>
<div class="container" style="background-color: rgba(255,255,255, 0.8);margin-top: -10px;padding-bottom: 30px;">
<div class="row">
<div class="col-md-12">
<h1 style="text-align: right;"><?= $point->name ?></h1>
<div class="coords-container">
Координаты:&nbsp;
<nobr>
<?= $point->lat > 0 ? 'N' : 'S' ?><?= number_format(abs($point->lat),5,'.','') ?>°
<?= $point->lng > 0 ? 'E' : 'W' ?><?= number_format(abs($point->lng),5,'.','') ?>°
</nobr>
&nbsp;&nbsp;/&nbsp;&nbsp;
<nobr>
<?= $point->lat > 0 ? 'N' : 'S' ?><?= Coord::dergeeToMinute($point->lat) ?>
<?= $point->lng > 0 ? 'E' : 'W' ?><?= Coord::dergeeToMinute($point->lng) ?>
</nobr>
&nbsp;&nbsp;/&nbsp;&nbsp;
<a href="/?point=<?= $point->id ?>">На карте</a>
</div>
<div style="text-align: justify;">
<?php
if (count($text) > 4)
{
for ($index = 0; $index < 4; $index++)
{
print $text[$index];
}
} else
{
print $point->descriptionHtml;
}
?>
<?php if ($photos || $point->img): ?>
<br/><br/>
<table border="0">
<tr>
<td width="33%"></td>
<td width="34%">
<div class="fotorama" data-width="555" data-height="450" data-loop="true">
<?php if ($point->img): ?>
<img data-thumb="<?= $point->img ?>" src="<?= $point->img ?>">
<?php endif; ?>
<?php if ($photos): ?>
<?php foreach ($photos as $photo): ?>
<img data-thumb="/photos/small/<?= $photo->name ?>" src="/photos/middle/<?= $photo->name ?>">
<?php endforeach; ?>
<?php endif; ?>
<span>
<div id="map" style="width: 100%; height: 100%; position: static; display: block;"></div>
</span>
</div>
</td>
<td width="33%"></td>
</tr>
</table>
<br/><br/>
<?php endif; ?>
<?php
if (count($text) > 3)
{
for ($index = $index; $index < count($text); $index++)
{
print $text[$index] . ' ';
}
}
?>
</div>
<p style="margin-top: 25px; text-align: right;">
<?php if (App::$user && App::$user->id): ?>
[ <button type="button" class="btn btn-link" style="color: #333;" onclick="addRemoveFavorite(<?= $point->id ?>)"><span id="myFavoritesButton" class="glyphicon glyphicon-star<?= $point->inFavorites ? '' : '-empty' ?>"></span> Хочу посетить</button> ]
[ <button type="button" class="btn btn-link" style="color: #333;" onclick="addRemoveLike(<?= $point->id ?>)"><span id="myLikesButton" class="glyphicon glyphicon-<?= $point->iLike ? 'ok' : 'thumbs-up' ?>"></span> Нравится</button> ]
<?php else: ?>
[ <span class="glyphicon glyphicon-star"></span> <?= $countInFavs ?> - в закладках ]
[ <span class="glyphicon glyphicon-thumbs-up"></span> <?= $countLikes ?> - нравится ]
<?php endif; ?>
[ <span class="glyphicon glyphicon-user"></span> <?= $point->authorUser->nick ?> - <span class="glyphicon glyphicon-pencil" title="<?= date('d-m-Y H:i',$point->date) ?>"></span> <?= $point->authorUser->getPointsCount() ?> ]
[ <span class="glyphicon glyphicon-new-window"></span> <a href="<?= $point->source ?>" target="_blank">источник</a> ]
<!-- [ <span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star-empty"></span> ] -->
</p>
</div>
</div>
<hr/>
<div class="row">
<div class="col-md-12">
<h3 style="margin-top: 0;">Поблизости:</h3>
<?php if (empty($closestPoints)): ?>
нет известных нам точек.
<?php else: ?>
<?php foreach ($closestPoints as $cPoint): ?>
<a href="/page/point/id/<?= $cPoint->id ?>" style="display: inline-block; height: 139px; width: 16,6%; overflow: hidden;"><img src="<?= $cPoint->getImg() ?>" title="<?= $cPoint->name ?>" style="width: 186px; height: 139px;"/></a>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<hr/>
<div class="row">
<div class="col-md-12">
<h3 style="margin-top: 0;">Похожие:</h3>
<?php foreach ($similarPoints as $sPoint): ?>
<a href="/page/point/id/<?= $sPoint->id ?>" style="display: inline-block; height: 139px; width: 16,6%; overflow: hidden;"><img src="<?= $sPoint->getImg() ?>" title="<?= $sPoint->name ?>" style="width: 186px; height: 139px;"/></a>
<?php endforeach; ?>
</div>
</div>
<hr/>
<div class="row">
<div class="col-md-12">
<a href="/page/point/id/<?= $randomPoint->id ?>" style="float: left; margin: 0 20px 0 0;"><img src="<?= $randomPoint->getImg() ?>" style="width: 200px;"/></a>
<h3 style="margin-top: 0;">Это интересно: <?= $randomPoint->name ?></h3>
<p>
<?= mb_substr($randomPoint->description, 0, 400, 'UTF-8') ?>...
<a class="" href="/page/point/id/<?= $randomPoint->id ?>" role="button"><nobr> читать далее »</nobr></a>
</p>
</div>
</div>
</div>