From 4d79b8921841e6c1a5b5f23abfeec66b00d16e3a Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Wed, 26 Nov 2014 22:05:26 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B2=D0=B8=D0=BA=D0=B8-=D1=81=D1=81=D1=8B?= =?UTF-8?q?=D0=BB=D0=BA=D0=B8=20=D0=BD=D0=B0=20=D1=81=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=86=D0=B5=20=D1=82=D0=BE=D1=87=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B2=20=D0=B1=D0=BB=D0=BE=D0=BA=D0=B5=20=D1=81=D0=BB=D1=83?= =?UTF-8?q?=D1=87=D0=B0=D0=B9=D0=BD=D0=BE=D0=B9=20=D1=82=D0=BE=D1=87=D0=BA?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ground/controllers/PageController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ground/controllers/PageController.php b/ground/controllers/PageController.php index ef116a0..bfc9927 100644 --- a/ground/controllers/PageController.php +++ b/ground/controllers/PageController.php @@ -76,9 +76,11 @@ class PageController extends Controller $point->categoryName = $categories[$point->categoryId]['name']; $point->descriptionHtml = Helper::replaceLinks($point->descriptionHtml); preg_match_all("/.*?(([.?!](?:\s|$))|$)/s", $point->descriptionHtml, $items); - $randomPoint = Point::model()->getRandom(); $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(); + $randomPoint->description = mb_substr($randomPoint->description, 0, 400, 'UTF-8'); + $randomPoint->description = Helper::replaceLinks($randomPoint->description); self::render('point.php', array( 'point' => $point,