вики-ссылки на странице точки в блоке случайной точки

This commit is contained in:
Krivchikov Dmitry 2014-11-26 22:05:26 +03:00
parent 8dd3d4d3b8
commit 4d79b89218
1 changed files with 3 additions and 1 deletions

View File

@ -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,