Переделано отображение сайтов-источников изображений
This commit is contained in:
parent
79935923b0
commit
ec8ffbd82a
|
|
@ -120,6 +120,18 @@ class PageController extends Controller
|
|||
$point->inFavorites = Favorite::model()->checkIsMy($pointId);
|
||||
$point->iLike = Like::model()->checkIsMy($pointId);
|
||||
|
||||
|
||||
$photoLinks = PhotoLinks::model()->getAll(array('where'=>'`photo` LIKE "'.$pointId.'_%"'));
|
||||
$photoLinksRes = array();
|
||||
if ($photoLinks) {
|
||||
foreach ($photoLinks as $photoLink) {
|
||||
if ($photoLink->host) {
|
||||
$photoLinksRes[strtolower($photoLink->host)] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
$photoLinksRes = implode('; ', array_keys($photoLinksRes));
|
||||
|
||||
$similarPoints = Point::model()->getAll(array('where' => 'categoryId = '.$point->categoryId.' AND `id` <> '.$point->id.' ORDER BY RAND() LIMIT 6;'));
|
||||
$closestPoints = Point::model()->getClosestPoints($pointId);
|
||||
$randomPoint = Point::model()->getRandom();
|
||||
|
|
@ -138,6 +150,7 @@ class PageController extends Controller
|
|||
'countLikes' => Like::model()->countLikes($pointId),
|
||||
'og' => Helper::buildOG($point),
|
||||
'user' => App::$user,
|
||||
'photoLinks' => $photoLinksRes,
|
||||
));
|
||||
} else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
<?php endif; ?>
|
||||
<?php if ($photos): ?>
|
||||
<?php foreach ($photos as $photo): ?>
|
||||
<img data-thumb="/photos/small/<?= $photo->name ?>" data-caption="Источник: <?= PhotoLinks::getCaption($photo->name)?>" src="/photos/middle/<?= $photo->name ?>">
|
||||
<img data-thumb="/photos/small/<?= $photo->name ?>" src="/photos/middle/<?= $photo->name ?>">
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<span data-thumb="/img/mapThumb.png">
|
||||
|
|
@ -63,6 +63,10 @@
|
|||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($photoLinks):?>
|
||||
Использованы фотоматериалы с сайтов: <?= $photoLinks?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<p style="margin-top: 25px; text-align: right;">
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ div.header img {height: 89px;}
|
|||
div.add {cursor: pointer;}
|
||||
|
||||
.fotorama {display: inline-block;}
|
||||
.fotorama .fotorama__caption{text-align: left; font-size: 9px; opacity: 0.7;}
|
||||
|
||||
#addPointModal .extraImage .button {cursor: pointer; background-color: #eeeeee;}
|
||||
#addPointModal .extraImage .remove:hover {background-color: #f4bfbf;}
|
||||
|
|
|
|||
Loading…
Reference in New Issue