diff --git a/ground/classes/Helper.php b/ground/classes/Helper.php index 04ef134..3a3c977 100644 --- a/ground/classes/Helper.php +++ b/ground/classes/Helper.php @@ -42,9 +42,9 @@ class Helper $og['title'] = $point->name . ' [wikipoints.ru]'; $og['description'] = mb_substr($point->description, 0, 200).'...'; $og['site_name'] = 'WikiPoints: Лучшие выходные - это выходные в путешествии!'; - $og['type'] = 'article'; + $og['type'] = 'website'; $og['url'] = 'http://wikipoints.ru/?point=' . $point->id; - $og['image'] = $point->getImg(); + $og['image'] = $point->getImg('middle'); return $og; } diff --git a/ground/controllers/IndexController.php b/ground/controllers/IndexController.php index 840a507..fc230a8 100644 --- a/ground/controllers/IndexController.php +++ b/ground/controllers/IndexController.php @@ -165,8 +165,22 @@ class IndexController extends Controller static function actionTest() { + $route = array(301, 128); - var_dump(Favorite::model()->getAllMy()); +// $route = Point::model()->getAll(array('where' => '`id` IN ('.implode(', ', array_fill(1, count($route), '?')).')'), $route); +//// print_r(array('where' => '`id` IN ('.implode(', ', array_fill(1, count($route), '?')).')'));die; +// print_r($route);die; + + $points = array(); + foreach ($route as $pointId){ + if ((int) $pointId) { + $points[] = Point::model()->getByPK($pointId); + } + } + + self::renderPartial('route.php', array( + 'points' => $points, + )); } } diff --git a/ground/models/Point.php b/ground/models/Point.php index 61fabd7..4184609 100644 --- a/ground/models/Point.php +++ b/ground/models/Point.php @@ -16,7 +16,7 @@ class Point extends Model return new self(); } - public function getImg() + public function getImg($size = 'small') { $img = $this->img; if ($img == '') @@ -27,7 +27,7 @@ class Point extends Model if (!$img) return null; - $img = '/photos/small/'.$img->name; + $img = '/photos/'.$size.'/'.$img->name; } return $img;