From 4cfe36bd022d18838f6c556d6f55316dede1b43a Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Sun, 7 Dec 2014 13:04:30 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=B0=D0=B9=D0=BA=D0=B8=20=D0=BD=D0=B0?= =?UTF-8?q?=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D0=B5=20=D1=82?= =?UTF-8?q?=D0=BE=D1=87=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ground/controllers/PageController.php | 10 ++++++++++ ground/views/point.php | 9 +++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ground/controllers/PageController.php b/ground/controllers/PageController.php index bfc9927..5e32c70 100644 --- a/ground/controllers/PageController.php +++ b/ground/controllers/PageController.php @@ -59,6 +59,12 @@ class PageController extends Controller self::addStyle('/css/bootstrap-theme.min.css'); self::addStyle('/css/fotorama.css'); + if (App::$user && App::$user->id) { + self::addVar('user', App::$user->id); + } else { + self::addVar('user', '0'); + } + $point = Point::model()->getByPK($pointId); if ($point->id == NULL) @@ -76,6 +82,9 @@ class PageController extends Controller $point->categoryName = $categories[$point->categoryId]['name']; $point->descriptionHtml = Helper::replaceLinks($point->descriptionHtml); preg_match_all("/.*?(([.?!](?:\s|$))|$)/s", $point->descriptionHtml, $items); + $point->inFavorites = Favorite::model()->checkIsMy($pointId); + $point->iLike = Like::model()->checkIsMy($pointId); + $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(); @@ -93,6 +102,7 @@ class PageController extends Controller 'countInFavs' => Favorite::model()->countInFavs($pointId), 'countLikes' => Like::model()->countLikes($pointId), 'og' => Helper::buildOG($point), + 'user' => App::$user, )); } else { diff --git a/ground/views/point.php b/ground/views/point.php index c31b68e..168fbdb 100644 --- a/ground/views/point.php +++ b/ground/views/point.php @@ -70,8 +70,13 @@

- [ - в закладках ] - [ - нравится ] + id): ?> + [ ] + [ ] + + [ - в закладках ] + [ - нравится ] + [ authorUser->nick ?> - authorUser->getPointsCount() ?> ] [ источник ]