TRY - OG
This commit is contained in:
parent
849fb5a97f
commit
a730842c1a
|
|
@ -42,9 +42,9 @@ class Helper
|
||||||
$og['title'] = $point->name . ' [wikipoints.ru]';
|
$og['title'] = $point->name . ' [wikipoints.ru]';
|
||||||
$og['description'] = mb_substr($point->description, 0, 200).'...';
|
$og['description'] = mb_substr($point->description, 0, 200).'...';
|
||||||
$og['site_name'] = 'WikiPoints: Лучшие выходные - это выходные в путешествии!';
|
$og['site_name'] = 'WikiPoints: Лучшие выходные - это выходные в путешествии!';
|
||||||
$og['type'] = 'article';
|
$og['type'] = 'website';
|
||||||
$og['url'] = 'http://wikipoints.ru/?point=' . $point->id;
|
$og['url'] = 'http://wikipoints.ru/?point=' . $point->id;
|
||||||
$og['image'] = $point->getImg();
|
$og['image'] = $point->getImg('middle');
|
||||||
|
|
||||||
return $og;
|
return $og;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -165,8 +165,22 @@ class IndexController extends Controller
|
||||||
|
|
||||||
static function actionTest()
|
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,
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class Point extends Model
|
||||||
return new self();
|
return new self();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getImg()
|
public function getImg($size = 'small')
|
||||||
{
|
{
|
||||||
$img = $this->img;
|
$img = $this->img;
|
||||||
if ($img == '')
|
if ($img == '')
|
||||||
|
|
@ -27,7 +27,7 @@ class Point extends Model
|
||||||
if (!$img)
|
if (!$img)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
$img = '/photos/small/'.$img->name;
|
$img = '/photos/'.$size.'/'.$img->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $img;
|
return $img;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue