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 @@
- [ = $countInFavs ?> - в закладках ] - [ = $countLikes ?> - нравится ] + id): ?> + [ ] + [ ] + + [ = $countInFavs ?> - в закладках ] + [ = $countLikes ?> - нравится ] + [ = $point->authorUser->nick ?> - = $point->authorUser->getPointsCount() ?> ] [ источник ]