wikipoints/ground/views/point.php

157 lines
6.3 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.

<?php
$index = 0;
?>
<div id="pageSmoothBackground" style="background-image: url(<?= $point->getImg('middle') ?>);"></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>
<?php if ($user && $user->isAdmin): ?>
&nbsp;&nbsp;/&nbsp;&nbsp;
<a href="/?point=<?= $point->id ?>&edit=true">Редактировать</a>
<?php endif; ?>
</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/>
<div style="text-align: center;">
<div class="dfotorama" data-loop="true" data-nav="thumbs" data-thumbwidth="100" data-keyboard="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 ?>" data-caption="<?= $photo->getOriginalLink()?>">
<?php endforeach; ?>
<?php endif; ?>
<span data-thumb="/img/mapThumb.png">
<div id="map" style="width: 100%; height: 100%; position: static; display: block;"></div>
</span>
</div>
</div>
<br/><br/>
<?php endif; ?>
<?php
if (count($text) > 4) {
for ($index = $index; $index < count($text); $index++) {
print $text[$index] . ' ';
}
print "<br/><br/>";
}
?>
<?php if($extraParams): ?>
<div style="width: 100%; text-align: center;">
<table class="table table-bordered table-hover" style="background-color: #fff; display: inline-table; width: 75%; text-align: left;">
<thead>
<tr>
<th>Параметр</th>
<th>Значение</th>
</tr>
</thead>
<?php foreach ($extraParams as $extraParam) {
print '<tr>';
print '<td>'.$extraParam->name.'</td>';
print '<td>'.$extraParam->value.'</td>';
print '</tr>';
}
?>
</table>
</div>
<?php endif;
?>
<?php if ($photoLinks): ?>
Использованы фотоматериалы с сайтов: <?= $photoLinks ?>
<?php endif; ?>
</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> <a href="/user/<?= $point->authorUser->id ?>"><?= $point->authorUser->nick ?></a> - <span class="glyphicon glyphicon-pencil" title="<?= date('d-m-Y H:i', $point->date) ?>"></span> <?= $point->authorUser->getPointsCount() ?> ]
<?php if (App::$user && App::$user->isAdmin == 1): ?>
[ <span class="glyphicon glyphicon-new-window"></span> <a href="<?= $point->source ?>" target="_blank">источник: <?= $point->source ?></a> ]
<?php endif; ?>
</p>
</div>
</div>
<hr/>
<!--googleoff: all-->
<!--noindex-->
<?php if ($articles): ?>
<div class="row">
<div class="col-md-12">
<h3 style="margin-top: 0;">Эта точка в статьях:</h3>
<?php foreach ($articles as $article): ?>
<a href="/article/<?= $article->id ?>" class="pagePoinsNearCards"><img src="<?= $article->getImg('small') ?>" title="<?= $article->title ?>" class="pagePoinsNearCardsImg"/></a>
<?php endforeach; ?>
</div>
</div>
<hr/>
<?php endif; ?>
<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="/point/<?= $cPoint->id ?>" class="pagePoinsNearCards"><img src="<?= $cPoint->getImg() ?>" title="<?= $cPoint->name ?>" class="pagePoinsNearCardsImg"/></a><?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<hr/>
<?php if (!$articles): ?>
<div class="row">
<div class="col-md-12">
<h3 style="margin-top: 0;">Похожие точки:</h3>
<?php foreach ($similarPoints as $sPoint): ?><a href="/point/<?= $sPoint->id ?>" class="pagePoinsNearCards"><img src="<?= $sPoint->getImg() ?>" title="<?= $sPoint->name ?>" class="pagePoinsNearCardsImg"/></a><?php endforeach; ?>
</div>
</div>
<hr/>
<?php endif; ?>
<div class="row">
<div class="col-md-12">
<a href="/point/<?= $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="/point/<?= $randomPoint->id ?>" role="button"><nobr> читать далее »</nobr></a>
</p>
</div>
</div>
<!--/noindex-->
<!--googleon: all-->
</div>