diff --git a/ground/controllers/PointController.php b/ground/controllers/PointController.php index bc12d53..2c46e21 100644 --- a/ground/controllers/PointController.php +++ b/ground/controllers/PointController.php @@ -75,6 +75,16 @@ class PointController extends Controller $randomPoint->description = mb_substr($randomPoint->description, 0, 400, 'UTF-8'); $randomPoint->description = Helper::replaceLinks($randomPoint->description); + $articlePoints = ArticlePoints::model()->getAll(array('where'=>'`pointId` = '.$pointId)); + $articleIds = array(); + $articles = array(); + if ($articlePoints) { + foreach ($articlePoints as $articlePoint) { + $articleIds[] = (int)$articlePoint->articleId; + } + $articles = Article::model()->getAll(array('where'=>'`id` IN ('. implode(',', $articleIds).')')); + } + self::render('point.php', array( 'point' => $point, 'text' => $items[0], @@ -88,6 +98,7 @@ class PointController extends Controller 'og' => Helper::buildOG($point), 'user' => App::$user, 'photoLinks' => $photoLinksRes, + 'articles' => $articles, )); } else { App::error404(); diff --git a/ground/models/Article.php b/ground/models/Article.php index 9dde028..e27e71a 100644 --- a/ground/models/Article.php +++ b/ground/models/Article.php @@ -28,7 +28,7 @@ class Article extends Model } - return '/img/logo.png'; + return $size == 'small' ? '/img/noPhoto200150.png' : '/img/logo.png'; } } diff --git a/ground/views/point.php b/ground/views/point.php index 240c384..0c37a8d 100644 --- a/ground/views/point.php +++ b/ground/views/point.php @@ -89,9 +89,20 @@ $index = 0;
+
-

Поблизости:

+

Эта точка в статьях:

+ + + +
+
+
+ +
+
+

Поблизости расположены:

нет известных нам точек. @@ -100,13 +111,15 @@ $index = 0;

+
-

Похожие:

+

Похожие точки:


+
diff --git a/public/img/noPhoto200150.png b/public/img/noPhoto200150.png new file mode 100644 index 0000000..65cd124 Binary files /dev/null and b/public/img/noPhoto200150.png differ